Fixing -pthreads (Re: ports and -current)
Peter Wemm
peter at wemm.org
Wed Sep 24 15:29:37 PDT 2003
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
More information about the freebsd-current
mailing list