-pthread and shared libraries

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <kernel@...>
Date: Tuesday, July 22, 2008 - 5:25 pm

While trying to find out why multimedia/gnash doesn't build in DragonFly I 
discovered the point why there is probably no problem in NetBSD. Note, 
that I don't say that this is the problem which must be fixed to get 
gnash to build etc, the problem itself is probably elsewhere.

The point is that using -pthread to link a shared library doesn't link it 
against libpthread.so, it just resolves symbols AFAICS. So far I thought 
that -pthread and -lpthread are equal in linking phase.

hasso@pos:~$ gcc -shared -o test.so test.c -pthread
hasso@pos:~$ ldd ./test.so
./test.so:
        libc.so.6 => /usr/lib/libc.so.6 (0x28070000)
hasso@pos:~$ gcc -shared -o test.so test.c -lpthread
hasso@pos:~$ ldd ./test.so
./test.so:
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x2812b000)
        libc.so.6 => /usr/lib/libc.so.6 (0x28070000)
hasso@pos:~$

What's the reason for that? Is it a historic and could be removed now to 
avoid confusion?


-- 
Hasso Tepper
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
-pthread and shared libraries, Hasso Tepper, (Tue Jul 22, 5:25 pm)
Re: -pthread and shared libraries, Joerg Sonnenberger, (Wed Jul 23, 6:05 am)
Re: -pthread and shared libraries, Hasso Tepper, (Wed Jul 23, 6:23 am)
Re: -pthread and shared libraries, Joerg Sonnenberger, (Wed Jul 23, 6:34 am)