This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Option -pthread in test suite with cross compilers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]