Dear buildroot list.
Rob Landley
rob at landley.net
Fri Oct 14 13:02:49 PDT 2005
Sorry to ask a uClibc question on the buildroot list, but I don't know where
else to go.
The short thing seems to be that gcc 4.0.2 wants to call dl_iterate_phdr, and
Erik removed it here:
http://www.uclibc.org/cgi-bin/viewcvs.cgi?rev=9216&view=rev
The long explanation:
I'm trying to get gcc 4.0.2 to build against uClibc, starting with the
invocation I made to get 3.2 to build and figuring out what new breakage the
gcc developers managed to come up with. Basically I ran a few sed
invocations against the gcc sources (both to teach it about uClibc and to
prefix its directories with /tools, ala Linux From Scratch chapter 5), did
a ./configure, and ran "make quickstrap". Voiala, cross compiler.
Unfortunately, gcc 4.0 contains a package "libmudflap" which is A) evil, B)
totally undocumented. Even google can't tell me what this thing does or
whether I actually need it. All I know is it breaks the build.
During its ./configure (which doesn't run during the top level ./configure but
during the make quickstrap: THANK you, gcc developers!), it tries to create
and run an executable using the half-finished compiler the system is
building. (Ha ha, if you were using a cross-compiler you'd have specified a
different --target!) Of course this compiler was told to link its binaries
against uClibc, which I haven't installed yet, so this fails with can't find
crt0. Right.
So I install uClibc (0.9.27, I still need to upgrade busybox tar to understand
the "--exclude" option before 0.9.28's headers will install), re-run the
thing, and now it's complaining it can't find dl_iterate_phdr:
/home/landley/newbuild/firmware-build/tools/sources/gcc-build/gcc/libgcc_s.so:
undefined reference to `dl_iterate_phdr'
Which there are indeed calls to in the source code:
landley at driftwood:~/newbuild/firmware-build/tools/sources/gcc-4.0.2$ find . |
xargs grep dl_iterate_phdr
./gcc/ChangeLog.6: (_Unwind_FindTableEntry): Use dl_iterate_phdr.
./gcc/unwind-dw2-fde-glibc.c: segment and dl_iterate_phdr to avoid
register/deregister calls at
./gcc/unwind-dw2-fde-glibc.c: if (dl_iterate_phdr
(_Unwind_IteratePhdrCallback, &data) < 0)
./gcc/config/ia64/fde-glibc.c: if (dl_iterate_phdr
(_Unwind_IteratePhdrCallback, &data) < 0)
Does anyone have any obvious suggestions? Why was it removed from uClibc?
This is not something upgrading to 0.9.28 is likely to fix because according
to subversion the symbol is still missing. Should I just try to chop it out
of the source code?
Rob
P.S. I patched gcc/unwind-dw2-fde-glibc.c to replace the call with if(0), and
it seems to have built. I think the only reason it should ever want to do
stack unwinding is for debugging or c++, neither of which I'm currently
using. But I thought I should mention it anyway...
More information about the uClibc
mailing list