]> sourceware.org Git - glibc.git/commitdiff
LoongArch: Fix tst-gnu2-tls2 compiler error
authormengqinggang <mengqinggang@loongson.cn>
Mon, 20 May 2024 09:05:12 +0000 (17:05 +0800)
committercaiyinyu <caiyinyu@loongson.cn>
Tue, 21 May 2024 03:23:03 +0000 (11:23 +0800)
Add -mno-lsx to tst-gnu2-tlsmod*.c if gcc support -mno-lsx.
Add escape character '\' in vector support test function.

sysdeps/loongarch/Makefile
sysdeps/loongarch/configure
sysdeps/loongarch/configure.ac

index a4ee915eff80c7373face2b64b80acf44237f06c..b00c090faaabadf8ae19cd81a6d9a160461db94b 100644 (file)
@@ -35,10 +35,12 @@ sysdep-dl-routines += \
 # Disable the compiler from using LSX for TLS descriptor tests, or storing into
 # 16B TLS variable may clobber FP/vector registers and prevent us from checking
 # their contents.
+ifeq (yes,$(loongarch-vec-com))
 CFLAGS-tst-gnu2-tls2mod0.c += -mno-lsx
 CFLAGS-tst-gnu2-tls2mod1.c += -mno-lsx
 CFLAGS-tst-gnu2-tls2mod2.c += -mno-lsx
 endif
+endif
 
 # LoongArch's assembler also needs to know about PIC as it changes the
 # definition of some assembler macros.
index 731f79438f14c21ff2588010cbc8b25006337f5a..afcef6cd2268ca812289334651328547a3e127c6 100644 (file)
@@ -143,3 +143,6 @@ then
   printf "%s\n" "#define HAVE_LOONGARCH_VEC_COM 1" >>confdefs.h
 
 fi
+config_vars="$config_vars
+loongarch-vec-com = $libc_cv_loongarch_vec_com"
+
index 24fee55dccbf1869a97d1485f6c36e907c5df914..c56a20357412ba0fceca20fb05517a95c0b3b6f9 100644 (file)
@@ -71,8 +71,8 @@ AC_CACHE_CHECK([for vector support in compiler],
 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 void foo (void)
 {
-  asm volatile ("vldi $vr0, 1" ::: "$vr0");
-  asm volatile ("xvldi $xr0, 1" ::: "$xr0");
+  asm volatile ("vldi \$vr0, 1" ::: "\$vr0");
+  asm volatile ("xvldi \$xr0, 1" ::: "\$xr0");
 }
 ]])],
                 [libc_cv_loongarch_vec_com=yes],
@@ -81,3 +81,4 @@ if test "$libc_cv_loongarch_vec_com" = yes ;
 then
   AC_DEFINE(HAVE_LOONGARCH_VEC_COM)
 fi
+LIBC_CONFIG_VAR([loongarch-vec-com], [$libc_cv_loongarch_vec_com])
This page took 0.047941 seconds and 5 git commands to generate.