[COMMITTED] x86_64: Fix memcpy compat symbol in the page-unrolled memmove

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Nov 9 13:17:06 GMT 2026


When MINIMUM_X86_ISA_LEVEL is 3 or 4, the AVX and EVEX base files
also include memmove-shlib-compat.h, so both objects define
memcpy@GLIBC_2.2.5 and linking libc fails:

  memmove-vec-unaligned-erms.S:159: multiple definition of
  `memcpy@GLIBC_2.2.5'

This breaks any x86-64-v3 or x86-64-v4 build since c93f5924fd2.  Add
the PAGE_UNROLLED guard that the SSE2 variant already uses.

Checked on x86_64-linux-gnu with -march=x86-64-v3.
---
 .../x86_64/multiarch/memmove-avx-unaligned-erms-page-unrolled.S | 1 +
 sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S           | 2 +-
 .../multiarch/memmove-evex-unaligned-erms-page-unrolled.S       | 1 +
 sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms.S          | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms-page-unrolled.S b/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms-page-unrolled.S
index 57b518e16fc..3f4d82185e7 100644
--- a/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms-page-unrolled.S
+++ b/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms-page-unrolled.S
@@ -2,4 +2,5 @@
 # define MEMMOVE_SYMBOL(p,s)	p##_avx_##s##_page_unrolled
 #endif
 #define MEMMOVE_VEC_LARGE_IMPL	"memmove-vec-large-page-unrolled.S"
+#define PAGE_UNROLLED	1
 #include "memmove-avx-unaligned-erms.S"
diff --git a/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S
index 4e4b4635f93..ea4ca3bfc09 100644
--- a/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S
+++ b/sysdeps/x86_64/multiarch/memmove-avx-unaligned-erms.S
@@ -10,7 +10,7 @@
 
 # include "memmove-vec-unaligned-erms.S"
 
-# if MINIMUM_X86_ISA_LEVEL == 3
+# if MINIMUM_X86_ISA_LEVEL == 3 && !defined PAGE_UNROLLED
 #  include "memmove-shlib-compat.h"
 # endif
 #endif
diff --git a/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms-page-unrolled.S b/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms-page-unrolled.S
index 371b4548199..615a75ec3ad 100644
--- a/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms-page-unrolled.S
+++ b/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms-page-unrolled.S
@@ -2,4 +2,5 @@
 # define MEMMOVE_SYMBOL(p,s)	p##_evex_##s##_page_unrolled
 #endif
 #define MEMMOVE_VEC_LARGE_IMPL	"memmove-vec-large-page-unrolled.S"
+#define PAGE_UNROLLED	1
 #include "memmove-evex-unaligned-erms.S"
diff --git a/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms.S b/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms.S
index 1f7b5715f7e..ad931835f94 100644
--- a/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms.S
+++ b/sysdeps/x86_64/multiarch/memmove-evex-unaligned-erms.S
@@ -11,7 +11,7 @@
 # include "memmove-vec-unaligned-erms.S"
 
 
-# if MINIMUM_X86_ISA_LEVEL == 4
+# if MINIMUM_X86_ISA_LEVEL == 4 && !defined PAGE_UNROLLED
 #  include "memmove-shlib-compat.h"
 # endif
 #endif
-- 
2.53.0



More information about the Libc-alpha mailing list