This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Is there an equivalent to the Sun Compiler's -mt option
- To: matsu at intimesw dot com
- Subject: Re: Is there an equivalent to the Sun Compiler's -mt option
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Thu, 16 Mar 2000 01:20:22 +0100
- CC: help-gcc at gnu dot org
- References: <38D02472.234557AA@intimesw.com>
> We are trying to run the C++ compiled with gcc and Java, and C++
> compiled with Sun Solaris and Java. We need to set the -mt flag
> (compile and link for multithreaded code) for the Sun compiler, but
> don't know the equivalent flag to set for gcc. Would you please let
> me know if there is an equivalent flag and what it is?
For the compiler itself, you don't need a flag. It will work just fine
- single-threaded or not. For the system libraries, you can use the
-pthreads option. This will add -D_REENTRANT -D_PTHREADS to the
preprocessor predefines, and adds -lpthread to the linker command
line.
Please note that you should have specified --enable-threads when you
built the compiler, to get thread-safe exception handling.
Regards,
Martin