This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Only define _REENTRANT in gthr-posix.h for Tru64
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 20 Jul 2006 21:00:16 +0200
- Subject: Re: [PATCH] Only define _REENTRANT in gthr-posix.h for Tru64
- References: <Pine.LNX.4.44.0607160815440.30123-100000@www.eyesopen.com>
Roger Sayle <roger@eyesopen.com> writes:
> Ok for mainline? Although this looks obvious, the possibility of
> temporary breakage on other platforms (HPUX?), means I'd prefer a
> second opinion for code outside my maintainership.
This is PR libstdc++/11953, which Gaby incorrectly closed as fixed when
Jakub applied a local patch to the RedHat GCC 4.1 branch.
> 2006-07-16 Roger Sayle <roger@eyesopen.com>
>
> * gthr-posix.h (_REENTRANT): Only force to be defined on Tru64.
The beast is called Tru64 UNIX :-) Please add the PR number, too.
> Index: gthr-posix.h
> ===================================================================
> --- gthr-posix.h (revision 115282)
> +++ gthr-posix.h (working copy)
> @@ -36,9 +36,11 @@
> #define __GTHREADS 1
>
> /* Some implementations of <pthread.h> require this to be defined. */
> +#ifdef __osf__
> #ifndef _REENTRANT
> #define _REENTRANT 1
> #endif
> +#endif
You should add a comment explaining what's going on here.
Doing it this way is certainly an option, although ugly. I had a patch
(back in 2004, never submitted ;-) that handled the problem by using
-pthread in t-osf-pthread and adding special code in libobjc/thr-objc.c and
libstdc++-v3/{configure.host, config/os/osf}. Doing it this way at least
has the advantage of having the necessary code in one place.
Btw., could someone have a look at
http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00533.html
which fixes a pthread-related regression on the 4.1 branch and mainline,
fixes hundreds of testcases and speeds up Tru64 UNIX testing by a factor of
two or three ;-)
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University