From owner-freebsd-ports@FreeBSD.ORG Mon Apr 3 07:52:36 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org 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 C45C016A41F for ; Mon, 3 Apr 2006 07:52:36 +0000 (UTC) (envelope-from jbq@anyware-tech.com) Received: from caraldi.com (195-13-58-165.oxyd.net [195.13.58.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48D9643D46 for ; Mon, 3 Apr 2006 07:52:35 +0000 (GMT) (envelope-from jbq@anyware-tech.com) Received: from vision.anyware (10.21.96-84.rev.gaoland.net [84.96.21.10]) by caraldi.com (Postfix) with ESMTP id 3CDBD6114 for ; Mon, 3 Apr 2006 09:52:35 +0200 (CEST) Received: by vision.anyware (Postfix, from userid 1021) id 1FD0D6227; Mon, 3 Apr 2006 09:52:36 +0200 (CEST) Date: Mon, 3 Apr 2006 09:52:36 +0200 From: Jean-Baptiste Quenot To: freebsd-ports@freebsd.org Message-ID: <20060403075235.GB19483@vision.anyware> Mail-Followup-To: freebsd-ports@freebsd.org References: <20060331155131.GA78328@qlovarnika.bg.datamax> <20060402143328.GA27433@watt.intra.caraldi.com> <20060403064902.GA77780@qlovarnika.bg.datamax> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20060403064902.GA77780@qlovarnika.bg.datamax> User-Agent: mutt-ng/devel-r581 (FreeBSD) Subject: Re: Threading libraries X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2006 07:52:36 -0000 * Vasil Dimov: > On Sun, Apr 02, 2006 at 04:33:28PM +0200, Jean-Baptiste Quenot > wrote: > > > Instead of linking with "cc" instead of "ld", why not add a > > « FreeBSD SPECIFIC OPTION » called "-pthread" to "ld", like > > what has been done to "cc"? > > Because linking with cc is a fix that we have a patch for and > therefore can be committed right on the moment. > > As I see it you object against linking with cc instead of ld, > but you do not have any other solution (except from linking > *everything* with pthread). I'm not objecting to your patch, which is valuable ATM until we improve FreeBSD handling of pthread libraries. What I don't like is: 1) we are explicitly linking with cc, that is not a Resin-specific issue at all, please tell me if I'm wrong. The problem we have with Resin will arise for other ports too. Right or wrong? 2) the documentation *must* be improved because it does not state that ld does not support -pthread, see http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/book.html 12.16 Threading libraries The threading library must be linked to the binaries using a special linker flag -pthread on FreeBSD. If a port insists on linking -lpthread or -lc_r directly, patch it to use PTHREAD_LIBS variable provided by the ports framework. This variable usually has the value of -pthread, but on certain architectures and FreeBSD versions it can have different values, so do not just hardcode -pthread into patches and always use PTHREAD_LIBS. I can provide a patch for the documentation if you wish... -- Jean-Baptiste Quenot aka John Banana Qwerty http://caraldi.com/jbq/