From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7814) id 004613857805; Sat, 28 Aug 2021 00:32:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 004613857805 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Fangrui Song To: glibc-cvs@sourceware.org Subject: [glibc/maskray/grte] Make multi-arch ifunc support work with clang X-Act-Checkin: glibc X-Git-Author: Stan Shebs X-Git-Refname: refs/heads/maskray/grte X-Git-Oldrev: 66c8103bdf54c1335efe8181f6110358f0277671 X-Git-Newrev: c4d57c29b55e0dcad0aa6294427c0d09c8507fee Message-Id: <20210828003216.004613857805@sourceware.org> Date: Sat, 28 Aug 2021 00:32:15 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2021 00:32:16 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c4d57c29b55e0dcad0aa6294427c0d09c8507fee commit c4d57c29b55e0dcad0aa6294427c0d09c8507fee Author: Stan Shebs Date: Tue Oct 8 13:00:12 2019 -0700 Make multi-arch ifunc support work with clang Diff: --- elf/Makefile | 8 ++++++-- sysdeps/x86_64/fpu/multiarch/Makefile | 25 +++++++++++++++---------- sysdeps/x86_64/multiarch/strcmp-sse42.S | 5 +++-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index 3009c0d316..827fe13178 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -336,11 +336,15 @@ tests-static += $(tests-ifuncstatic) tests-internal += $(tests-ifuncstatic) ifeq (yes,$(build-shared)) tests-internal += \ - ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \ + ifuncmain1pic ifuncmain1vis ifuncmain1vispic \ ifuncmain1staticpic \ ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \ - ifuncmain5 ifuncmain5pic ifuncmain5staticpic \ + ifuncmain5pic ifuncmain5staticpic \ ifuncmain7 ifuncmain7pic +ifneq ($(with-clang),yes) +# Skip over tests where lld errors with "cannot preempt symbol" +tests-internal += ifuncmain1 ifuncmain5 +endif ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \ ifuncdep5 ifuncdep5pic extra-test-objs += $(ifunc-test-modules:=.o) diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile index 9a89bfc286..13125c7f1b 100644 --- a/sysdeps/x86_64/fpu/multiarch/Makefile +++ b/sysdeps/x86_64/fpu/multiarch/Makefile @@ -85,16 +85,21 @@ libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \ mplog-avx mpa-avx slowexp-avx \ mpexp-avx -CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX -CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX -CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX -CFLAGS-mpa-avx.c = -msse2avx -DSSE2AVX -CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX -CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX -CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX -CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX -CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX -CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX +sse2avx-flags = -msse2avx -DSSE2AVX +ifeq ($(with-clang),yes) +sse2avx-flags = -DSSE2AVX +endif + +CFLAGS-e_atan2-avx.c = $(sse2avx-flags) +CFLAGS-e_exp-avx.c = $(sse2avx-flags) +CFLAGS-e_log-avx.c = $(sse2avx-flags) +CFLAGS-mpa-avx.c = $(sse2avx-flags) +CFLAGS-mpexp-avx.c = $(sse2avx-flags) +CFLAGS-mplog-avx.c = $(sse2avx-flags) +CFLAGS-s_atan-avx.c = $(sse2avx-flags) +CFLAGS-s_sin-avx.c = $(sse2avx-flags) +CFLAGS-slowexp-avx.c = $(sse2avx-flags) +CFLAGS-s_tan-avx.c = $(sse2avx-flags) endif ifeq ($(subdir),mathvec) diff --git a/sysdeps/x86_64/multiarch/strcmp-sse42.S b/sysdeps/x86_64/multiarch/strcmp-sse42.S index 6fa0c2c7d2..8faba15b27 100644 --- a/sysdeps/x86_64/multiarch/strcmp-sse42.S +++ b/sysdeps/x86_64/multiarch/strcmp-sse42.S @@ -1770,8 +1770,9 @@ LABEL(strcmp_exitz): .p2align 4 // XXX Same as code above LABEL(Byte0): - movzx (%rsi), %ecx - movzx (%rdi), %eax + # Clang assembler objects to movzx here. + movzbl (%rsi), %ecx + movzbl (%rdi), %eax #if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L leaq _nl_C_LC_CTYPE_tolower+128*4(%rip), %rdx