public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/clang] arm: Fix clang multi-arch build with ld.bfd
Date: Mon, 29 Jan 2024 17:58:13 +0000 (GMT)	[thread overview]
Message-ID: <20240129175813.E0316385828E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b9bf5cf3963fd6af14516246542f62135c5b7935

commit b9bf5cf3963fd6af14516246542f62135c5b7935
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Dec 9 15:22:53 2022 -0300

    arm: Fix clang multi-arch build with ld.bfd
    
    clang binds autogenerated memcpy/memset/memchr calls to the hidden
    internal symbols, different than gcc that binds without hidden
    attribute.  And this triggers an linker issue with bfd:
    
      ld: BFD (GNU Binutils for Ubuntu) 2.38 assertion fail
      ../../bfd/elf32-arm.c:4286
    
    Similar to other architectures, bind internal memcpy and memcpy
    symbols to the generic interface instead.

Diff:
---
 sysdeps/arm/arm-ifunc.h                     | 9 ---------
 sysdeps/arm/armv7/multiarch/memchr.c        | 2 --
 sysdeps/arm/armv7/multiarch/memchr_noneon.S | 4 ++++
 sysdeps/arm/armv7/multiarch/memcpy.c        | 2 --
 sysdeps/arm/armv7/multiarch/memcpy_arm.S    | 4 ++++
 5 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/sysdeps/arm/arm-ifunc.h b/sysdeps/arm/arm-ifunc.h
index c1aa43a9ea..fa4322bebb 100644
--- a/sysdeps/arm/arm-ifunc.h
+++ b/sysdeps/arm/arm-ifunc.h
@@ -23,12 +23,3 @@
 
 #define arm_libc_ifunc_redirected(redirected_name, name, expr)	\
   __ifunc (redirected_name, name, expr(hwcap), int hwcap, INIT_ARCH)
-
-#if defined SHARED
-# define arm_libc_ifunc_hidden_def(redirect_name, name) \
-  __hidden_ver1 (name, __GI_##name, redirect_name) \
-    __attribute__ ((visibility ("hidden"))) \
-    __attribute_copy__ (name)
-#else
-# define arm_libc_ifunc_hidden_def(redirect_name, name)
-#endif
diff --git a/sysdeps/arm/armv7/multiarch/memchr.c b/sysdeps/arm/armv7/multiarch/memchr.c
index cd5d53bc03..17e710b413 100644
--- a/sysdeps/arm/armv7/multiarch/memchr.c
+++ b/sysdeps/arm/armv7/multiarch/memchr.c
@@ -30,6 +30,4 @@
 # include "ifunc-memchr.h"
 
 arm_libc_ifunc_redirected (__redirect_memchr, memchr, IFUNC_SELECTOR);
-
-arm_libc_ifunc_hidden_def (__redirect_memchr, memchr);
 #endif
diff --git a/sysdeps/arm/armv7/multiarch/memchr_noneon.S b/sysdeps/arm/armv7/multiarch/memchr_noneon.S
index b1fb54018d..982b9f2789 100644
--- a/sysdeps/arm/armv7/multiarch/memchr_noneon.S
+++ b/sysdeps/arm/armv7/multiarch/memchr_noneon.S
@@ -3,3 +3,7 @@
 #define libc_hidden_builtin_def(name)
 
 #include <sysdeps/arm/armv6t2/memchr.S>
+
+#if IS_IN (libc) && !defined (__ARM_NEON__)
+strong_alias (__memchr_noneon, __GI_memchr)
+#endif
diff --git a/sysdeps/arm/armv7/multiarch/memcpy.c b/sysdeps/arm/armv7/multiarch/memcpy.c
index 86f30522aa..50d1ca8cd4 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy.c
+++ b/sysdeps/arm/armv7/multiarch/memcpy.c
@@ -30,6 +30,4 @@
 # include "ifunc-memcpy.h"
 
 arm_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR);
-
-arm_libc_ifunc_hidden_def (__redirect_memcpy, memcpy);
 #endif
diff --git a/sysdeps/arm/armv7/multiarch/memcpy_arm.S b/sysdeps/arm/armv7/multiarch/memcpy_arm.S
index e4a9a68c42..d71493fdb3 100644
--- a/sysdeps/arm/armv7/multiarch/memcpy_arm.S
+++ b/sysdeps/arm/armv7/multiarch/memcpy_arm.S
@@ -8,3 +8,7 @@
 strong_alias (__memcpy_arm, __aeabi_memcpy)
 strong_alias (__memcpy_arm, __aeabi_memcpy4)
 strong_alias (__memcpy_arm, __aeabi_memcpy8)
+
+#if IS_IN (libc) && !defined (__ARM_NEON__)
+strong_alias (__memcpy_arm, __GI_memcpy)
+#endif

             reply	other threads:[~2024-01-29 17:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 17:58 Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:08 Adhemerval Zanella
2024-04-02 15:54 Adhemerval Zanella
2024-02-09 17:32 Adhemerval Zanella
2024-02-07 14:08 Adhemerval Zanella
2023-12-21 18:54 Adhemerval Zanella
2023-09-28 17:52 Adhemerval Zanella
2023-08-30 12:42 Adhemerval Zanella
2023-02-09 19:54 Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240129175813.E0316385828E@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).