Fix sparc64 build with GCC 9.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 13 Nov 2018 00:27:06 +0000 (00:27 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 13 Nov 2018 00:27:06 +0000 (00:27 +0000)
Similar to the x86_64 and armv7 build issues, glibc fails to build for
sparc64 with current mainline GCC because of aliases declared in the
course of defining IFUNCs, which copy their attributes from a header
declaration, ending up with fewer attributes than the (built-in)
string function they alias.  This patch fixes the issue similarly to
the fixes for those other architectures.

Tested with build-many-glibcs.py compilers build for
sparc64-linux-gnu.

* sysdeps/sparc/sparc-ifunc.h [SHARED]
(sparc_ifunc_redirected_hidden_def): Use __attribute_copy__ to
copy attributes from name.

ChangeLog
sysdeps/sparc/sparc-ifunc.h

index 6372ec7..8b82d3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-13  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/sparc/sparc-ifunc.h [SHARED]
+       (sparc_ifunc_redirected_hidden_def): Use __attribute_copy__ to
+       copy attributes from name.
+
 2018-11-12  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/arm/arm-ifunc.h [SHARED] (arm_libc_ifunc_hidden_def):
index 561aeea..10552e9 100644 (file)
@@ -35,7 +35,8 @@
 #if defined SHARED
 # define sparc_ifunc_redirected_hidden_def(redirect_name, name) \
   __hidden_ver1 (name, __GI_##name, redirect_name) \
-    __attribute__ ((visibility ("hidden")));
+    __attribute__ ((visibility ("hidden"))) \
+    __attribute_copy__ (name);
 #else
 # define sparc_ifunc_redirected_hidden_def(redirect_name, name)
 #endif