[uClibc]Problem linking with libpthread

Jonathan Hankins jhankins at homewood.k12.al.us
Wed May 15 15:23:22 UTC 2002


Hi,

I am having a problem linking with the libpthread.so included with
uclibc.

My system is Debian GNU/Linux 3.0 (woody) on i386 architecture.

My uclibc debian package is version 0.9.11-cvs20020419-1.

When I link with libpthread, it is linking with the glibc libpthread in
/lib, instead of the uclibc libpthread in /usr/i386-linux-uclibc/lib.

However (as a test example,) when I link with libdl, the correct uclibc
libdl is linked, even though I also have a glibc libdl in /lib.

Below is an example.

If I temporarily rename the libpthread in /lib, I can then correctly
link against the uclibc libpthread.

I have experienced the same problem on a Debian 2.2 (potato) system, and
I have experienced the problem with multiple snapshot versions of
uclibc.  I have also built uclibc from source, installed under
/usr/local, and had the same problem.

Any idea why linking with libpthread behaves differently than the other
libraries included with uclibc?

Let me know if there is any more information I can provide.

Thanks,

-Jonathan Hankins

--

Script started on Wed May 15 10:01:58 2002

$ export PATH=/usr/i386-linux-uclibc/bin:$PATH

$ echo $PATH
/usr/i386-linux-uclibc/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games

$ gcc -Wall test.c -ldl

$ ldd ./a.out
	libdl.so.0 => /usr/i386-linux-uclibc/lib/libdl.so.0
	libc.so.0 => /usr/i386-linux-uclibc/lib/libc.so.0
	/lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0

$ gcc -Wall test.c -lpthread

$ ldd ./a.out
	libpthread.so.0 => /lib/libpthread.so.0
	libc.so.0 => /usr/i386-linux-uclibc/lib/libc.so.0
	/lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0
	libc.so.6 => /lib/libc.so.6
	ld-linux.so.2 => /lib/ld-linux.so.2

$ ls -l /usr/i386-linux-uclibc/lib/libdl* /usr/i386-linux-uclibc/lib/libpthread*
-rw-r--r--    1 root     root	      5320 Apr 19 12:40 /usr/i386-linux-uclibc/lib/libdl-0.9.11.so
lrwxrwxrwx    1 root	 root		15 May 15 09:41 /usr/i386-linux-uclibc/lib/libdl.so -> libdl-0.9.11.so
lrwxrwxrwx    1 root	 root		15 May 15 09:41 /usr/i386-linux-uclibc/lib/libdl.so.0 -> libdl-0.9.11.so
-rw-r--r--    1 root	 root	     68124 Apr 19 12:40 /usr/i386-linux-uclibc/lib/libpthread-0.9.11.so
-rw-r--r--    1 root	 root	     96058 Apr 19 12:40 /usr/i386-linux-uclibc/lib/libpthread.a
lrwxrwxrwx    1 root	 root		20 May 15 09:41 /usr/i386-linux-uclibc/lib/libpthread.so -> libpthread-0.9.11.so
lrwxrwxrwx    1 root	 root		20 May 15 09:41 /usr/i386-linux-uclibc/lib/libpthread.so.0 -> libpthread-0.9.11.so

$ exit
Script done on Wed May 15 10:03:36 2002

-- 
--------------------------------------------------------------------------
Jonathan Hankins	Homewood City Schools

jhankins at homewood.k12.al.us
--------------------------------------------------------------------------



More information about the uClibc mailing list