This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [build] Move gthr to toplevel libgcc
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: John David Anglin <dave dot anglin at nrc-cnrc dot gc dot ca>
- Cc: <gcc-patches at gcc dot gnu dot org>, Paolo Bonzini <bonzini at gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Ian Lance Taylor <iant at google dot com>, Nathan Sidwell <nathan at codesourcery dot com>, Joel Sherrill <joel at oarcorp dot com>, Kai Tietz <ktietz at redhat dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, David Edelsohn <dje dot gcc at gmail dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Nicola Pero <nicola dot pero at meta-innovation dot com>, <fortran at gcc dot gnu dot org>, <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 08 Aug 2011 18:29:36 +0200
- Subject: Re: [build] Move gthr to toplevel libgcc
- References: <yddr54wrp4q.fsf@manam.CeBiTec.Uni-Bielefeld.DE> <BLU0-SMTP97C5A5D7528A0366AFD69497210@phx.gbl>
John David Anglin <dave.anglin@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