public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Yinyu Cai <caiyinyu@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] LoongArch: Fix tst-gnu2-tls2 compiler error
Date: Tue, 21 May 2024 04:09:09 +0000 (GMT)	[thread overview]
Message-ID: <20240521040909.C69C33858D1E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=16d47c1594c5bcd334d0b8dbf147cda917f19bc4

commit 16d47c1594c5bcd334d0b8dbf147cda917f19bc4
Author: mengqinggang <mengqinggang@loongson.cn>
Date:   Mon May 20 17:05:12 2024 +0800

    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.

Diff:
---
 sysdeps/loongarch/Makefile     | 2 ++
 sysdeps/loongarch/configure    | 3 +++
 sysdeps/loongarch/configure.ac | 5 +++--
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/sysdeps/loongarch/Makefile b/sysdeps/loongarch/Makefile
index a4ee915eff..b00c090faa 100644
--- a/sysdeps/loongarch/Makefile
+++ b/sysdeps/loongarch/Makefile
@@ -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.
diff --git a/sysdeps/loongarch/configure b/sysdeps/loongarch/configure
index 731f79438f..afcef6cd22 100644
--- a/sysdeps/loongarch/configure
+++ b/sysdeps/loongarch/configure
@@ -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"
+
diff --git a/sysdeps/loongarch/configure.ac b/sysdeps/loongarch/configure.ac
index 24fee55dcc..c56a203574 100644
--- a/sysdeps/loongarch/configure.ac
+++ b/sysdeps/loongarch/configure.ac
@@ -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])

                 reply	other threads:[~2024-05-21  4:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240521040909.C69C33858D1E@sourceware.org \
    --to=caiyinyu@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).