[PATCH] riscv: Keep __memcmpeq alias with RVV memcmp
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Tue Jun 9 12:03:55 GMT 2026
On 09/06/26 00:27, Zihong Yao wrote:
> 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 <zihong.plct@isrc.iscas.ac.cn>
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> 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);
More information about the Libc-alpha
mailing list