diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-11-17 16:33:49 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-11-18 15:34:53 -0800 |
commit | c17278ad7bbe91be0d1aa34da069d73aeafd60af (patch) | |
tree | 0ff497873029bea4969f2179f93a9e7ce3c48102 | |
parent | 6e1b6459ce5a85622fd24d7df4cee06afff76297 (diff) | |
download | meta-clang-c17278ad7bbe91be0d1aa34da069d73aeafd60af.tar.gz |
clangd: Always link with libatomic
Since it uses double atomics which are not available yet as intrinsics
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch | 37 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
2 files changed, 38 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch new file mode 100644 index 0000000..1122d6a --- /dev/null +++ b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 17 Nov 2019 16:26:07 -0800 | ||
4 | Subject: [PATCH] clangd: Always link with libatomic | ||
5 | |||
6 | Trace.cpp uses atomic<double> which is not available as instrinsic | ||
7 | its only added in c++20, until then link with libatomic | ||
8 | |||
9 | Another solution would be to not use double atomics something like below | ||
10 | |||
11 | - std::atomic<double> EndTime; // Filled in by markEnded(). | ||
12 | + std::atomic<int64_t> EndTime; // Filled in by markEnded(). | ||
13 | |||
14 | but I don't know if this would be just the change needed or more is | ||
15 | required | ||
16 | |||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | clang-tools-extra/clangd/CMakeLists.txt | 5 +---- | ||
20 | 1 file changed, 1 insertion(+), 4 deletions(-) | ||
21 | |||
22 | diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt | ||
23 | index f617f7931de..2be738c6097 100644 | ||
24 | --- a/clang-tools-extra/clangd/CMakeLists.txt | ||
25 | +++ b/clang-tools-extra/clangd/CMakeLists.txt | ||
26 | @@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) | ||
27 | include(CheckAtomic) | ||
28 | endif() | ||
29 | |||
30 | -set(CLANGD_ATOMIC_LIB "") | ||
31 | -if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) | ||
32 | - list(APPEND CLANGD_ATOMIC_LIB "atomic") | ||
33 | -endif() | ||
34 | +list(APPEND CLANGD_ATOMIC_LIB "atomic") | ||
35 | |||
36 | add_clang_library(clangDaemon | ||
37 | AST.cpp | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 99b1e43..6149a2f 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -32,6 +32,7 @@ SRC_URI = "\ | |||
32 | file://0022-RISCV-Add-support-for-floating-point-registers-in-in.patch \ | 32 | file://0022-RISCV-Add-support-for-floating-point-registers-in-in.patch \ |
33 | file://0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ | 33 | file://0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ |
34 | file://0024-openmp-Recognise-ARMv7ve-machine-arch.patch \ | 34 | file://0024-openmp-Recognise-ARMv7ve-machine-arch.patch \ |
35 | file://0025-clangd-Always-link-with-libatomic.patch \ | ||
35 | " | 36 | " |
36 | 37 | ||
37 | # Fallback to no-PIE if not set | 38 | # Fallback to no-PIE if not set |