1 Star 0 Fork 15

ocs-commit-check/glibc

forked from OpenCloudOS Stream/glibc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-LoongArch-Fix-tst-gnu2-tls2-compiler-error.patch 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-11-07 15:19 . LoongArch: Sync from glibc upstream
From 479cf47724e06c1020d5806c90abfdb353e832c8 Mon Sep 17 00:00:00 2001
From: mengqinggang <mengqinggang@loongson.cn>
Date: Mon, 20 May 2024 17:05:12 +0800
Subject: [PATCH 05/15] 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.
---
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 a4ee915e..b00c090f 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 a133821f..73cf3b95 100644
--- a/sysdeps/loongarch/configure
+++ b/sysdeps/loongarch/configure
@@ -165,3 +165,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 9b1cf26e..878c5d64 100644
--- a/sysdeps/loongarch/configure.ac
+++ b/sysdeps/loongarch/configure.ac
@@ -83,8 +83,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],
@@ -93,3 +93,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])
--
2.43.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit-check/glibc.git
git@gitee.com:ocs-commit-check/glibc.git
ocs-commit-check
glibc
glibc
master

搜索帮助