Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Sep 2003 15:29:34 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        Freebsd Current <current@freebsd.org>
Subject:   Re: Fixing -pthreads (Re: ports and -current) 
Message-ID:  <20030924222934.6C9362A7EA@canning.wemm.org>
In-Reply-To: <Pine.NEB.3.96L.1030924091657.60986D-100000@fledge.watson.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote:

> Based on the results seen thus far, my preference would really be for:
> 
> (1) Keep -pthread, make it imply -lpthread, saving a lot of hassle.

Regarding the switch, the gcc folks have been adding -pthread as the
'standard' way to enable pthreads across the board for all platforms.
On some systems it also implies -D_REENTRANT and other flags as well.

-pthread cannot go away.  We'd just be hurting ourselves for no good reason,
especially when the rest of the world is syncing up with us.

Samples from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog:

....
        * config/linux.h (LIB_SPEC): If -pthread, add -lpthread even if
        -shared.
        * config/alpha/linux-elf.h (LIB_SPEC): Likewise.
....
        * config/ia64/hpux.h: Define CPP_SPEC to set appropriate
        #defines for -pthread.  Add -lpthread to LIB_SPEC when
        -pthread.  In both cases take -mt as a synonym for -pthread
        for acc compatibility.
... 
	* config/netbsd.h: Update copyright years.
	(NETBSD_CPP_SPEC): Define _REENTRANT and _PTHREADS if
	-pthread is specified on the command line.
...


Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



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