[uClibc 0002414]: Order of linking libraries can causes application not to run
bugs at busybox.net
bugs at busybox.net
Sun Oct 12 20:54:35 UTC 2008
A NOTE has been added to this issue.
======================================================================
http://busybox.net/bugs/view.php?id=2414
======================================================================
Reported By: pqa
Assigned To: uClibc
======================================================================
Project: uClibc
Issue ID: 2414
Category: Posix Threads
Reproducibility: always
Severity: major
Priority: normal
Status: feedback
======================================================================
Date Submitted: 03-03-2008 14:52 PST
Last Modified: 10-12-2008 13:54 PDT
======================================================================
Summary: Order of linking libraries can causes application
not to run
Description:
Using uClibc version 0.9.29, linking with -nodefaultlibs -lc -lpthreads
causes the application to consume 100% CPU time indefinitely, before
main() is called. Linking with -nodefaultlibs -lpthreads -lc allows the
application to run.
Application is cross compiled to run on bcrm47xx mipsel processor, using
gcc 4.1.2 and is using libpthreads.old.
I can provide further information if needed, but I am not sure what other
information would be helpful.
Attached file builds example application in form that works and form that
doesn't.
======================================================================
----------------------------------------------------------------------
xi - 03-26-08 14:56
----------------------------------------------------------------------
This is very similar to what I encountered with our MIPS toolchain and
NPTL. 0002264 might be the same problem too.
I found one potential cause:
- Once libpthread is linked, standard loader is used instead of uClibc
loader
Here is a console log showing this problem with ldd:
$
/opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-gcc
-o test testc.o
/opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-ldd
test
checking sub-depends for 'not found'
libc.so.0 => not found (0x00000000)
<b>/lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)</b>
/opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-gcc
-o test testc.o –lpthread
$
/opt/toolchains/uclibc-crosstools-gcc-4.2.1-7/usr/bin/mips-linux-uclibc-ldd
test
checking sub-depends for '/lib/libpthread.so.0'
checking sub-depends for 'not found'
checking sub-depends for '/lib/libc.so.6'
libpthread.so.0 => /lib/libpthread.so.0 (0x00000000)
libc.so.0 => not found (0x00000000)
libc.so.6 => /lib/libc.so.6 (0x00000000)
<b>/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)</b>
$
----------------------------------------------------------------------
carmelo73 - 10-11-08 23:49
----------------------------------------------------------------------
The fact that there is a dependencies on /lib/libc.so.6, means that some
libraries
are not correclty built.
Wrong compiler configuration ? wrong libraries used ?
Please post the output of the command 'readelf -d' executed over your test
and linked libraries to check which is the offending one.
----------------------------------------------------------------------
pqa - 10-12-08 00:58
----------------------------------------------------------------------
Output of readelf -d uploaded for libraries and programs. As a reminder,
pqa-plast has the problem, pqa-pfirst works Ok.
----------------------------------------------------------------------
bernhardf - 10-12-08 13:54
----------------------------------------------------------------------
Can you please verify that this problem can still be observed with:
- uClibc-trunk
- gcc-4.3.2 (i.e. the current, stable gcc, just in case)
- binutils >= 2.18 (preferably 2.18.50.0.9)
If this fails, please double-check against the uClibc-nptl branch.
TIA,
Issue History
Date Modified Username Field Change
======================================================================
03-03-08 14:52 pqa New Issue
03-03-08 14:52 pqa Status new => assigned
03-03-08 14:52 pqa Assigned To => uClibc
03-03-08 14:52 pqa File Added: pthread.proc
03-26-08 14:49 xi Note Added: 0006084
03-26-08 14:54 xi Note Edited: 0006084
03-26-08 14:56 xi Note Edited: 0006084
10-11-08 23:49 carmelo73 Note Added: 0013314
10-11-08 23:49 carmelo73 Status assigned => feedback
10-12-08 00:55 pqa File Added: ld-uClibc.so.0.elf
10-12-08 00:56 pqa File Added: libc.so.0.elf
10-12-08 00:56 pqa File Added: libpthread.so.0.elf
10-12-08 00:56 pqa File Added: pqa-pfirst.elf
10-12-08 00:56 pqa File Added: pqa-plast.elf
10-12-08 00:58 pqa Note Added: 0013354
10-12-08 13:54 bernhardf Note Added: 0013384
======================================================================
More information about the uClibc-cvs
mailing list