John David Anglin <dave.ang...@nrc-cnrc.gc.ca> writes: >> 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.
Do you suggest that support for weak definitions (undefined weak) cannot be detected by a configure test 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. I was only talking about autoconfiguring the equivalent of SUPPORTS_WEAK && GTHREAD_USE_WEAK in the target libraries that need it. There will be no change in gcc/config, of course. > On PA HP-UX, the compiler "weak" support is implemented using COMDAT > and secondary definitions. Neither of these support undefined weak. The latter is also missing on Tru64 UNIX, so I'm working on such a platform myself and have introduced gthr-posix.c to deal with it. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University