Re: Fixing -pthreads (Re: ports and -current)

From: Peter Wemm <peter_at_wemm.org>
Date: Wed, 24 Sep 2003 15:29:34 -0700
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_at_wemm.org; peter_at_FreeBSD.org; peter_at_yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
Received on Wed Sep 24 2003 - 13:29:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:23 UTC