Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Apr 2006 09:52:36 +0200
From:      Jean-Baptiste Quenot <jbq@caraldi.com>
To:        freebsd-ports@freebsd.org
Subject:   Re: Threading libraries
Message-ID:  <20060403075235.GB19483@vision.anyware>
In-Reply-To: <20060403064902.GA77780@qlovarnika.bg.datamax>
References:  <20060331155131.GA78328@qlovarnika.bg.datamax> <20060402143328.GA27433@watt.intra.caraldi.com> <20060403064902.GA77780@qlovarnika.bg.datamax>

next in thread | previous in thread | raw e-mail | index | archive | help
* 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/



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