1 |
commit: ffad92daa7226f4246808a1a98d26f39d7d42990 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 13 08:18:39 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 13 09:39:29 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffad92da |
7 |
|
8 |
sys-devel/clang: Backport non-native build fix for 9.0.0 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-devel/clang/clang-9.0.0.9999.ebuild | 6 ++++ |
13 |
...est-Import-LLVMTestingSupport-if-necessar.patch | 39 ++++++++++++++++++++++ |
14 |
2 files changed, 45 insertions(+) |
15 |
|
16 |
diff --git a/sys-devel/clang/clang-9.0.0.9999.ebuild b/sys-devel/clang/clang-9.0.0.9999.ebuild |
17 |
index 92eaa1de0a7..60b45818fe4 100644 |
18 |
--- a/sys-devel/clang/clang-9.0.0.9999.ebuild |
19 |
+++ b/sys-devel/clang/clang-9.0.0.9999.ebuild |
20 |
@@ -63,6 +63,12 @@ S=${WORKDIR}/x/y/${P} |
21 |
# least intrusive of all |
22 |
CMAKE_BUILD_TYPE=RelWithDebInfo |
23 |
|
24 |
+PATCHES=( |
25 |
+ # fix linking in non-native build (without tools-extra) |
26 |
+ # https://bugs.llvm.org/show_bug.cgi?id=43281 |
27 |
+ "${FILESDIR}"/9.0.0/0001-clang-unittest-Import-LLVMTestingSupport-if-necessar.patch |
28 |
+) |
29 |
+ |
30 |
# Multilib notes: |
31 |
# 1. ABI_* flags control ABIs libclang* is built for only. |
32 |
# 2. clang is always capable of compiling code for all ABIs for enabled |
33 |
|
34 |
diff --git a/sys-devel/clang/files/9.0.0/0001-clang-unittest-Import-LLVMTestingSupport-if-necessar.patch b/sys-devel/clang/files/9.0.0/0001-clang-unittest-Import-LLVMTestingSupport-if-necessar.patch |
35 |
new file mode 100644 |
36 |
index 00000000000..67ae5a8e4dc |
37 |
--- /dev/null |
38 |
+++ b/sys-devel/clang/files/9.0.0/0001-clang-unittest-Import-LLVMTestingSupport-if-necessar.patch |
39 |
@@ -0,0 +1,39 @@ |
40 |
+From bfb5b0cb86cf90d9fa794f873644aa642b652c43 Mon Sep 17 00:00:00 2001 |
41 |
+From: Michal Gorny <mgorny@g.o> |
42 |
+Date: Thu, 12 Sep 2019 13:06:12 +0000 |
43 |
+Subject: [PATCH] [clang] [unittest] Import LLVMTestingSupport if necessary |
44 |
+ |
45 |
+Add LLVMTestingSupport directory from LLVM_MAIN_SRC_DIR when building |
46 |
+clang stand-alone and LLVMTestingSupport library is not present. This |
47 |
+is needed to fix stand-alone builds without clang-tools-extra. |
48 |
+ |
49 |
+Differential Revision: https://reviews.llvm.org/D67452 |
50 |
+ |
51 |
+llvm-svn: 371733 |
52 |
+--- |
53 |
+ clang/unittests/CMakeLists.txt | 9 +++++++++ |
54 |
+ 1 file changed, 9 insertions(+) |
55 |
+ |
56 |
+diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt |
57 |
+index 9a41000cf43..4c222e24599 100644 |
58 |
+--- a/unittests/CMakeLists.txt |
59 |
++++ b/unittests/CMakeLists.txt |
60 |
+@@ -1,6 +1,15 @@ |
61 |
+ add_custom_target(ClangUnitTests) |
62 |
+ set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang tests") |
63 |
+ |
64 |
++if(CLANG_BUILT_STANDALONE) |
65 |
++ # LLVMTestingSupport library is needed for some of the unittests. |
66 |
++ if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support |
67 |
++ AND NOT TARGET LLVMTestingSupport) |
68 |
++ add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support |
69 |
++ lib/Testing/Support) |
70 |
++ endif() |
71 |
++endif() |
72 |
++ |
73 |
+ # add_clang_unittest(test_dirname file1.cpp file2.cpp) |
74 |
+ # |
75 |
+ # Will compile the list of files together and link against the clang |
76 |
+-- |
77 |
+2.23.0 |
78 |
+ |