All of lore.kernel.org
 help / color / mirror / Atom feed
* libgcc not being pulled into OABI images
@ 2008-03-30 21:19 Richard Purdie
  2008-03-30 23:40 ` Thomas Kunze
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2008-03-30 21:19 UTC (permalink / raw)
  To: openembedded-devel

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libgcc not being pulled into OABI images
  2008-03-30 21:19 libgcc not being pulled into OABI images Richard Purdie
@ 2008-03-30 23:40 ` Thomas Kunze
  2008-04-02  6:17   ` Khem Raj
  2008-04-03 12:26   ` Rolf Leggewie
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Kunze @ 2008-03-30 23:40 UTC (permalink / raw)
  To: openembedded-devel

Hi,

I tested on my host machine (AMD64) and libgcc is not it NEEDED but is 
installed anyway. So it seems to be no problem that libgcc is not in 
needed. So I investigated libpthread and found out that it tries to 
dlopen libgcc and fails if it can't. Our shlibs code can't detect this 
so libgcc does not get pulled into image. So I suggest something like:

--- packages/glibc/glibc.inc    e9a2a880277298ca08e7f53a4e5c69127415a5ed
+++ packages/glibc/glibc.inc    3aa1e1a80cf9f0f899b5a79b857bfa5427f5d54e
@@ -7,6 +7,8 @@ DEPENDS = "${@['virtual/${TARGET_PREFIX}
 DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 
'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} 
linux-libc-headers"
 #this leads to circular deps, so lets not add it yet
 #RDEPENDS_ldd += " bash"
+# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
+RDEPENDS += "${@['','libgcc']['ntpl' in '${GLIBC_ADDONS}']}"
 PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', 
'']['nptl' in '${GLIBC_ADDONS}']}"
 PROVIDES += "virtual/libintl virtual/libiconv"


Is it ok if I comit this (and bump PRs of all packages that use this file?)

Regards,
Thomas



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libgcc not being pulled into OABI images
  2008-03-30 23:40 ` Thomas Kunze
@ 2008-04-02  6:17   ` Khem Raj
  2008-04-03 12:26   ` Rolf Leggewie
  1 sibling, 0 replies; 4+ messages in thread
From: Khem Raj @ 2008-04-02  6:17 UTC (permalink / raw)
  To: openembedded-devel

On Sun, Mar 30, 2008 at 4:40 PM, Thomas Kunze <thommycheck@gmx.de> wrote:
> Hi,
>
>  I tested on my host machine (AMD64) and libgcc is not it NEEDED but is
>  installed anyway. So it seems to be no problem that libgcc is not in
>  needed. So I investigated libpthread and found out that it tries to
>  dlopen libgcc and fails if it can't. Our shlibs code can't detect this
>  so libgcc does not get pulled into image. So I suggest something like:
>
>  --- packages/glibc/glibc.inc    e9a2a880277298ca08e7f53a4e5c69127415a5ed
>  +++ packages/glibc/glibc.inc    3aa1e1a80cf9f0f899b5a79b857bfa5427f5d54e
>  @@ -7,6 +7,8 @@ DEPENDS = "${@['virtual/${TARGET_PREFIX}
>   DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial',
>  'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']}
>  linux-libc-headers"
>   #this leads to circular deps, so lets not add it yet
>   #RDEPENDS_ldd += " bash"
>  +# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
>  +RDEPENDS += "${@['','libgcc']['ntpl' in '${GLIBC_ADDONS}']}"
>   PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc',
>  '']['nptl' in '${GLIBC_ADDONS}']}"
>   PROVIDES += "virtual/libintl virtual/libiconv"
>
>
>  Is it ok if I comit this (and bump PRs of all packages that use this file?)

nptl glibc dlopens libgcc (e.g. code using exceptions) so this fix
creating an explicit dependency looks ok to me.
it does not have it in DT_NEEDED section may be because it links with
-static-libgcc when build

>
>  Regards,
>  Thomas
>
>
>
>  _______________________________________________
>  Openembedded-devel mailing list
>  Openembedded-devel@lists.openembedded.org
>  http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libgcc not being pulled into OABI images
  2008-03-30 23:40 ` Thomas Kunze
  2008-04-02  6:17   ` Khem Raj
@ 2008-04-03 12:26   ` Rolf Leggewie
  1 sibling, 0 replies; 4+ messages in thread
From: Rolf Leggewie @ 2008-04-03 12:26 UTC (permalink / raw)
  To: openembedded-devel

Thomas Kunze wrote:
> So I suggest something like:

Thomas,

thanks for your work on this.  Unfortunately, the issue remains the same
for me, even with that change.  I added the lines you suggested, cleaned
out tmp and compiled an altboot-console-image.  The boot process hangs
with "libgcc_so.1 must be installed for pthread_cancel to work"

Regards

Rolf




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-03 12:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-30 21:19 libgcc not being pulled into OABI images Richard Purdie
2008-03-30 23:40 ` Thomas Kunze
2008-04-02  6:17   ` Khem Raj
2008-04-03 12:26   ` Rolf Leggewie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.