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

bugs at busybox.net bugs at busybox.net
Sun Oct 12 06:49:55 UTC 2008


The following issue requires your FEEDBACK. 
====================================================================== 
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-11-2008 23: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: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. 

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




More information about the uClibc-cvs mailing list