Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2005 12:14:44 -0500
From:      Johnny Lam <jlam@NetBSD.org>
To:        Michael Nottebrock <michaelnottebrock@gmx.net>
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: FreeBSD Port: ruby18-1.8.2_2
Message-ID:  <421CBA04.2070002@NetBSD.org>
In-Reply-To: <200502231749.22024.michaelnottebrock@gmx.net>
References:  <64348.207.219.213.162.1109011818.squirrel@207.219.213.162> <p0621021cbe41c5901398@[128.113.24.47]> <opsmm1cjkz9aq2h7@mezz.mezzweb.com> <200502231749.22024.michaelnottebrock@gmx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@NetBSD.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?421CBA04.2070002>