1 |
commit: 4022af8479305a46fe5d9e94ea78342e9a13b7d8 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 1 00:35:07 2016 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 1 00:41:18 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4022af84 |
7 |
|
8 |
sys-devel/clang: Replace the non-upstreamable lib/clang patch |
9 |
|
10 |
Replace the non-upstream patch allowing us to alter path for lib/clang |
11 |
with the use of upstream CLANG_RESOURCE_DIR option (to fix file search |
12 |
in driver code) combined with necessary symlinking (for tests) and moves |
13 |
(for install) of installed headers. |
14 |
|
15 |
sys-devel/clang/clang-9999.ebuild | 16 +++- |
16 |
...rting-overriding-runtime-libdir-via-CLANG.patch | 86 ---------------------- |
17 |
2 files changed, 12 insertions(+), 90 deletions(-) |
18 |
|
19 |
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild |
20 |
index 689eaae..a962a81 100644 |
21 |
--- a/sys-devel/clang/clang-9999.ebuild |
22 |
+++ b/sys-devel/clang/clang-9999.ebuild |
23 |
@@ -115,8 +115,6 @@ src_unpack() { |
24 |
src_prepare() { |
25 |
python_setup |
26 |
|
27 |
- # support overriding clang runtime install directory |
28 |
- eapply "${FILESDIR}"/9999/0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch |
29 |
# fix stand-alone doc build |
30 |
eapply "${FILESDIR}"/9999/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch |
31 |
|
32 |
@@ -125,11 +123,13 @@ src_prepare() { |
33 |
} |
34 |
|
35 |
multilib_src_configure() { |
36 |
+ # TODO: read it? |
37 |
+ local clang_version=4.0.0 |
38 |
local libdir=$(get_libdir) |
39 |
local mycmakeargs=( |
40 |
-DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
41 |
- # install clang runtime straight into /usr/lib |
42 |
- -DCLANG_LIBDIR_SUFFIX="" |
43 |
+ # relative to bindir |
44 |
+ -DCLANG_RESOURCE_DIR="../lib/clang/${clang_version}" |
45 |
|
46 |
-DBUILD_SHARED_LIBS=ON |
47 |
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
48 |
@@ -189,6 +189,9 @@ multilib_src_configure() { |
49 |
|
50 |
multilib_src_compile() { |
51 |
cmake-utils_src_compile |
52 |
+ |
53 |
+ # provide a symlink for tests |
54 |
+ ln -s "../$(get_libdir)/clang" lib/clang || die |
55 |
} |
56 |
|
57 |
multilib_src_test() { |
58 |
@@ -243,6 +246,11 @@ src_install() { |
59 |
|
60 |
multilib_src_install() { |
61 |
cmake-utils_src_install |
62 |
+ |
63 |
+ # move headers to the correct directory |
64 |
+ dodir /usr/lib/clang |
65 |
+ cp -pR "${ED}usr/$(get_libdir)/clang"/* "${ED}usr/lib/clang/" || die |
66 |
+ rm -r "${ED}usr/$(get_libdir)/clang" || die |
67 |
} |
68 |
|
69 |
multilib_src_install_all() { |
70 |
|
71 |
diff --git a/sys-devel/clang/files/9999/0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch b/sys-devel/clang/files/9999/0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch |
72 |
deleted file mode 100644 |
73 |
index da737c1..00000000 |
74 |
--- a/sys-devel/clang/files/9999/0005-cmake-Supporting-overriding-runtime-libdir-via-CLANG.patch |
75 |
+++ /dev/null |
76 |
@@ -1,86 +0,0 @@ |
77 |
-From 8864d8f9da1b30c9539e9dc0388c5d0dccca3a34 Mon Sep 17 00:00:00 2001 |
78 |
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
79 |
-Date: Sun, 21 Aug 2016 23:31:06 +0200 |
80 |
-Subject: [PATCH 5/7] cmake: Supporting overriding runtime libdir via |
81 |
- CLANG_LIBDIR_SUFFIX |
82 |
- |
83 |
-Make it possible to override the value of CLANG_LIBDIR_SUFFIX, and use |
84 |
-it uniformly to control install location of runtimes (i.e. lib/clang), |
85 |
-therefore supporting sharing a common runtime between multiple multilib |
86 |
-variants. |
87 |
- |
88 |
-Previously, CLANG_LIBDIR_SUFFIX was pinned to LLVM_LIBDIR_SUFFIX |
89 |
-and used only to define runtime path in driver code. This patch extends |
90 |
-its use to building and installing the runtime (the former is needed for |
91 |
-tests to work correctly). |
92 |
- |
93 |
-The goal is to support install layout alike "LLVM_LIBDIR_SUFFIX=64 |
94 |
-CLANG_LIBDIR_SUFFIX=''" -- where all shared libraries would be installed |
95 |
-into ABI-specific /usr/lib64, while runtime (that is common between |
96 |
-multilib ABIs) would be installed into /usr/lib. |
97 |
- |
98 |
-Bug: https://llvm.org/bugs/show_bug.cgi?id=23792 |
99 |
-Patch: https://reviews.llvm.org/D23752 |
100 |
---- |
101 |
- CMakeLists.txt | 5 +++-- |
102 |
- lib/Headers/CMakeLists.txt | 4 ++-- |
103 |
- runtime/CMakeLists.txt | 4 ++-- |
104 |
- 3 files changed, 7 insertions(+), 6 deletions(-) |
105 |
- |
106 |
-diff --git a/CMakeLists.txt b/CMakeLists.txt |
107 |
-index e95ab52..67b85b5 100644 |
108 |
---- a/CMakeLists.txt |
109 |
-+++ b/CMakeLists.txt |
110 |
-@@ -235,8 +235,9 @@ endif() |
111 |
- set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING |
112 |
- "Vendor-specific uti.") |
113 |
- |
114 |
--# The libdir suffix must exactly match whatever LLVM's configuration used. |
115 |
--set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}") |
116 |
-+set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE |
117 |
-+ STRING "Define suffix of library directory name for clang runtime (32/64)") |
118 |
-+set(CLANG_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${CLANG_LIBDIR_SUFFIX}) |
119 |
- |
120 |
- set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) |
121 |
- set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) |
122 |
-diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt |
123 |
-index 600fece..86a70c5 100644 |
124 |
---- a/lib/Headers/CMakeLists.txt |
125 |
-+++ b/lib/Headers/CMakeLists.txt |
126 |
-@@ -88,7 +88,7 @@ set(files |
127 |
- xtestintrin.h |
128 |
- ) |
129 |
- |
130 |
--set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include) |
131 |
-+set(output_dir ${CLANG_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include) |
132 |
- |
133 |
- # Generate arm_neon.h |
134 |
- clang_tablegen(arm_neon.h -gen-arm-neon |
135 |
-@@ -118,7 +118,7 @@ install( |
136 |
- FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h |
137 |
- COMPONENT clang-headers |
138 |
- PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ |
139 |
-- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |
140 |
-+ DESTINATION lib${CLANG_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include) |
141 |
- |
142 |
- if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's. |
143 |
- add_custom_target(install-clang-headers |
144 |
-diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt |
145 |
-index 814857f..9348615 100644 |
146 |
---- a/runtime/CMakeLists.txt |
147 |
-+++ b/runtime/CMakeLists.txt |
148 |
-@@ -71,9 +71,9 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/) |
149 |
- -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} |
150 |
- -DLLVM_CONFIG_PATH=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-config |
151 |
- -DLLVM_LIT_ARGS=${LLVM_LIT_ARGS} |
152 |
-- -DCOMPILER_RT_OUTPUT_DIR=${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION} |
153 |
-+ -DCOMPILER_RT_OUTPUT_DIR=${CLANG_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION} |
154 |
- -DCOMPILER_RT_EXEC_OUTPUT_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR} |
155 |
-- -DCOMPILER_RT_INSTALL_PATH:STRING=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION} |
156 |
-+ -DCOMPILER_RT_INSTALL_PATH:STRING=lib${CLANG_LIBDIR_SUFFIX}/clang/${CLANG_VERSION} |
157 |
- -DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} |
158 |
- -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} |
159 |
- -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} |
160 |
--- |
161 |
-2.9.3 |
162 |
- |