mirror of
https://sourceware.org/git/glibc.git
synced 2025-09-11 12:10:50 +03:00
LoongArch: Fix tst-gnu2-tls2 compiler error
Add -mno-lsx to tst-gnu2-tlsmod*.c if gcc support -mno-lsx. Add escape character '\' in vector support test function.
This commit is contained in:
@@ -35,10 +35,12 @@ sysdep-dl-routines += \
|
|||||||
# Disable the compiler from using LSX for TLS descriptor tests, or storing into
|
# 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
|
# 16B TLS variable may clobber FP/vector registers and prevent us from checking
|
||||||
# their contents.
|
# their contents.
|
||||||
|
ifeq (yes,$(loongarch-vec-com))
|
||||||
CFLAGS-tst-gnu2-tls2mod0.c += -mno-lsx
|
CFLAGS-tst-gnu2-tls2mod0.c += -mno-lsx
|
||||||
CFLAGS-tst-gnu2-tls2mod1.c += -mno-lsx
|
CFLAGS-tst-gnu2-tls2mod1.c += -mno-lsx
|
||||||
CFLAGS-tst-gnu2-tls2mod2.c += -mno-lsx
|
CFLAGS-tst-gnu2-tls2mod2.c += -mno-lsx
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# LoongArch's assembler also needs to know about PIC as it changes the
|
# LoongArch's assembler also needs to know about PIC as it changes the
|
||||||
# definition of some assembler macros.
|
# definition of some assembler macros.
|
||||||
|
3
sysdeps/loongarch/configure
vendored
3
sysdeps/loongarch/configure
vendored
@@ -143,3 +143,6 @@ then
|
|||||||
printf "%s\n" "#define HAVE_LOONGARCH_VEC_COM 1" >>confdefs.h
|
printf "%s\n" "#define HAVE_LOONGARCH_VEC_COM 1" >>confdefs.h
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
config_vars="$config_vars
|
||||||
|
loongarch-vec-com = $libc_cv_loongarch_vec_com"
|
||||||
|
|
||||||
|
@@ -71,8 +71,8 @@ AC_CACHE_CHECK([for vector support in compiler],
|
|||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
void foo (void)
|
void foo (void)
|
||||||
{
|
{
|
||||||
asm volatile ("vldi $vr0, 1" ::: "$vr0");
|
asm volatile ("vldi \$vr0, 1" ::: "\$vr0");
|
||||||
asm volatile ("xvldi $xr0, 1" ::: "$xr0");
|
asm volatile ("xvldi \$xr0, 1" ::: "\$xr0");
|
||||||
}
|
}
|
||||||
]])],
|
]])],
|
||||||
[libc_cv_loongarch_vec_com=yes],
|
[libc_cv_loongarch_vec_com=yes],
|
||||||
@@ -81,3 +81,4 @@ if test "$libc_cv_loongarch_vec_com" = yes ;
|
|||||||
then
|
then
|
||||||
AC_DEFINE(HAVE_LOONGARCH_VEC_COM)
|
AC_DEFINE(HAVE_LOONGARCH_VEC_COM)
|
||||||
fi
|
fi
|
||||||
|
LIBC_CONFIG_VAR([loongarch-vec-com], [$libc_cv_loongarch_vec_com])
|
||||||
|
Reference in New Issue
Block a user