This is the mail archive of the gcc-help@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]

Re: Is there an equivalent to the Sun Compiler's -mt option


>      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


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