This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Thread support for HPUX 11 (pa, ia64)
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: John David Anglin <dave at hiauly3 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org, law at redhat dot com
- Date: Fri, 22 Aug 2003 22:01:35 -0700
- Subject: Re: Thread support for HPUX 11 (pa, ia64)
- References: <200308222243.SAA00285@hiauly3.hia.nrc.ca>
John David Anglin <dave@hiauly3.hia.nrc.ca> writes:
> [3.3]
> gcc:
> * config.gcc (hppa*-*-hpux11*, ia64*-*-hpux*): Remove
> commented-out logic to use DCE threads (if present), add
> support for POSIX threads.
> * config/ia64/hpux.h: Define CPP_SPEC to set appropriate
> #defines for -pthread. Add -lpthread to LIB_SPEC when
> -pthread. In both cases take -mt as a synonym for -pthread
> for acc compatibility.
> Define GTHREAD_USE_WEAK to 0.
> * config/pa/pa-hpux11.h: Likewise for CPP_SPEC and LIB_SPEC.
> Remove old logic for DCE threads from LIB_SPEC.
> * config/pa/pa64-hpux.h: Define GTHREAD_USE_WEAK to 0.
> libstdc++-v3:
> * config/os/hpux/os_defines.h: Unconditionally define
> _GLIBCPP_GTHREAD_USE_WEAK to 0.
>
> This looks good. The only issue that I see is the define for _HPUX_SOURCE
> in CPP_SPEC. This conflicts to some extent with the handling of this
> define in TARGET_OS_CPP_BUILTINS(). In particular, I don't think it
> should be defined in ansi mode under C.
If I don't define it in ansi mode under C, you cannot include
<pthread.h> in any file compiled under -ansi -pthread. This is
a bug in the HPUX system headers, but unconditionally defining
_HPUX_SOURCE when -pthread is given seems to me the simplest
fix.
(If you're curious, the bug is that sigset_t is not declared, but
pthread.h tries to use it anyway.)
zw