On 06/06/2012 03:09 PM, Dave Korn wrote:
I am not sure, but AFAICT, -pthread is Linux-specific.
No, it's the canonical multi-os option to enable pthreads, as
generic as it gets.
According to the manual(*), it's a machine-dependent option for RS6000 and
Solaris 2 only!
And there's a lot of confusion about whether you have to throw in
-D_REENTRANT as well (on GNU/Linux and on other systems).
I think on GNU/Linux, pthread detection mostly happens at run time these
days, and you ought to use the _r API variants (which are available
without -pthread) in library code. I even think you shouldn't link
against the library unless you actually create threads.
--
Florian Weimer / Red Hat Product Security Team