From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id A8E6F3858292; Thu, 21 Dec 2023 18:54:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8E6F3858292 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703184886; bh=6CDIBRql3s0D0/eZITJ3hE1wvWaSpY6otcOqPceQqQ8=; h=From:To:Subject:Date:From; b=UlKm5SQtalS3rL30zIJrrTw+C2xOI31vLLCpw2WaSjtrm+5vqObuc9pTlUY0COFL4 xDgpZ821z4qvteJHgHDp8B8rU1ESjPWVbykLjeAZIduFbjYCXOfUuOTy1B6U4z0QR1 OJen9dkw+cyZ0JUn1PodcQIQsamH4CIYYNOHuXuM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] arm: Fix clang multi-arch build with ld.bfd X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 878b6d18e7e53c61cf18134741df12442fd34bae X-Git-Newrev: 5c1a0ad5adb75c0b6c24afdc2a9ce715db20bb4a Message-Id: <20231221185446.A8E6F3858292@sourceware.org> Date: Thu, 21 Dec 2023 18:54:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5c1a0ad5adb75c0b6c24afdc2a9ce715db20bb4a commit 5c1a0ad5adb75c0b6c24afdc2a9ce715db20bb4a Author: Adhemerval Zanella 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 + +#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