From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: matsu@intimesw.com Cc: help-gcc@gnu.org Subject: Re: Is there an equivalent to the Sun Compiler's -mt option Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <200003160020.BAA01287@loewis.home.cs.tu-berlin.de> References: <38D02472.234557AA@intimesw.com> X-SW-Source: 2000-q1/msg00385.html Message-ID: <20000401000000.7392vJpKdUuNSs7j6ECIEftiSoam_hkSmvFfnKmkdnY@z> > 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