This is the mail archive of the gcc@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: -D_REENTRANT on Solaris


> > 
> > The Objective-C runtime library is broken because of this. It should
> > be fixed similar to the thread-safe exception support in libgcc.a.
> 
> I see, thanks for the pointer. Each platform uses a specific flag for enabling
> the thread-safe capabilities, -pthread on Linux, -pthreads on Solaris,
> -mthreads on AIX and -threads on HPUX.
> 
> Now, if egcs was configured with --enable-threads shouldn't we automatically
> pass the correct thread flag when we're building runtime libraries? It seems
> support for this is not yet in configure. Am I missing something?
> 

No. The Objective-C runtime library should be compiled in such a way
that

# gcc foo.m

will make it single-threaded and

# gcc foo.m -lthread_lib

will make it multi-threaded. That is what the thread-safe exception
does. On ELF, it uses the weak symbols.

-- 
H.J. Lu (hjl@gnu.org)


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