Make multi-arch ifunc support work with clang

This commit is contained in:
Stan Shebs 2019-10-08 13:00:12 -07:00 committed by Fangrui Song
parent 66c8103bdf
commit c4d57c29b5
3 changed files with 24 additions and 14 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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