On 8-Aug-11, at 9:47 AM, Rainer Orth wrote:
** _DCE_THREADS is used to select gthr-dce.h, but again dce is the
only/default model on hppa[12]*-*-hpux10* (pa-hpux10.h), so the
special-casing can be removed.
DCE threads and thread single are both supported. There are multilibs
for both. Different libraries are needed for threaded and non
threaded programs,
and there is no mechanism to detect whether threads are active or not.
I haven't moved two macros used in gthr*.h yet: GTHREAD_USE_WEAK and
SUPPORTS_WEAK. This seems to warrant a separate followup patch, but
for
the record I report my findings:
* GTHREAD_USE_WEAK must be defined explicitly. It needs to be
poisoned
in system.h after the move. Right now, only a few targets defined a
non-default value:
darwin.h #define GTHREAD_USE_WEAK 0
i386/cygwin.h #define GTHREAD_USE_WEAK 0
ia64/hpux.h #define GTHREAD_USE_WEAK 0
pa/pa64-hpux.h #define GTHREAD_USE_WEAK 0
pa/som.h #define GTHREAD_USE_WEAK 0
The last 3 could be handled in a new hpux-lib.h, but perhaps this
isn't necessary if ax_sys_weak_alias.m4 works.
I'm not sure this is possible in general on HP-UX.
* SUPPORTS_WEAK is probably best detected with autoconf. We have
libgfortran/acinclude.m4 (LIBGFOR_GTHREAD_WEAK), but should probably
go for m4/ax_sys_weak_alias.m4 from the autoconf-archive instead. If
we're lucky, that macro can detect support for weak definitions and
replace both SUPPORTS_WEAK and GTHREAD_USE_WEAK.
There are multiple meanings for SUPPORTS_WEAK. Within the compiler,
SUPPORTS_WEAK implies that multiple definitions of code and data symbols
are possible. At the moment, there is no need for undefined weak or
weak
aliases. The situation is different in the gthr* headers and compiled
code
such as libgfortran.
On PA HP-UX, the compiler "weak" support is implemented using COMDAT
and secondary definitions. Neither of these support undefined weak.
Dave