On Fri, 17 May 2013 13:07:20 -0400
Dubiousjim <lists+alpine-devel_at_jimpryor.net> wrote:
> These are questions in the first place for Natanael, but I'm sending
> to list because others may also have insight, or wish to hear the
Hi, sorry for ignoring your previous emails. They came when i was short
on time and the they simply were to long and deep. :-/
It might help if you split up your questions in shorter emails (eg
part 1, part 2, etc)
> I've been wrestling for a couple of weeks getting ghc (Glasgow Haskell
> Compiler) to build on Alpine. I think I've succeeded, and I will write
> up the directions and put them on the wiki.
It would be nice.
> If we can put the
> binaries I generated somewhere, then they can be used in an APKBUILD
> to bootstrap a build of newer versions of ghc. (Ghc needs a
> relatively-recent binary of ghc to build itself, else the compilation
> process is the more complex and arduous process that I went through.)
ugh, apps that needs bootstrapping are often problematic (gcc, and
> Anyways, as part of this write-up, I'm writing up an explanation of
> how I setup a cross-compiler inside an ArchLinux install (which, as it
> happens, was in a chroot on my Alpine box) to build binaries targeting
Sounds complicated. You cannot build a native compiler in alpine?
Crosscompiling is a pretty complicated chapter, as you noticed. Last
time we did it was when we enabled NPTL in uclibc iirc.
> That's what the rest of this email is about; you can just
> ignore the background about Haskell/ghc.
> I set up my cross-compiler using recent versions of buildroot (both
> the 2013.02 and 2013.05-rc2 releases). There were a couple of
> frustrating snags here, that I am trying to smooth out in my writeup.
> One snag is that I had to do something like this on my Alpine box, to
> be able to execute the binaries that the cross-compiler generated:
> $ sudo ln -s libc.so.0.9.32 /lib/libc.so
> $ sudo ln -s libuClibc-0.9.33.2.so /lib/libc.so.0
> $ sudo ln -s libmpc.so.3 /usr/lib/libmpc.so
> $ for f in ld-uClibc libcrypt libdl libm libpthread libresolv librt
> libubacktrace libutil; do sudo ln -s $f-0.9.33.2.so /lib/$f.so.0;
> Anyone have ideas about how to eliminate the need to do this?
what does readelf -d say that SONAME is set to? Compare that with what
SONAME is in a native alpine linux.
> I examined the different configuration options that buildroot supplies
> when making its cross-compiling gcc, and the options that Alpine's
> APKBUILD uses. I thought it'd be a good idea to make buildroot
> approximate our native setup as closely as possible. However, to keep
> things from getting too complicated, I'm going to try to avoid
> applying the patches at
Ok. That is for our hardened toolchain.
> With that in mind, here are my questions about our present APKBUILD
> (I'm looking at the APKBUILD for gcc-4.7.3-r6).
> prepare() has the following:
> sed -i 's/use_fixproto=yes/:/' gcc/config.gcc || return 1
> This seems to be obsolete; see bottom of
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33200, also I've verified
> that this is a noop on the gcc/config.gcc in the gcc-4.7.3 sources.
Probably leftovers. Could you please create an issu for this on
> Our sources has:
> The first block of patches all seem to come from
> however this doesn't include all of the patches available at that
> site. Should I assume that the rest of the patches available there
> have been reviewed and specifically rejected as not being relevant to
> Alpine, or introducing undesired changes?
Yes, I think I included some patches that I thought was not yet
relevant but probably soon would be (like the arm patches).
> What about the patches available at
> Buildroot includes all of those patches, but at a first glance, it
> seems like we don't include them? Are first appearances misleading
I haven't looked over those, so I cannot really comment on those. I
think our patches and the gentoo uclibc patches were closer when we
separated from gentoo (alpine 1.9). I think we didn't need them. We
might have same patches or corresponding patches with different names.
> What about the rest of the patches in our sources list: where do those
> come from? Were they generated by Alpine devs, or do they come from
> miscellaneous places?
both I think.
> If anyone can venture a recommendation as to
> whether I should apply those patches (and also the earlier block of
> patches) to my cross-compiling gcc, I'd welcome the advice.
I'll comment from top of my head here bellow:
for the piepatches. It allow us to disable the enforced hardened flags
with GCC_SPECS env var.
Those I don't remember.
I think this will be critical for you. It enables the
We added this when uclibc broke ABI. uClibc does not even try to be ABI
compatible sine the target embeded. We want to be able to upgrade, not
only reinstall so we need some kind of ABI stability. the first
releases had soname libc.so.0. This is hardcoded in gcc sources. when
ABI broke we decided to set soname to libc.so.0.9.32 and add an
additional package named libc0.9.32 so both uclibc and libc0.9.32
packges could be installed in parallel while upgrading.
since then the ABI have not broken again.
I don't remember. might be something uclibc devs found and reported. It
probably bite us at some point.
I think this was to be able to compile stdc++ or gcc java.
This patch dropped the /lib64 and /lib32 dirs for multiarch.
Something for go-lang.
> I know there's a lot of info/questions here. I'd be glad for any
> partial answers, too.
I'll stop here for now. I'll try comment the rest in other email.
The --with-dynamic-linker is important as explained above. You will
also set a variable when building uclibc, ABI something.
I think it will be a good time for me to look over the toolchain soon.
Will upgrade gcc to 4.8.
Crosscompiling for ARM is also a hot topic, and so is musl instead of
Received on Fri May 17 2013 - 20:47:04 UTC