summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-11-14 15:02:31 -0800
committerKhem Raj <raj.khem@gmail.com>2020-11-15 16:51:45 -0800
commit86ab1ce8c667b54e3da1128bb9f05f51adbe9c0b (patch)
tree1af74b888bf5cbcf23d5f030fef2499d6b6bea54
parentf1adebb07e2de0d7949f8347560feabd10d19846 (diff)
downloadmeta-clang-86ab1ce8c667b54e3da1128bb9f05f51adbe9c0b.tar.gz
clang: Update riscv32 fix to match upstream submitted version
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch30
1 files changed, 19 insertions, 11 deletions
diff --git a/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch b/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch
index 52a08d6..0d57cc7 100644
--- a/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch
+++ b/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch
@@ -1,7 +1,8 @@
1From b0332a97ab1abdddadbe34dc30ee2b8e7d5cb2f9 Mon Sep 17 00:00:00 2001 1From e7c1d4b74df67070d3666843caeced417387886e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 2 Aug 2020 10:11:00 -0700 3Date: Sun, 2 Aug 2020 10:11:00 -0700
4Subject: [PATCH] libcxx: Define __NR_futex to be __NR_futex_time64 on riscv32 4Subject: [PATCH 25/26] libcxx: Define __NR_futex to be __NR_futex_time64 on
5 riscv32
5 6
6RISCV glibc has decided to use 64bit time_t from get go unlike 7RISCV glibc has decided to use 64bit time_t from get go unlike
7other 32bit architecture therefore aliasing __NR_futex to 8other 32bit architecture therefore aliasing __NR_futex to
@@ -10,23 +11,30 @@ __NR_futex_time64 helps avoid the below errors on rv32
10Upstream-Status: Submittted [https://reviews.llvm.org/D85095] 11Upstream-Status: Submittted [https://reviews.llvm.org/D85095]
11Signed-off-by: Khem Raj <raj.khem@gmail.com> 12Signed-off-by: Khem Raj <raj.khem@gmail.com>
12--- 13---
13 libcxx/src/atomic.cpp | 3 +++ 14 libcxx/src/atomic.cpp | 10 ++++++++++
14 1 file changed, 3 insertions(+) 15 1 file changed, 10 insertions(+)
15 16
16diff --git a/libcxx/src/atomic.cpp b/libcxx/src/atomic.cpp 17diff --git a/libcxx/src/atomic.cpp b/libcxx/src/atomic.cpp
17index 65d4837bb4a7..e9969b8e570e 100644 18index 6b73ed771cd..d2511529dce 100644
18--- a/libcxx/src/atomic.cpp 19--- a/libcxx/src/atomic.cpp
19+++ b/libcxx/src/atomic.cpp 20+++ b/libcxx/src/atomic.cpp
20@@ -16,6 +16,9 @@ 21@@ -15,6 +15,16 @@
21 #include <iostream>
22 22
23 #ifdef __linux__ 23 #ifdef __linux__
24+#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32
25+# define __NR_futex __NR_futex_time64
26+#endif
27 24
25+// libc++ uses SYS_futex, which it expects from system C library.
26+// in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex)
27+// rv32 is using 64bit time_t from get go unlike other 32bit architectures
28+// in glibc, therefore it wont have NR_futex defined but just NR_futex_time64
29+// this aliases it to NR_futex so that SYS_futex is then defined for rv32
30+
31+#if !defined(SYS_futex) && defined(SYS_futex_time64)
32+# define SYS_futex SYS_futex_time64
33+#endif
34+
28 #include <unistd.h> 35 #include <unistd.h>
29 #include <linux/futex.h> 36 #include <linux/futex.h>
37 #include <sys/syscall.h>
30-- 38--
312.28.0 392.29.2
32 40