1 Star 0 Fork 15

ocs-commit-check/glibc

forked from OpenCloudOS Stream/glibc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0018-nptl-fix-__builtin_thread_pointer-detection-on-Loong.patch 1.54 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-11-27 14:45 . LoongArch: Fix errors about PIE
From 4fc83ec7003cd216c651d7695e78910b0d0400f2 Mon Sep 17 00:00:00 2001
From: caiyinyu <caiyinyu@loongson.cn>
Date: Wed, 6 Nov 2024 10:06:21 +0800
Subject: [PATCH 3/3] nptl: fix __builtin_thread_pointer detection on LoongArch
Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
---
sysdeps/loongarch/nptl/thread_pointer.h | 10 ++--------
sysdeps/loongarch/nptl/tls.h | 2 +-
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/sysdeps/loongarch/nptl/thread_pointer.h b/sysdeps/loongarch/nptl/thread_pointer.h
index 5dec2ef4..cc96062c 100644
--- a/sysdeps/loongarch/nptl/thread_pointer.h
+++ b/sysdeps/loongarch/nptl/thread_pointer.h
@@ -19,18 +19,12 @@
#ifndef _SYS_THREAD_POINTER_H
#define _SYS_THREAD_POINTER_H
-#include <sys/cdefs.h>
+register void *__thread_self asm ("$tp");
static inline void *
__thread_pointer (void)
{
-#if __glibc_has_builtin (__builtin_thread_pointer)
- return __builtin_thread_pointer ();
-#else
- void *__thread_register;
- __asm__ ("move %0, $tp" : "=r" (__thread_register));
- return __thread_register;
-#endif
+ return __thread_self;
}
#endif /* _SYS_THREAD_POINTER_H */
diff --git a/sysdeps/loongarch/nptl/tls.h b/sysdeps/loongarch/nptl/tls.h
index c52ede4d..6356a54d 100644
--- a/sysdeps/loongarch/nptl/tls.h
+++ b/sysdeps/loongarch/nptl/tls.h
@@ -26,8 +26,8 @@
#include <stddef.h>
#include <stdint.h>
#include <dl-dtv.h>
+#include "thread_pointer.h"
-register void *__thread_self asm ("$tp");
#define READ_THREAD_POINTER() ({ __thread_self; })
/* Get system call information. */
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ocs-commit-check/glibc.git
git@gitee.com:ocs-commit-check/glibc.git
ocs-commit-check
glibc
glibc
master

搜索帮助