[glibc] riscv: Keep __memcmpeq alias with RVV memcmp

Adhemerval Zanella via Glibc-cvs <[email protected]> Tue, 9 Jun 2026 12:11:47 +0000 (GMT)
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9cf4dd03bdfd8b4113400e6b56c6d665c3c739ae

commit 9cf4dd03bdfd8b4113400e6b56c6d665c3c739ae
Author: Zihong Yao <[email protected]>
Date:   Tue Jun 9 03:27:54 2026 +0000

    riscv: Keep __memcmpeq alias with RVV memcmp
    
    Commit 2efc702628 replaces the generic RISC-V memcmp, which also exports
    __memcmpeq.
    
    A dedicated RISC-V __memcmpeq implementation is expected in a later patch,
    which is still under review. Keep the alias here so this patch does not
    temporarily drop the existing __memcmpeq ABI.
    
    Tested on a Muse-Pi board with GCC 15.2.0 using `--with-arch=rv64g_zca_zcd --with-abi=lp64d`
    and `CFLAGS="-march=rv64g_zca_zcd -mabi=lp64d -O2"`. Full make check was
    run for both multiarch and non-multiarch builds.
    This also fixes the string/inl-tester link failure caused by the missing
    __memcmpeq symbol.
    
    In both runs, the only FAILs are the unchanged cospi/sinpi/tanpi math test
    failures.
    
    Signed-off-by: Zihong Yao <[email protected]>
    Reviewed-by: Adhemerval Zanella  <[email protected]>

Diff:
---
 sysdeps/unix/sysv/linux/riscv/multiarch/memcmp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/riscv/multiarch/memcmp.c b/sysdeps/unix/sysv/linux/riscv/multiarch/memcmp.c
index 20e7b046ab..166df04d55 100644
--- a/sysdeps/unix/sysv/linux/riscv/multiarch/memcmp.c
+++ b/sysdeps/unix/sysv/linux/riscv/multiarch/memcmp.c
@@ -51,6 +51,10 @@ riscv_libc_ifunc (__libc_memcmp, select_memcmp_ifunc);
 # undef bcmp
 strong_alias (__libc_memcmp, memcmp);
 weak_alias (memcmp, bcmp);
+
+# undef __memcmpeq
+strong_alias (__libc_memcmp, __memcmpeq);
+libc_hidden_def (__memcmpeq);
 # ifdef SHARED
 __hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
   __attribute__ ((visibility ("hidden"))) __attribute_copy__ (memcmp);