]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
riscv: Disable multiarch memcpy variants when !IS_IN(libc)
authorYao Zihong <zihong.plct@isrc.iscas.ac.cn>
Mon, 26 Jan 2026 21:24:40 +0000 (15:24 -0600)
committerPeter Bergner <bergner@tenstorrent.com>
Mon, 26 Jan 2026 21:25:15 +0000 (15:25 -0600)
This patch disables multiarch memcpy variants when !IS_IN(libc),
because rtld can only use a single fixed implementation.

Signed-off-by: Yao Zihong <zihong.plct@isrc.iscas.ac.cn>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/riscv/multiarch/memcpy-generic.c
sysdeps/riscv/multiarch/memcpy_noalignment.S

index 6af72f35dd4b96392cd32a9477585c123d4fb5ce..5a2dfed57b195c7c5bef9343df3484044d132cb9 100644 (file)
@@ -22,5 +22,5 @@
 # define MEMCPY __memcpy_generic
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(x)
+# include <string/memcpy.c>
 #endif
-#include <string/memcpy.c>
index b912abe6d1f83cddca46e8a46116d4b3699df900..559e2b21e25c76da9b61a574e228837fb3a46e9a 100644 (file)
@@ -19,6 +19,7 @@
 #include <sysdep.h>
 #include <sys/asm.h>
 
+#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