From Bugzilla Helper: User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.2 (like Gecko) Description of problem: I use libtool to generate a C++ library which links against pthread. However the resulting library is missing symbols from the pthread library. Version-Release number of selected component (if applicable): libtool-1.5.20-5 How reproducible: Always Steps to Reproduce: [nomis80@localhost test]$ cat testcase.cpp #include <pthread.h> void f() { pthread_create(0,0,0,0); } [nomis80@localhost test]$ libtool --mode=compile g++ -pthread -c testcase.cpp mkdir .libs g++ -pthread -c testcase.cpp -fPIC -DPIC -o .libs/testcase.o g++ -pthread -c testcase.cpp -o testcase.o >/dev/null 2>&1 [nomis80@localhost test]$ libtool --mode=link g++ -pthread -rpath /usr/local/lib testcase.lo -o libtestcase.la g++ -shared -nostdlib /usr/lib/gcc/i386-redhat-linux/4.1.0/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.0/crtbeginS.o .libs/testcase.o -L/usr/lib/gcc/i386-redhat-linux/4.1.0 -L/usr/lib/gcc/i386-redhat-linux/4.1.0/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i386-redhat-linux/4.1.0/crtendS.o /usr/lib/gcc/i386-redhat-linux/4.1.0/../../../crtn.o -pthread -Wl,-soname -Wl,libtestcase.so.0 -o .libs/libtestcase.so.0.0.0 (cd .libs && rm -f libtestcase.so.0 && ln -s libtestcase.so.0.0.0 libtestcase.so.0) (cd .libs && rm -f libtestcase.so && ln -s libtestcase.so.0.0.0 libtestcase.so) ar cru .libs/libtestcase.a testcase.o ranlib .libs/libtestcase.a creating libtestcase.la (cd .libs && rm -f libtestcase.la && ln -s ../libtestcase.la libtestcase.la) [nomis80@localhost test]$ ldd -r .libs/libtestcase.so undefined symbol: pthread_create (.libs/libtestcase.so) linux-gate.so.1 => (0x00a0c000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00111000) libm.so.6 => /lib/libm.so.6 (0x00b02000) libc.so.6 => /lib/libc.so.6 (0x0033e000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00e6c000) /lib/ld-linux.so.2 (0x00531000) Actual Results: The pthread_create symbol is missing! Expected Results: The resulting library should be linked against libpthread. Additional info: This bug is also present on FC4 and RHEL4. Note that using gcc instead of g++ doesn't trigger the bug because libtool only uses the weird -nostdlib linking command line with g++.
These bugs are being closed since a large number of updates have been released after the FC5 test1 and test2 releases. Kindly update your system by running yum update as root user or try out the third and final test version of FC5 being released in a short while and verify if the bugs are still present on the system .Reopen or file new bug reports as appropriate after confirming the presence of this issue. Thanks
please append your testcase to this bugreport
I've missed that one here: libtool --mode=link g++ -pthread -rpath /usr/local/lib testcase.lo -o libtestcase.la should have been: libtool --mode=link g++ -lpthread -pthread -rpath /usr/local/lib testcase.lo -o libtestcase.la which makes it 'NOTABUG'