diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-08-02 10:28:31 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-08-21 10:30:52 -0700 |
commit | f26b8ea31eea468eac53f7218f9e9895d3c3b6d3 (patch) | |
tree | 63536ab72e07c28d42d401c8ae7514aba8a32a63 | |
parent | 9eb6f440732b2043dab469f3987c2122695a764c (diff) | |
download | meta-clang-f26b8ea31eea468eac53f7218f9e9895d3c3b6d3.tar.gz |
libcxx: Fix build on rv32 and use compiler-rt on rv32/rv64
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-.patch | 32 | ||||
-rw-r--r-- | recipes-devtools/clang/libcxx_git.bb | 2 |
2 files changed, 32 insertions, 2 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 new file mode 100644 index 0000000..52a08d6 --- /dev/null +++ b/recipes-devtools/clang/clang/0025-libcxx-Define-__NR_futex-to-be-__NR_futex_time64-on-.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From b0332a97ab1abdddadbe34dc30ee2b8e7d5cb2f9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 2 Aug 2020 10:11:00 -0700 | ||
4 | Subject: [PATCH] libcxx: Define __NR_futex to be __NR_futex_time64 on riscv32 | ||
5 | |||
6 | RISCV glibc has decided to use 64bit time_t from get go unlike | ||
7 | other 32bit architecture therefore aliasing __NR_futex to | ||
8 | __NR_futex_time64 helps avoid the below errors on rv32 | ||
9 | |||
10 | Upstream-Status: Submittted [https://reviews.llvm.org/D85095] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | libcxx/src/atomic.cpp | 3 +++ | ||
14 | 1 file changed, 3 insertions(+) | ||
15 | |||
16 | diff --git a/libcxx/src/atomic.cpp b/libcxx/src/atomic.cpp | ||
17 | index 65d4837bb4a7..e9969b8e570e 100644 | ||
18 | --- a/libcxx/src/atomic.cpp | ||
19 | +++ b/libcxx/src/atomic.cpp | ||
20 | @@ -16,6 +16,9 @@ | ||
21 | #include <iostream> | ||
22 | |||
23 | #ifdef __linux__ | ||
24 | +#if !defined(__NR_futex) && defined(__riscv) && __riscv_xlen == 32 | ||
25 | +# define __NR_futex __NR_futex_time64 | ||
26 | +#endif | ||
27 | |||
28 | #include <unistd.h> | ||
29 | #include <linux/futex.h> | ||
30 | -- | ||
31 | 2.28.0 | ||
32 | |||
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 1dfcc69..80eaa78 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb | |||
@@ -11,8 +11,6 @@ require common-source.inc | |||
11 | inherit cmake python3native | 11 | inherit cmake python3native |
12 | 12 | ||
13 | PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("RUNTIME", "llvm", "unwind", "", d)}" | 13 | PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("RUNTIME", "llvm", "unwind", "", d)}" |
14 | PACKAGECONFIG_riscv32 = "exceptions" | ||
15 | PACKAGECONFIG_riscv64 = "exceptions" | ||
16 | PACKAGECONFIG_append_armv5 = " no-atomics" | 14 | PACKAGECONFIG_append_armv5 = " no-atomics" |
17 | 15 | ||
18 | PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=ON -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," | 16 | PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=ON -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," |