This is the mail archive of the
mailing list for the GCC project.
RE: Exception Handling is thread safe?
- To: "'Bastiaan Bakker'" <Bastiaan dot Bakker at Harbinger dot nl>, "egcs at cygnus dot com" <egcs at cygnus dot com>
- Subject: RE: Exception Handling is thread safe?
- From: Kaz Kylheku <kaz at cafe dot net>
- Date: Mon, 23 Mar 1998 09:43:10 -0800
On Thursday, March 19, 1998 2:13 AM, Bastiaan Bakker
> Hi ,
> On the OmniORB project pages I read that egcs' exception handling is
> not thread safe but that it can be fixed with a patch from Teemu Torma.
Thread safe exception handling is available in the March 8th snapshot,
which is what I am using right now. Presumably, it has been incorporated
into the 1.0.2 release; I have not yet checked.
In the March 8th (980308) snapshot, you have to manually enable thread-safe
exception handling by editing the 'gthr.h' header file in the 'gcc'
At the top, add
#define _PTHREADS = 1
if you are using POSIX threads. Otherwise #define _DCE_THREADS
or _SOLARIS_THREADS in the same way.
Then remove the 'libgcc2.a' file, and do a make install. Watch for
libgcc.a being built; if it doesn't happen, remove libgcc2.a and try
Once you have everything successfully built and installed, your
libgcc.a now contains undefined symbols referring to the appropriate
threading library, thus you may have to add the appropriate link options
on the compiler command line to compile C++ code that does
exception handling. (On my system, the pthreads API is in
a separate library; I'm using LinuxThreads in conjunction with
This advice may work for 1.0.2; I don't know yet.
Watch out; I tried to ``cheat'' by doing only a ``make libgcc.a''
in the gcc directory and copying the libgcc.a file manually to
its destination. It did not work for some reason that I don't fully
understand. Only a ``make install'' did the right magic.