From owner-freebsd-ports@FreeBSD.ORG Wed Feb 23 17:14:24 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 916CA16A4CE for ; Wed, 23 Feb 2005 17:14:24 +0000 (GMT) Received: from phoenix.buildlink.org (buildlink.org [69.20.59.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26FBF43D45 for ; Wed, 23 Feb 2005 17:14:22 +0000 (GMT) (envelope-from jlam@NetBSD.org) Received: from [10.0.1.22] (unknown [66.155.233.98]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phoenix.buildlink.org (Postfix) with ESMTP id CBCD940F188; Wed, 23 Feb 2005 17:14:20 +0000 (GMT) Message-ID: <421CBA04.2070002@NetBSD.org> Date: Wed, 23 Feb 2005 12:14:44 -0500 From: Johnny Lam User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Nottebrock References: <64348.207.219.213.162.1109011818.squirrel@207.219.213.162> <200502231749.22024.michaelnottebrock@gmx.net> In-Reply-To: <200502231749.22024.michaelnottebrock@gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-ports@FreeBSD.org Subject: Re: FreeBSD Port: ruby18-1.8.2_2 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2005 17:14:24 -0000 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