From: Yao Zihong Date: Mon, 26 Jan 2026 21:24:40 +0000 (-0600) Subject: riscv: Disable multiarch memcpy variants when !IS_IN(libc) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=343b7918da135032a85d677ca3edf8d5a42acbbf;p=thirdparty%2Fglibc.git riscv: Disable multiarch memcpy variants when !IS_IN(libc) This patch disables multiarch memcpy variants when !IS_IN(libc), because rtld can only use a single fixed implementation. Signed-off-by: Yao Zihong Reviewed-by: Adhemerval Zanella --- diff --git a/sysdeps/riscv/multiarch/memcpy-generic.c b/sysdeps/riscv/multiarch/memcpy-generic.c index 6af72f35dd..5a2dfed57b 100644 --- a/sysdeps/riscv/multiarch/memcpy-generic.c +++ b/sysdeps/riscv/multiarch/memcpy-generic.c @@ -22,5 +22,5 @@ # define MEMCPY __memcpy_generic # undef libc_hidden_builtin_def # define libc_hidden_builtin_def(x) +# include #endif -#include diff --git a/sysdeps/riscv/multiarch/memcpy_noalignment.S b/sysdeps/riscv/multiarch/memcpy_noalignment.S index b912abe6d1..559e2b21e2 100644 --- a/sysdeps/riscv/multiarch/memcpy_noalignment.S +++ b/sysdeps/riscv/multiarch/memcpy_noalignment.S @@ -19,6 +19,7 @@ #include #include +#if IS_IN(libc) /* memcpy optimization for CPUs with fast unaligned support (RISCV_HWPROBE_MISALIGNED_FAST). @@ -31,7 +32,7 @@ The tail is handled with branchless copies. */ -#define BLOCK_SIZE (16 * SZREG) +# define BLOCK_SIZE (16 * SZREG) .attribute unaligned_access, 1 ENTRY (__memcpy_noalignment) @@ -156,3 +157,5 @@ L(word_copy_adjust): mv a3, a5 j L(word_copy) END (__memcpy_noalignment) + +#endif