1 |
commit: ec4b14a0bf47f438ea97d0e601935992ab23b4df |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 30 08:02:05 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 15 12:47:16 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec4b14a0 |
7 |
|
8 |
sys-libs/compiler-rt: Add slotted version |
9 |
|
10 |
Introduce a slotted variant of compiler-rt libraries with the slot |
11 |
matching the clang version. This will make it possible to install a new |
12 |
compiler-rt version before upgrading clang to the corresponding version, |
13 |
therefore preserving a working compiler through (even minor) clang |
14 |
upgrades. |
15 |
|
16 |
The alternative was to replace the complete version number with the |
17 |
major version in the runtime directory path. However, software (e.g. |
18 |
Mesa) hardcodes the default path and therefore breaks when it is |
19 |
changed. |
20 |
|
21 |
..._rc1.ebuild => compiler-rt-4.0.0_rc1-r1.ebuild} | 36 ++++++++-------------- |
22 |
sys-libs/compiler-rt/compiler-rt-9999.ebuild | 36 ++++++++-------------- |
23 |
2 files changed, 26 insertions(+), 46 deletions(-) |
24 |
|
25 |
diff --git a/sys-libs/compiler-rt/compiler-rt-4.0.0_rc1.ebuild b/sys-libs/compiler-rt/compiler-rt-4.0.0_rc1-r1.ebuild |
26 |
similarity index 76% |
27 |
rename from sys-libs/compiler-rt/compiler-rt-4.0.0_rc1.ebuild |
28 |
rename to sys-libs/compiler-rt/compiler-rt-4.0.0_rc1-r1.ebuild |
29 |
index 49f12b097e..43560c2edd 100644 |
30 |
--- a/sys-libs/compiler-rt/compiler-rt-4.0.0_rc1.ebuild |
31 |
+++ b/sys-libs/compiler-rt/compiler-rt-4.0.0_rc1-r1.ebuild |
32 |
@@ -17,16 +17,16 @@ HOMEPAGE="http://llvm.org/" |
33 |
SRC_URI="http://www.llvm.org/pre-releases/${PV/_//}/${P/_/}.src.tar.xz" |
34 |
|
35 |
LICENSE="|| ( UoI-NCSA MIT )" |
36 |
-SLOT="0/${PV%.*}" |
37 |
+SLOT="${PV%_*}" |
38 |
KEYWORDS="~amd64 ~arm64 ~x86" |
39 |
IUSE="test" |
40 |
|
41 |
-RDEPEND=" |
42 |
- !<sys-devel/llvm-4" |
43 |
+LLVM_SLOT=${SLOT%%.*} |
44 |
+RDEPEND="!=sys-libs/compiler-rt-${SLOT}*:0" |
45 |
# llvm-4 needed for --cmakedir |
46 |
-DEPEND="${RDEPEND} |
47 |
+DEPEND=" |
48 |
>=sys-devel/llvm-4 |
49 |
- test? ( ~sys-devel/clang-${PV} ) |
50 |
+ test? ( =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} ) |
51 |
${PYTHON_DEPS}" |
52 |
|
53 |
S=${WORKDIR}/${P/_/}.src |
54 |
@@ -51,14 +51,11 @@ src_configure() { |
55 |
fi |
56 |
fi |
57 |
|
58 |
- local llvm_version=$(llvm-config --version) || die |
59 |
- local clang_version=$(get_version_component_range 1-3 "${llvm_version}") |
60 |
- local libdir=$(get_libdir) |
61 |
local mycmakeargs=( |
62 |
- -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${clang_version}" |
63 |
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" |
64 |
# use a build dir structure consistent with install |
65 |
# this makes it possible to easily deploy test-friendly clang |
66 |
- -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${clang_version}" |
67 |
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}" |
68 |
|
69 |
# currently lit covers only sanitizer tests |
70 |
-DCOMPILER_RT_INCLUDE_TESTS=OFF |
71 |
@@ -69,22 +66,15 @@ src_configure() { |
72 |
cmake-utils_src_configure |
73 |
} |
74 |
|
75 |
-run_tests_for_abi() { |
76 |
- local ABI=${1} |
77 |
-} |
78 |
- |
79 |
src_test() { |
80 |
# prepare a test compiler |
81 |
- local llvm_version=$(llvm-config --version) || die |
82 |
- local clang_version=$(get_version_component_range 1-3 "${llvm_version}") |
83 |
- |
84 |
# copy clang over since resource_dir is located relatively to binary |
85 |
# therefore, we can put our new libraries in it |
86 |
- mkdir -p "${BUILD_DIR}"/{bin,$(get_libdir),lib/clang/"${clang_version}"/include} || die |
87 |
- cp "${EPREFIX}/usr/bin/clang" "${EPREFIX}/usr/bin/clang++" \ |
88 |
- "${BUILD_DIR}"/bin/ || die |
89 |
- cp "${EPREFIX}/usr/lib/clang/${clang_version}/include"/*.h \ |
90 |
- "${BUILD_DIR}/lib/clang/${clang_version}/include/" || die |
91 |
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}{/bin,$(get_libdir)},clang/${SLOT}/include} || die |
92 |
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \ |
93 |
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die |
94 |
+ cp "${EPREFIX}/usr/lib/clang/${SLOT}/include"/*.h \ |
95 |
+ "${BUILD_DIR}/lib/clang/${SLOT}/include/" || die |
96 |
|
97 |
# builtins are not converted to lit yet, so run them manually |
98 |
local tests=() f |
99 |
@@ -120,7 +110,7 @@ src_test() { |
100 |
einfo "Running tests for ABI=${ABI}" |
101 |
# use -k to run all tests even if some fail |
102 |
emake -k \ |
103 |
- CC="${BUILD_DIR}/bin/clang" \ |
104 |
+ CC="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang" \ |
105 |
CFLAGS="$(get_abi_CFLAGS)" \ |
106 |
CPPFLAGS='-I../../../lib/builtins' \ |
107 |
LDFLAGS='-rtlib=compiler-rt' \ |
108 |
|
109 |
diff --git a/sys-libs/compiler-rt/compiler-rt-9999.ebuild b/sys-libs/compiler-rt/compiler-rt-9999.ebuild |
110 |
index 4f6d080ee4..450177ae5c 100644 |
111 |
--- a/sys-libs/compiler-rt/compiler-rt-9999.ebuild |
112 |
+++ b/sys-libs/compiler-rt/compiler-rt-9999.ebuild |
113 |
@@ -19,16 +19,16 @@ EGIT_REPO_URI="http://llvm.org/git/compiler-rt.git |
114 |
https://github.com/llvm-mirror/compiler-rt.git" |
115 |
|
116 |
LICENSE="|| ( UoI-NCSA MIT )" |
117 |
-SLOT="0/${PV%.*}" |
118 |
+# Note: this needs to be updated to match version of clang-9999 |
119 |
+SLOT="5.0.0" |
120 |
KEYWORDS="" |
121 |
IUSE="test" |
122 |
|
123 |
-RDEPEND=" |
124 |
- !<sys-devel/llvm-4" |
125 |
+LLVM_SLOT=${SLOT%%.*} |
126 |
# llvm-4 needed for --cmakedir |
127 |
-DEPEND="${RDEPEND} |
128 |
+DEPEND=" |
129 |
>=sys-devel/llvm-4 |
130 |
- test? ( ~sys-devel/clang-${PV} ) |
131 |
+ test? ( =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} ) |
132 |
${PYTHON_DEPS}" |
133 |
|
134 |
# least intrusive of all |
135 |
@@ -51,14 +51,11 @@ src_configure() { |
136 |
fi |
137 |
fi |
138 |
|
139 |
- local llvm_version=$(llvm-config --version) || die |
140 |
- local clang_version=$(get_version_component_range 1-3 "${llvm_version}") |
141 |
- local libdir=$(get_libdir) |
142 |
local mycmakeargs=( |
143 |
- -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${clang_version}" |
144 |
+ -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" |
145 |
# use a build dir structure consistent with install |
146 |
# this makes it possible to easily deploy test-friendly clang |
147 |
- -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${clang_version}" |
148 |
+ -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}" |
149 |
|
150 |
# currently lit covers only sanitizer tests |
151 |
-DCOMPILER_RT_INCLUDE_TESTS=OFF |
152 |
@@ -69,22 +66,15 @@ src_configure() { |
153 |
cmake-utils_src_configure |
154 |
} |
155 |
|
156 |
-run_tests_for_abi() { |
157 |
- local ABI=${1} |
158 |
-} |
159 |
- |
160 |
src_test() { |
161 |
# prepare a test compiler |
162 |
- local llvm_version=$(llvm-config --version) || die |
163 |
- local clang_version=$(get_version_component_range 1-3 "${llvm_version}") |
164 |
- |
165 |
# copy clang over since resource_dir is located relatively to binary |
166 |
# therefore, we can put our new libraries in it |
167 |
- mkdir -p "${BUILD_DIR}"/{bin,$(get_libdir),lib/clang/"${clang_version}"/include} || die |
168 |
- cp "${EPREFIX}/usr/bin/clang" "${EPREFIX}/usr/bin/clang++" \ |
169 |
- "${BUILD_DIR}"/bin/ || die |
170 |
- cp "${EPREFIX}/usr/lib/clang/${clang_version}/include"/*.h \ |
171 |
- "${BUILD_DIR}/lib/clang/${clang_version}/include/" || die |
172 |
+ mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}{/bin,$(get_libdir)},clang/${SLOT}/include} || die |
173 |
+ cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \ |
174 |
+ "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die |
175 |
+ cp "${EPREFIX}/usr/lib/clang/${SLOT}/include"/*.h \ |
176 |
+ "${BUILD_DIR}/lib/clang/${SLOT}/include/" || die |
177 |
|
178 |
# builtins are not converted to lit yet, so run them manually |
179 |
local tests=() f |
180 |
@@ -120,7 +110,7 @@ src_test() { |
181 |
einfo "Running tests for ABI=${ABI}" |
182 |
# use -k to run all tests even if some fail |
183 |
emake -k \ |
184 |
- CC="${BUILD_DIR}/bin/clang" \ |
185 |
+ CC="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang" \ |
186 |
CFLAGS="$(get_abi_CFLAGS)" \ |
187 |
CPPFLAGS='-I../../../lib/builtins' \ |
188 |
LDFLAGS='-rtlib=compiler-rt' \ |