[PATCH 1/2] LoongArch: Fix LSX compiler capability check

caiyinyu caiyinyu@loongson.cn
Tue Nov 10 02:33:07 GMT 2026


LGTM

在 2026/11/6 15:54, Deng Jianbo 写道:
> The capability test writes its source to conftest.c but invokes the
> compiler on conftest.s, so it always fails to detect LSX support and
> HAVE_LOONGARCH_VEC_COM is not defined. This patch changes to compile
> consftest.c instead and regenerate configure.
> ---
>   sysdeps/loongarch/configure    | 2 +-
>   sysdeps/loongarch/configure.ac | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/loongarch/configure b/sysdeps/loongarch/configure
> index f32f9ae91a..9c8791ae1b 100644
> --- a/sysdeps/loongarch/configure
> +++ b/sysdeps/loongarch/configure
> @@ -128,7 +128,7 @@ void foo (void)
>     asm volatile ("vldi \$vr0, 1" ::: "\$vr0");
>   }
>   EOF
> -if { ac_try='${CC-cc} -c -mlsx $CFLAGS conftest.s -o conftest 1>&5'
> +if { ac_try='${CC-cc} -c -mlsx $CFLAGS conftest.c -o conftest 1>&5'
>     { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
>     (eval $ac_try) 2>&5
>     ac_status=$?
> diff --git a/sysdeps/loongarch/configure.ac b/sysdeps/loongarch/configure.ac
> index 425416ced7..af6a8497f5 100644
> --- a/sysdeps/loongarch/configure.ac
> +++ b/sysdeps/loongarch/configure.ac
> @@ -75,7 +75,7 @@ void foo (void)
>     asm volatile ("vldi \$vr0, 1" ::: "\$vr0");
>   }
>   EOF
> -if AC_TRY_COMMAND(${CC-cc} -c -mlsx $CFLAGS conftest.s -o conftest 1>&AS_MESSAGE_LOG_FD); then
> +if AC_TRY_COMMAND(${CC-cc} -c -mlsx $CFLAGS conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD); then
>     libc_cv_loongarch_vec_com=yes
>   else
>     libc_cv_loongarch_vec_com=no



More information about the Libc-alpha mailing list