[oe] libgcc not being pulled into OABI images

Richard Purdie rpurdie at rpsys.net
Sun Mar 30 21:19:41 UTC 2008


Hi,

Various people had reported problems with libgcc not being pulled into
OABI images after some of the recent changes. Basically libgcc isn't
being listed as NEEDED (in objdump -p) when it used to be.

I did some tests comparing a good build with a bad build and it looked
like there was some problem with the crtbegin.o and crtbeginS.o files in
the cross directory. Swapping those two files over makes the difference
between libgcc appearing in NEEDED and not appearing.

These come from gcc-cross and the difference in compile options which
seems to trigger the problem is the -Dinhibit_libc flag. This is set in
the Makefile by the inhibit_libc option. Dependencies work as expected
if its true and break if its false.

That variable is set from gcc/configure with:

# If this is a cross-compiler that does not
# have its own set of headers then define
# inhibit_libc

# If this is using newlib, without having the headers available now,
# then define inhibit_libc in LIBGCC2_CFLAGS.
# This prevents libgcc2 from containing any code which requires libc
# support.
inhibit_libc=false
if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
       test x$with_newlib = xyes ; } &&
     { test "x$with_headers" = x || test "x$with_headers" = xno ; } ;
then
       inhibit_libc=true
fi

and in the recent gcc changes we've messed around with a number of these
options so this is likely to be the reason for the change.

I suspect in EABI builds something else causes libgcc to be pulled in
since inhibit_libc=false for these too yet they don't break.

So no, I don't have a fix as such and someone needs to look into this
further but at least we have a clue to the problem.

The bug reports were pthread related and it could be that specific
library has a problem which this other change was masking until now...

Cheers,

Richard





More information about the Openembedded-devel mailing list