[uClibc 0002414]: Order of linking libraries can causes application not to run

bugs at busybox.net bugs at busybox.net
Wed Mar 26 21:49:07 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:                     assigned
====================================================================== 
Date Submitted:             03-03-2008 14:52 PST
Last Modified:              03-26-2008 14:49 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:49  
---------------------------------------------------------------------- 
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)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
/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)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
$ 

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                          
======================================================================




More information about the uClibc-cvs mailing list