This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: PATCH: Re: eh_globals.cc compilation errors with -threads under hpux 10.20


> But, I'm not sure I read it this way.  I could be convinced that you
> are right.  Who says that _PTHREADS is a compiler define?  I have the
> _Programming with POSIX Threads_ book on my shelf (but I don't have
> the official POSIX standard in this area) and it makes no mention of
> _PTHREADS.  Given the name appears to be in library implementor space,
> it seems that we in libstdc++ and/or in conjunction with the system
> libraries own it not the compiler unless we set a gcc convention that
> does not currently exist.  Here is my proof that it is not currently a
> gcc convention to define that symbol "in the compiler":

I also have been doing a little digging trying to find out if _PTHREADS
is used by pthreads and have been unable to find any use of this symbol.
It seems that it was introduced within gcc to control the loading of
the correct thread file by gthr.h.

> ; grep PTHREADS `{find . -type f}
> ./i386/sol2.h:  %{pthreads:-D_REENTRANT -D_PTHREADS} \
> ./sh/linux.h:   %{pthread:-D_REENTRANT -D_PTHREADS}"
> ./sparc/sol2.h:%{pthreads:-D_REENTRANT -D_PTHREADS} \

I don't have access to any of these so I can't confirm if these systems
actually need _PTHREADS for anything other than gthr.h.

_REENTRANT is used to get reentrant errno.h defines.

eh_globals.cc and eh_alloc.cc include gthr.h.  For gthr.h to include
the correct thread definitions, the following have to be correctly defined
or not defined as the case may be:

_PTHREADS
_DCE_THREADS
_SOLARIS_THREADS
HAVE_GTHR_DEFAULT
SUPPORTS_WEAK
GTHREAD_USE_WEAK

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


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