From 9c4b457e1b47369a40afd5e5e220f5d657667c0a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 13 Nov 2018 01:53:53 +0000 Subject: Add hidden_tls_def macros, fix powerpc-soft build with GCC 9. Soft-float powerpc fails to build with current GCC mainline because of use of libc_hidden_data_def for TLS variables, resulting in a non-TLS alias being defined, to which the tls_model attribute is now copied, resulting in a warning about it being ignored. The problem here appears to be the non-TLS alias. This patch adds a hidden_tls_def macro family, corresponding to the hidden_tls_proto macros, to define TLS aliases properly in such a case, and uses it for those powerpc soft-float variables. Tested with build-many-glibcs.py compilers build for powerpc-linux-gnu soft-float. Also tested for x86_64. * include/libc-symbols.h [SHARED && !NO_HIDDEN && !__ASSEMBLER__] (__hidden_ver2): New macro. Use old definition of __hidden_ver1 with additional parameter thread. [SHARED && !NO_HIDDEN && !__ASSEMBLER__] (__hidden_ver1): Define in terms of __hidden_ver2. (hidden_tls_def): New macro. (libc_hidden_tls_def): Likewise. (rtld_hidden_tls_def): Likewise. (libm_hidden_tls_def): Likewise. (libmvec_hidden_tls_def): Likewise. (libresolv_hidden_tls_def): Likewise. (librt_hidden_tls_def): Likewise. (libdl_hidden_tls_def): Likewise. (libnss_files_hidden_tls_def): Likewise. (libnsl_hidden_tls_def): Likewise. (libnss_nisplus_hidden_tls_def): Likewise. (libutil_hidden_tls_def): Likewise. (libutil_hidden_tls_def): Likweise. * sysdeps/powerpc/nofpu/sim-full.c (__sim_exceptions_thread): Use libc_hidden_tls_def. (__sim_disabled_exceptions_thread): Likewise. (__sim_round_mode_thread): Likewise. --- sysdeps/powerpc/nofpu/sim-full.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps/powerpc') diff --git a/sysdeps/powerpc/nofpu/sim-full.c b/sysdeps/powerpc/nofpu/sim-full.c index 223bf488f2..f18ebad064 100644 --- a/sysdeps/powerpc/nofpu/sim-full.c +++ b/sysdeps/powerpc/nofpu/sim-full.c @@ -23,14 +23,14 @@ /* Thread-local to store sticky exceptions. */ __thread int __sim_exceptions_thread __attribute__ ((nocommon)); -libc_hidden_data_def (__sim_exceptions_thread); +libc_hidden_tls_def (__sim_exceptions_thread); /* By default, no exceptions should trap. */ __thread int __sim_disabled_exceptions_thread = 0xffffffff; -libc_hidden_data_def (__sim_disabled_exceptions_thread); +libc_hidden_tls_def (__sim_disabled_exceptions_thread); __thread int __sim_round_mode_thread __attribute__ ((nocommon)); -libc_hidden_data_def (__sim_round_mode_thread); +libc_hidden_tls_def (__sim_round_mode_thread); #if SIM_GLOBAL_COMPAT int __sim_exceptions_global __attribute__ ((nocommon)); -- cgit 1.4.1