9330 – [alpha-osf]small alphaev56-dec-osf5.1 --enable-threads=posix problem (original) (raw)
alphaev56-dec-osf5.1 configured with --enable-threads=posix The /usr/include/pthreads.h file triggers an #error directive if _REENTRANT is not defined when you include it.
I suggest the attached patch, which #defines _REENTRANT in gthr_posix.h when osf is defined, just before including pthread.h
Release: unknown
Environment: alphaev56-dec-osf5.1 configured with --enable-threads=posix
How-To-Repeat: On a DEC Unix, er,Compaq Tru-64, er whatever they call it now, where cc -V reports: Compaq C V6.4-014 on Compaq Tru64 UNIX V5.1A (Rev. 1885) do:
configure --enable-threads=posix make bootstrap
You get an #error trip when including pthreads.h
Comment 1 mengel 2003-01-15 10:06:00 UTC
Fix: Apply attached patch to #define _REENTRANT
Comment 2 Dara Hazeghi 2003-05-26 05:36:10 UTC
Hello,
you don't mention which gcc version this is a problem under. Would it be possible for you to verify that this problems till occurs on gcc 3.3? It looks like it probably would, but it would be good to have confirmation. Thanks,
Dara
Comment 3 Drea Pinski 2003-05-26 14:04:57 UTC
See Dara's Question.
Comment 4 Dara Hazeghi 2003-06-16 20:23:56 UTC
Roger,
here's another tru64 problem I was hoping you might have some insight into. Does this bug look familiar? Thanks,
Dara
Comment 5 Dara Hazeghi 2003-06-20 17:48:20 UTC
should be in bootstrap category...
Comment 8 Rainer Orth 2003-07-31 12:11:38 UTC
Known/documented bug.
Comment 10 Karl Vogel 2003-08-25 15:54:12 UTC
On alphaev68-dec-osf5.1 -- Compaq Tru64 UNIX V5.1B (Rev. 2650)
This still fails with:
In file included from ../../gcc/gthr-posix.h:43, from ./gthr-default.h:1, from ../../gcc/gthr.h:96, from ../../gcc/gthr-posix.c:33: TMP/gcc-3.4-20030820/obj/gcc/include/pthread.h:299:3: #error <pthread.h>: unrecognized compiler. make[3]: *** [libgcc/./gthr-posix.o] Error 1 make[2]: *** [libgcc.a] Error 2 make[1]: *** [stage1_build] Error 2 make: *** [bootstrap-lean] Error 2
-- /usr/include/pthread.h :
#if defined (__DECCXX)
define _PTHREAD_ENV_CXX
define _PTHREAD_ENV_DECCXX
#elif defined (__cplusplus)
define _PTHREAD_ENV_CXX
#elif defined (__DECC) || defined (__decc)
define _PTHREAD_ENV_DECC
#elif defined (__INTEL_COMPILER)
define _PTHREAD_ENV_INTELC
#else
error <pthread.h>: unrecognized compiler.
#endif
Comment 11 Dara Hazeghi 2003-08-25 16:01:38 UTC
That is really broken. Maybe fixincludes is the correct solutions here?
Comment 12 Rainer Orth 2003-09-01 22:30:27 UTC
Subject: Re: [alpha-osf]small alphaev56-dec-osf5.1 --enable-threads=posix problem
On alphaev68-dec-osf5.1 -- Compaq Tru64 UNIX V5.1B (Rev. 2650)
This still fails with:
In file included from ../../gcc/gthr-posix.h:43, from ./gthr-default.h:1, from ../../gcc/gthr.h:96, from ../../gcc/gthr-posix.c:33: TMP/gcc-3.4-20030820/obj/gcc/include/pthread.h:299:3: #error <pthread.h>: unrecognized compiler. make[3]: *** [libgcc/./gthr-posix.o] Error 1 make[2]: *** [libgcc.a] Error 2 make[1]: *** [stage1_build] Error 2 make: *** [bootstrap-lean] Error 2
This is different from the bug originally reported. If so, it's best to open a new bug.
-- /usr/include/pthread.h :
#if defined (__DECCXX)
define _PTHREAD_ENV_CXX
define _PTHREAD_ENV_DECCXX
#elif defined (__cplusplus)
define _PTHREAD_ENV_CXX
#elif defined (__DECC) || defined (__decc)
define _PTHREAD_ENV_DECC
#elif defined (__INTEL_COMPILER)
define _PTHREAD_ENV_INTELC
#else
error <pthread.h>: unrecognized compiler.
#endif
Could you send me a copy of this file in private mail? I don't currently have V5.1B installed (although that may change in the future). Unfortunately, current mainline doesn't bootstrap on V5.1 since 20030919, so I'll have to track down that failure first.
RainerComment 13 Rainer Orth 2003-09-01 22:31:44 UTC
Subject: Re: [alpha-osf]small alphaev56-dec-osf5.1 --enable-threads=posix problem
That is really broken. Maybe fixincludes is the correct solutions here?
Almost certainly, yes. DEC/Compaq/HP makes this increasingly worse by testing for compilers in many places instead of using feature test macros.
RainerComment 14 Karl Vogel 2003-09-02 07:07:59 UTC
Using the resolution of this bug together with the following patch to the header file, makes it work on Tru64 V5.1B:
--- /usr/include/pthread.h 2003-08-26 09:14:10.000000000 +0200 +++ pthread.h 2003-08-26 09:13:22.000000000 +0200 @@ -287,8 +287,7 @@ #elif defined (__INTEL_COMPILER)
define _PTHREAD_ENV_INTELC
#else -# define _PTHREAD_ENV_INTELC -/* # error <pthread.h>: unrecognized compiler. */ +# error <pthread.h>: unrecognized compiler. #endif
#if defined (VMS) || defined (__VMS) || defined (__vms) || defined (vms)
Tested this on GCC V3.1.1 (alphaev68-dec-osf5.1)
Comment 15 Karl Vogel 2003-09-02 07:09:15 UTC
NOTE: I accidently did the diff in the wrong direction (change - to + and + to - and all should be ok).