public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/maskray/grte] Make multi-arch ifunc support work with clang
@ 2021-08-28  0:32 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:32 UTC (permalink / raw)
  To: glibc-cvs

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

commit c4d57c29b55e0dcad0aa6294427c0d09c8507fee
Author: Stan Shebs <stanshebs@google.com>
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Make multi-arch ifunc support work with clang
@ 2021-08-28  0:28 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-28  0:28 UTC (permalink / raw)
  To: glibc-cvs

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

commit 80fb3758c41208db86cf58598493e7d68585cfb6
Author: Stan Shebs <stanshebs@google.com>
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [glibc/maskray/grte] Make multi-arch ifunc support work with clang
@ 2021-08-27 23:45 Fangrui Song
  0 siblings, 0 replies; 3+ messages in thread
From: Fangrui Song @ 2021-08-27 23:45 UTC (permalink / raw)
  To: glibc-cvs

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

commit d02a16424688cada2c9682e8a82b747c32646670
Author: Stan Shebs <stanshebs@google.com>
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-28  0:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  0:32 [glibc/maskray/grte] Make multi-arch ifunc support work with clang Fangrui Song
  -- strict thread matches above, loose matches on Subject: below --
2021-08-28  0:28 Fangrui Song
2021-08-27 23:45 Fangrui Song

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