This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: What does the -pthread do?
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Claudius Link <Claudius dot Link at mathematik dot uni-freiburg dot de>
- Cc: help-gcc at gnu dot org
- Date: Mon, 01 Apr 2002 01:01:16 -0500
- Subject: Re: What does the -pthread do?
- References: <20020329115229.GA2569@zaphod.link-priv.de>
-pthread compiles and links a program using Posix threads.
GNU/Linux uses the -pthread option. Solaris' native compiler uses the
-pthreads option, so GCC uses that option as well.
-mthreads for AIX was inherited from Lynx OS. Because most GCC
configurations use -pthread, GNU/Linux uses -pthread and -pthread makes
the type of thread library more obvious, with GCC 3.0 AIX changed to use
-pthread.
The -pthread commandline option changes the behavior of system
header files, links the application with GCC libraries builts for Posix
threads, and links with Posix thread support in system libraries.
David