FreeBSD Port: ruby18-1.8.2_2

Johnny Lam jlam at NetBSD.org
Wed Feb 23 09:14:24 PST 2005


Michael Nottebrock wrote:
> On Wednesday, 23. February 2005 07:51, Jeremy Messenger wrote:
> 
>>I had a chat with marcus and he said that he knows that sparc64 is using
>>libc_r, so I believe that my lastest ruby18.diff should solve your problem
>>by remove '-lc'.. libc and libc_r can't be coexist; it's same as with
>>FreeBSD 4.x stuff.
> 
> 
> Actually it's not - on 5.x after osreldate 500016, -lc_r is complementary to 
> -lc, not a replacement, so you'll need to link to both.

Is there some summary of how to invoke the compiler or linker to link 
applications or libraries that use pthreads on each release of FreeBSD? 
   I've stumbled this a lot as I've tried building software outside of 
the ports collection for FreeBSD 4.x and FreeBSD 5.x.  As I understand 
it, FreeBSD 4.x does it one way, and FreeBSD 5.x does it two different 
ways, and FreeBSD 6.x does it one way, which are all some combination of 
just using "gcc -pthread", or "gcc ... -lc_r", or "gcc ... -lc 
-lpthread", etc.  What do I need to do in the following cases for each 
release of FreeBSD?

(1) Linking an executable that uses pthreads.
(2) Linking a shared library that uses pthreads.
(3) Linking an executable that uses a shared library, and the shared
     library encapsulates the use of pthreads.

Thanks!

	Cheers,

	-- Johnny Lam <jlam at NetBSD.org>


More information about the freebsd-ports mailing list