Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/, sys-devel/llvm/files/9999/, sys-devel/llvm/files/cmake/
Date: Mon, 22 Aug 2016 15:12:08
Message-Id: 1471878706.feeb9f07adda22b56a732141522cc3ad57820aeb.mgorny@gentoo
1 commit: feeb9f07adda22b56a732141522cc3ad57820aeb
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 20 21:22:58 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 22 15:11:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=feeb9f07
7
8 sys-devel/llvm: Strip external projects off the live ebuild
9
10 ...ystem-llvm-lit-when-lit.py-does-not-exist.patch | 33 +++
11 ...y-Install-as-llvm-lit-as-cmake-expects-it.patch | 30 +++
12 ...ll-compiler-rt-into-usr-lib-without-suffi.patch | 26 --
13 sys-devel/llvm/llvm-9999.ebuild | 299 +++------------------
14 4 files changed, 93 insertions(+), 295 deletions(-)
15
16 diff --git a/sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch b/sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch
17 new file mode 100644
18 index 0000000..7245af0
19 --- /dev/null
20 +++ b/sys-devel/llvm/files/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch
21 @@ -0,0 +1,33 @@
22 +From bcdf2c49b7686046f8a9a5664f0e46117997baf4 Mon Sep 17 00:00:00 2001
23 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
24 +Date: Sun, 21 Aug 2016 23:19:40 +0200
25 +Subject: [PATCH 09/10] cmake: Use system llvm-lit when lit.py does not exist
26 + in srcdir
27 +
28 +Modify the add_lit_target function to use lit.py from LLVM_MAIN_SRC_DIR
29 +only when one does exist there, and otherwise fall back to looking for
30 +system install of llvm-lit. This is based on a similar conditional in
31 +clang's CMakeLists.txt, and makes it possible to run clang's tests when
32 +built separately from LLVM with no access to the original sources.
33 +
34 +Patch: https://reviews.llvm.org/D23742
35 +---
36 + cmake/modules/AddLLVM.cmake | 2 +-
37 + 1 file changed, 1 insertion(+), 1 deletion(-)
38 +
39 +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
40 +index 83a2359..87540d5 100644
41 +--- a/cmake/modules/AddLLVM.cmake
42 ++++ b/cmake/modules/AddLLVM.cmake
43 +@@ -1081,7 +1081,7 @@ function(add_lit_target target comment)
44 + if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
45 + list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR})
46 + endif ()
47 +- if (LLVM_MAIN_SRC_DIR)
48 ++ if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
49 + set (LIT_COMMAND ${PYTHON_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
50 + else()
51 + find_program(LIT_COMMAND llvm-lit)
52 +--
53 +2.9.3
54 +
55
56 diff --git a/sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch b/sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch
57 new file mode 100644
58 index 0000000..53726aa
59 --- /dev/null
60 +++ b/sys-devel/llvm/files/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch
61 @@ -0,0 +1,30 @@
62 +From 242fd2cbad1075d4cc0e3a3b64652dbc766bd117 Mon Sep 17 00:00:00 2001
63 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
64 +Date: Sun, 21 Aug 2016 23:20:11 +0200
65 +Subject: [PATCH 10/10] lit/setup.py: Install as llvm-lit (as cmake expects it)
66 +
67 +Modify the setup.py for lit to install the entry point as llvm-lit
68 +(instead of lit) since this is the name expected by functions in
69 +AddLLVM.cmake.
70 +
71 +Patch: https://reviews.llvm.org/D23743
72 +---
73 + utils/lit/setup.py | 2 +-
74 + 1 file changed, 1 insertion(+), 1 deletion(-)
75 +
76 +diff --git a/utils/lit/setup.py b/utils/lit/setup.py
77 +index 10de6bb..c57e0aa 100644
78 +--- a/utils/lit/setup.py
79 ++++ b/utils/lit/setup.py
80 +@@ -71,7 +71,7 @@ http://llvm.org/svn/llvm-project/llvm/trunk/utils/lit.
81 + packages = find_packages(),
82 + entry_points = {
83 + 'console_scripts': [
84 +- 'lit = lit:main',
85 ++ 'llvm-lit = lit:main',
86 + ],
87 + }
88 + )
89 +--
90 +2.9.3
91 +
92
93 diff --git a/sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch b/sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
94 deleted file mode 100644
95 index a09de90..0000000
96 --- a/sys-devel/llvm/files/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
97 +++ /dev/null
98 @@ -1,26 +0,0 @@
99 -From 380b8faadc3fc66f9aa0528bd3578464b317c31e Mon Sep 17 00:00:00 2001
100 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
101 -Date: Thu, 12 May 2016 08:25:48 +0200
102 -Subject: [PATCH] cmake: Install compiler-rt to a directory without libdir
103 - suffix
104 -
105 ----
106 - cmake/base-config-ix.cmake | 2 +-
107 - 1 file changed, 1 insertion(+), 1 deletion(-)
108 -
109 -diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
110 -index 5d0502c..ce16ce9 100644
111 ---- a/projects/compiler-rt/cmake/base-config-ix.cmake
112 -+++ b/projects/compiler-rt/cmake/base-config-ix.cmake
113 -@@ -18,7 +18,7 @@ if (NOT COMPILER_RT_STANDALONE_BUILD)
114 - # Setup the paths where compiler-rt runtimes and headers should be stored.
115 - set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
116 - set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
117 -- set(COMPILER_RT_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
118 -+ set(COMPILER_RT_INSTALL_PATH lib/clang/${CLANG_VERSION})
119 - option(COMPILER_RT_INCLUDE_TESTS "Generate and build compiler-rt unit tests."
120 - ${LLVM_INCLUDE_TESTS})
121 - option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
122 ---
123 -2.8.2
124 -
125
126 diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild
127 index c8a34ba..556bf07 100644
128 --- a/sys-devel/llvm/llvm-9999.ebuild
129 +++ b/sys-devel/llvm/llvm-9999.ebuild
130 @@ -6,10 +6,11 @@ EAPI=6
131
132 : ${CMAKE_MAKEFILE_GENERATOR:=ninja}
133 CMAKE_MIN_VERSION=3.4.3
134 +DISTUTILS_OPTIONAL=1
135 PYTHON_COMPAT=( python2_7 )
136
137 -inherit check-reqs cmake-utils eutils flag-o-matic git-r3 multilib \
138 - multilib-minimal python-single-r1 toolchain-funcs pax-utils
139 +inherit check-reqs cmake-utils distutils-r1 flag-o-matic git-r3 \
140 + multilib-minimal pax-utils toolchain-funcs
141
142 DESCRIPTION="Low Level Virtual Machine"
143 HOMEPAGE="http://llvm.org/"
144 @@ -20,17 +21,12 @@ EGIT_REPO_URI="http://llvm.org/git/llvm.git
145 LICENSE="UoI-NCSA"
146 SLOT="0/${PV%.*}"
147 KEYWORDS=""
148 -IUSE="clang debug default-compiler-rt default-libcxx +doc gold libedit +libffi
149 - lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml
150 - video_cards_radeon elibc_musl kernel_Darwin kernel_FreeBSD"
151 +IUSE="debug +doc gold libedit +libffi multitarget ncurses ocaml test
152 + video_cards_radeon elibc_musl kernel_Darwin"
153
154 -COMMON_DEPEND="
155 +# python is needed for llvm-lit (which is installed)
156 +RDEPEND="
157 sys-libs/zlib:0=
158 - clang? (
159 - static-analyzer? ( dev-lang/perl:* )
160 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
161 - ${PYTHON_DEPS}
162 - )
163 gold? ( >=sys-devel/binutils-2.22:*[cxx] )
164 libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
165 libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
166 @@ -38,51 +34,31 @@ COMMON_DEPEND="
167 ocaml? (
168 >=dev-lang/ocaml-4.00.0:0=
169 dev-ml/findlib
170 - dev-ml/ocaml-ctypes )"
171 + dev-ml/ocaml-ctypes )
172 + ${PYTHON_DEPS}"
173 # configparser-3.2 breaks the build (3.3 or none at all are fine)
174 -DEPEND="${COMMON_DEPEND}
175 +DEPEND="${RDEPEND}
176 dev-lang/perl
177 - >=sys-devel/make-3.81
178 - >=sys-devel/flex-2.5.4
179 - >=sys-devel/bison-1.875d
180 || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
181 ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
182 )
183 || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
184 kernel_Darwin? ( <sys-libs/libcxx-${PV%_rc*}.9999 )
185 - clang? ( xml? ( virtual/pkgconfig ) )
186 doc? ( dev-python/sphinx )
187 gold? ( sys-libs/binutils-libs )
188 libffi? ( virtual/pkgconfig )
189 - lldb? ( dev-lang/swig )
190 - !!<dev-python/configparser-3.3.0.2
191 ocaml? ( test? ( dev-ml/ounit ) )
192 - ${PYTHON_DEPS}"
193 -RDEPEND="${COMMON_DEPEND}
194 - clang? ( !<=sys-devel/clang-${PV}-r99 )
195 - default-libcxx? ( sys-libs/libcxx )
196 - abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
197 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
198 -PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
199 -
200 -# pypy gives me around 1700 unresolved tests due to open file limit
201 -# being exceeded. probably GC does not close them fast enough.
202 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
203 - lldb? ( clang xml )"
204 + !!<dev-python/configparser-3.3.0.2"
205 +
206 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
207
208 pkg_pretend() {
209 # in megs
210 - # !clang !debug !multitarget -O2 400
211 - # !clang !debug multitarget -O2 550
212 - # clang !debug !multitarget -O2 950
213 - # clang !debug multitarget -O2 1200
214 - # !clang debug multitarget -O2 5G
215 - # clang !debug multitarget -O0 -g 12G
216 - # clang debug multitarget -O2 16G
217 - # clang debug multitarget -O0 -g 14G
218 + # !debug !multitarget -O2 400
219 + # !debug multitarget -O2 550
220 + # debug multitarget -O2 5G
221
222 local build_size=550
223 - use clang && build_size=1200
224
225 if use debug; then
226 ewarn "USE=debug is known to increase the size of package considerably"
227 @@ -108,41 +84,10 @@ pkg_pretend() {
228
229 pkg_setup() {
230 pkg_pretend
231 -
232 - python-single-r1_pkg_setup
233 -}
234 -
235 -src_unpack() {
236 - if use clang; then
237 - git-r3_fetch "http://llvm.org/git/compiler-rt.git
238 - https://github.com/llvm-mirror/compiler-rt.git"
239 - git-r3_fetch "http://llvm.org/git/clang.git
240 - https://github.com/llvm-mirror/clang.git"
241 - git-r3_fetch "http://llvm.org/git/clang-tools-extra.git
242 - https://github.com/llvm-mirror/clang-tools-extra.git"
243 - fi
244 - if use lldb; then
245 - git-r3_fetch "http://llvm.org/git/lldb.git
246 - https://github.com/llvm-mirror/lldb.git"
247 - fi
248 - git-r3_fetch
249 -
250 - if use clang; then
251 - git-r3_checkout http://llvm.org/git/compiler-rt.git \
252 - "${S}"/projects/compiler-rt
253 - git-r3_checkout http://llvm.org/git/clang.git \
254 - "${S}"/tools/clang
255 - git-r3_checkout http://llvm.org/git/clang-tools-extra.git \
256 - "${S}"/tools/clang/tools/extra
257 - fi
258 - if use lldb; then
259 - git-r3_checkout http://llvm.org/git/lldb.git \
260 - "${S}"/tools/lldb
261 - fi
262 - git-r3_checkout
263 }
264
265 src_prepare() {
266 + # Python is needed to run tests using lit
267 python_setup
268
269 # Make ocaml warnings non-fatal, bug #537308
270 @@ -175,39 +120,17 @@ src_prepare() {
271 # https://bugs.gentoo.org/show_bug.cgi?id=578392
272 eapply "${FILESDIR}"/llvm-3.8-soversion.patch
273
274 + # Fix lit tests to find installed llvm-lit correctly
275 + eapply "${FILESDIR}"/9999/0009-cmake-Use-system-llvm-lit-when-lit.py-does-not-exist.patch
276 + # Install lit as llvm-lit (as expected by cmake)
277 + eapply "${FILESDIR}"/9999/0010-lit-setup.py-Install-as-llvm-lit-as-cmake-expects-it.patch
278 +
279 # support building llvm against musl-libc
280 use elibc_musl && eapply "${FILESDIR}"/llvm-3.8-musl-fixes.patch
281
282 # disable use of SDK on OSX, bug #568758
283 sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
284
285 - if use clang; then
286 - # Automatically select active system GCC's libraries, bugs #406163 and #417913
287 - eapply "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
288 -
289 - # Install clang runtime into /usr/lib/clang
290 - # https://llvm.org/bugs/show_bug.cgi?id=23792
291 - eapply "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix-3.8.patch
292 - eapply "${FILESDIR}"/cmake/compiler-rt-3.9-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
293 -
294 - # Make it possible to override CLANG_LIBDIR_SUFFIX
295 - # (that is used only to find LLVMgold.so)
296 - # https://llvm.org/bugs/show_bug.cgi?id=23793
297 - eapply "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
298 -
299 - # Fix WX sections, bug #421527
300 - find projects/compiler-rt/lib/builtins -type f -name '*.S' -exec sed \
301 - -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
302 - -i {} + || die
303 - fi
304 -
305 - if use lldb; then
306 - # Do not install dummy readline.so module from
307 - # https://llvm.org/bugs/show_bug.cgi?id=18841
308 - sed -e 's/add_subdirectory(readline)/#&/' \
309 - -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
310 - fi
311 -
312 # User patches
313 eapply_user
314
315 @@ -235,7 +158,6 @@ multilib_src_configure() {
316 -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
317
318 -DBUILD_SHARED_LIBS=ON
319 - -DLLVM_ENABLE_TIMESTAMPS=OFF
320 -DLLVM_TARGETS_TO_BUILD="${targets}"
321 -DLLVM_BUILD_TESTS=$(usex test)
322
323 @@ -255,31 +177,6 @@ multilib_src_configure() {
324 -DHAVE_HISTEDIT_H=$(usex libedit)
325 )
326
327 - if use clang; then
328 - mycmakeargs+=(
329 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
330 - # libgomp support fails to find headers without explicit -I
331 - # furthermore, it provides only syntax checking
332 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
333 -
334 - # override default stdlib and rtlib
335 - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
336 - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
337 -
338 - # compiler-rt's test cases depend on sanitizer
339 - -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
340 - -DCOMPILER_RT_INCLUDE_TESTS=$(usex sanitize)
341 - )
342 - fi
343 -
344 - if use lldb; then
345 - mycmakeargs+=(
346 - -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
347 - -DLLDB_DISABLE_CURSES=$(usex !ncurses)
348 - -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
349 - )
350 - fi
351 -
352 if ! multilib_is_native_abi || ! use ocaml; then
353 mycmakeargs+=(
354 -DOCAMLFIND=NO
355 @@ -303,56 +200,11 @@ multilib_src_configure() {
356 -DLLVM_INSTALL_UTILS=ON
357 )
358
359 - if use clang; then
360 - mycmakeargs+=(
361 - -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
362 - )
363 - fi
364 -
365 if use gold; then
366 mycmakeargs+=(
367 -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
368 )
369 fi
370 -
371 - if use lldb; then
372 - mycmakeargs+=(
373 - -DLLDB_DISABLE_PYTHON=$(usex !python)
374 - )
375 - fi
376 -
377 - else
378 - if use clang; then
379 - mycmakeargs+=(
380 - # disable compiler-rt on non-native ABI because:
381 - # 1. it fails to configure because of -m32
382 - # 2. it is shared between ABIs so no point building
383 - # it multiple times
384 - -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
385 - -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
386 - )
387 - fi
388 - if use lldb; then
389 - mycmakeargs+=(
390 - # only run swig on native abi
391 - -DLLDB_DISABLE_PYTHON=ON
392 - )
393 - fi
394 - fi
395 -
396 - if use clang; then
397 - mycmakeargs+=(
398 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
399 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
400 - -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
401 - )
402 -
403 - # -- not needed when compiler-rt is built with host compiler --
404 - # cmake passes host C*FLAGS to compiler-rt build
405 - # which is performed using clang, so we need to filter out
406 - # some flags clang does not support
407 - # (if you know some more flags that don't work, let us know)
408 - #filter-flags -msahf -frecord-gcc-switches
409 fi
410
411 if tc-is-cross-compiler; then
412 @@ -362,14 +214,6 @@ multilib_src_configure() {
413 -DCMAKE_CROSSCOMPILING=ON
414 -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
415 )
416 -
417 - if use clang; then
418 - [[ -x "/usr/bin/clang-tblgen" ]] \
419 - || die "/usr/bin/clang-tblgen not found or usable"
420 - mycmakeargs+=(
421 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
422 - )
423 - fi
424 fi
425
426 cmake-utils_src_configure
427 @@ -389,15 +233,16 @@ multilib_src_compile() {
428 pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
429 pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
430 fi
431 +
432 + # Run setup.py for lit
433 + cd "${S}"/utils/lit || die
434 + distutils-r1_src_compile
435 }
436
437 multilib_src_test() {
438 # respect TMPDIR!
439 local -x LIT_PRESERVES_TMP=1
440 - local test_targets=( check )
441 - # clang tests won't work on non-native ABI because we skip compiler-rt
442 - multilib_is_native_abi && use clang && test_targets+=( check-clang )
443 - cmake-utils_src_make "${test_targets[@]}"
444 + cmake-utils_src_make check
445 }
446
447 src_install() {
448 @@ -406,34 +251,14 @@ src_install() {
449 )
450
451 local MULTILIB_WRAPPED_HEADERS=(
452 - /usr/include/llvm/Config/config.h
453 /usr/include/llvm/Config/llvm-config.h
454 )
455
456 - if use clang; then
457 - # note: magic applied in multilib_src_install()!
458 - CLANG_VERSION=4.0
459 -
460 - MULTILIB_CHOST_TOOLS+=(
461 - /usr/bin/clang
462 - /usr/bin/clang++
463 - /usr/bin/clang-cl
464 - /usr/bin/clang-${CLANG_VERSION}
465 - /usr/bin/clang++-${CLANG_VERSION}
466 - /usr/bin/clang-cl-${CLANG_VERSION}
467 - )
468 -
469 - MULTILIB_WRAPPED_HEADERS+=(
470 - /usr/include/clang/Config/config.h
471 - )
472 - fi
473 -
474 multilib-minimal_src_install
475
476 - # Remove unnecessary headers on FreeBSD, bug #417171
477 - if use kernel_FreeBSD && use clang; then
478 - rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
479 - fi
480 + # Install lit
481 + cd "${S}"/utils/lit || die
482 + distutils-r1_src_install
483 }
484
485 multilib_src_install() {
486 @@ -450,41 +275,6 @@ multilib_src_install() {
487 "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
488 fi
489 fi
490 -
491 - # apply CHOST and CLANG_VERSION to clang executables
492 - # they're statically linked so we don't have to worry about the lib
493 - if use clang; then
494 - local clang_tools=( clang clang++ clang-cl )
495 - local i
496 -
497 - # cmake gives us:
498 - # - clang-X.Y
499 - # - clang -> clang-X.Y
500 - # - clang++, clang-cl -> clang
501 - # we want to have:
502 - # - clang-X.Y
503 - # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
504 - # - clang, clang++, clang-cl -> clang*-X.Y
505 - # so we need to fix the two tools
506 - for i in "${clang_tools[@]:1}"; do
507 - rm "${ED%/}/usr/bin/${i}" || die
508 - dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
509 - dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
510 - done
511 -
512 - # now prepend ${CHOST} and let the multilib-build.eclass symlink it
513 - if ! multilib_is_native_abi; then
514 - # non-native? let's replace it with a simple wrapper
515 - for i in "${clang_tools[@]}"; do
516 - rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
517 - cat > "${T}"/wrapper.tmp <<-_EOF_
518 - #!${EPREFIX}/bin/sh
519 - exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
520 - _EOF_
521 - newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
522 - done
523 - fi
524 - fi
525 }
526
527 multilib_src_install_all() {
528 @@ -492,33 +282,4 @@ multilib_src_install_all() {
529 doins -r utils/vim/*/.
530 # some users may find it useful
531 dodoc utils/vim/vimrc
532 -
533 - if use clang; then
534 - pushd tools/clang >/dev/null || die
535 -
536 - if use python ; then
537 - pushd bindings/python/clang >/dev/null || die
538 -
539 - python_moduleinto clang
540 - python_domodule *.py
541 -
542 - popd >/dev/null || die
543 - fi
544 -
545 - # AddressSanitizer symbolizer (currently separate)
546 - dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
547 -
548 - popd >/dev/null || die
549 -
550 - python_fix_shebang "${ED}"
551 - if use static-analyzer; then
552 - python_optimize "${ED}"usr/share/scan-view
553 - fi
554 - fi
555 -}
556 -
557 -pkg_postinst() {
558 - if use clang && ! has_version 'sys-libs/libomp'; then
559 - elog "To enable OpenMP support in clang, install sys-libs/libomp."
560 - fi
561 }