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: Thu,  9 Feb 2023 19:54:34 +0000 (GMT)	[thread overview]
Message-ID: <20230209195434.98F603858024@sourceware.org> (raw)

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

commit 9d19d878329058e5e2602617ed8cf80d612c1611
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 93dbe69183..a000806f96 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 18f88a8762..9e53c4fc7a 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 cf311fdb3e..af25851cba 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:[~2023-02-09 19:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 19:54 Adhemerval Zanella [this message]
2023-08-30 12:42 Adhemerval Zanella
2023-09-28 17:52 Adhemerval Zanella
2023-12-21 18:54 Adhemerval Zanella
2024-01-29 17:58 Adhemerval Zanella
2024-02-07 14:08 Adhemerval Zanella
2024-02-09 17:32 Adhemerval Zanella
2024-04-02 15:54 Adhemerval Zanella
2024-04-17 20:08 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=20230209195434.98F603858024@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).