about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2024-01-30 09:34:32 +0100
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-01-30 22:28:51 +0100
commitcc1b91eabd806057aa7e3058a84bf129ed36e157 (patch)
tree6efb17c6923f9466ed29323f418b67ebcd879099
parentfeeb7297549f89d1654b76ccdb6f5fd544c1ef11 (diff)
downloadglibc-cc1b91eabd806057aa7e3058a84bf129ed36e157.tar.gz
glibc-cc1b91eabd806057aa7e3058a84bf129ed36e157.tar.xz
glibc-cc1b91eabd806057aa7e3058a84bf129ed36e157.zip
S390: Fix building with --disable-mutli-arch [BZ #31196]
Starting with commits
- 7ea510127e2067efa07865158ac92c330c379950
string: Add libc_hidden_proto for strchrnul
- 22999b2f0fb62eed1af4095d062bd1272d6afeb1
string: Add libc_hidden_proto for memrchr

building glibc on s390x with --disable-multi-arch fails if only
the C-variant of strchrnul / memrchr is used.  This is the case
if gcc uses -march < z13.

The build fails with:
../sysdeps/s390/strchrnul-c.c:28:49: error: ‘__strchrnul_c’ undeclared here (not in a function); did you mean ‘__strchrnul’?
   28 | __hidden_ver1 (__strchrnul_c, __GI___strchrnul, __strchrnul_c);

With --disable-multi-arch, __strchrnul_c is not available as string/strchrnul.c
is just included without defining STRCHRNUL and thus we also don't have to create
the internal hidden symbol.

Tested-by: Andreas K. Hüttel <dilfridge@gentoo.org>
-rw-r--r--sysdeps/s390/memrchr-c.c4
-rw-r--r--sysdeps/s390/strchrnul-c.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/s390/memrchr-c.c b/sysdeps/s390/memrchr-c.c
index b4b85725d3..f6ffe85572 100644
--- a/sysdeps/s390/memrchr-c.c
+++ b/sysdeps/s390/memrchr-c.c
@@ -25,7 +25,9 @@
 
 # include <string/memrchr.c>
 
-# if defined SHARED && IS_IN (libc)
+# if HAVE_MEMRCHR_IFUNC
+#  if defined SHARED && IS_IN (libc)
 __hidden_ver1 (__memrchr_c, __GI___memrchr, __memrchr_c);
+#  endif
 # endif
 #endif
diff --git a/sysdeps/s390/strchrnul-c.c b/sysdeps/s390/strchrnul-c.c
index 7f2f1fd540..97fd9ffbf7 100644
--- a/sysdeps/s390/strchrnul-c.c
+++ b/sysdeps/s390/strchrnul-c.c
@@ -24,7 +24,9 @@
 # endif
 
 # include <string/strchrnul.c>
-# if defined SHARED && IS_IN (libc)
+# if HAVE_STRCHRNUL_IFUNC
+#  if defined SHARED && IS_IN (libc)
 __hidden_ver1 (__strchrnul_c, __GI___strchrnul, __strchrnul_c);
+#  endif
 # endif
 #endif