fix post-weakref gthr-*.h on HP-UX (and others?)

John David Anglin dave@hiauly1.hia.nrc.ca
Sun Dec 4 21:26:00 GMT 2005


> Index: gcc/ChangeLog
> from  Alexandre Oliva  <aoliva@redhat.com>
> 
> 	PR other/24829
> 	PR target/24831
> 	* gthr-dce.h: Do not gthrw-ify pthread_once_init,
> 	pthread_key_delete.  From John David Anglin.  gthrw-ify
> 	pthread_getunique_np only if it it's not a macro.  
> 	* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
> 	gthr-posix95.h: Use macro-based approach for name redirection
> 	on targets missing weakref.

This patch fixed all the weakref related failures on hppa2.0w-hp-hpux11.11.
An earlier change to just gthr-dce.h along these lines fixed the failures
observed on hppa1.1-hp-hpux10.20.

It's not exactly correct to say hppa2.0w-hp-hpux11.11 is missing weakref.
This target passes all the binutils tests for weakrefs.  However, the
HP linker and dynamic loader don't allow undefined symbols, so weakrefs
aren't particularly useful.  They can also cause the linker to dump
core in some circumstances.  At the moment, I don't know how to turn
weakrefs support off.

I need to look at how SUPPORTS_WEAK on the 32-bit hppa*-*-hpux* target.
At the moment, a non-zero definition is conditional on HAVE_GAS_WEAK
being defined.  However, tconfig.h turns HAVE_GAS_WEAK off, so we
never support weak when tconfig.h is used.  I guess that's why
SUPPORTS_WEAK was used instead of HAVE_GAS_WEAKREF in the gthr*.h
files.  At the moment, I'm thinking SUPPORTS_WEAK should be set using
a code generation option.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)



More information about the Gcc-patches mailing list