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/
Date: Sat, 03 Jun 2017 08:28:06
Message-Id: 1496478462.6ee132a9a344ce2eef5d6f1f9714f486b2eed012.mgorny@gentoo
1 commit: 6ee132a9a344ce2eef5d6f1f9714f486b2eed012
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 24 16:38:53 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 3 08:27:42 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ee132a9
7
8 sys-devel/llvm: Drop old revisions
9
10 sys-devel/llvm/llvm-3.8.1.ebuild | 554 ---------------------------------------
11 sys-devel/llvm/llvm-3.9.1.ebuild | 544 --------------------------------------
12 2 files changed, 1098 deletions(-)
13
14 diff --git a/sys-devel/llvm/llvm-3.8.1.ebuild b/sys-devel/llvm/llvm-3.8.1.ebuild
15 deleted file mode 100644
16 index a32ead05993..00000000000
17 --- a/sys-devel/llvm/llvm-3.8.1.ebuild
18 +++ /dev/null
19 @@ -1,554 +0,0 @@
20 -# Copyright 1999-2017 Gentoo Foundation
21 -# Distributed under the terms of the GNU General Public License v2
22 -
23 -EAPI=6
24 -
25 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
26 -PYTHON_COMPAT=( python2_7 )
27 -
28 -inherit check-reqs cmake-utils eutils flag-o-matic multilib \
29 - multilib-minimal python-single-r1 toolchain-funcs pax-utils prefix
30 -
31 -DESCRIPTION="Low Level Virtual Machine"
32 -HOMEPAGE="http://llvm.org/"
33 -SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
34 - clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
35 - http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
36 - http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
37 - lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
38 - !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${PN}-3.8.0-manpages.tar.bz2 )"
39 -
40 -# Additional licenses:
41 -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
42 -# 2. ARM backend: LLVM Software Grant by ARM.
43 -# 3. MD5 code: public-domain.
44 -# 4. autoconf (not used): some undefined M.I.T. license.
45 -# 5. Tests (not installed):
46 -# a. gtest: BSD.
47 -# b. YAML tests: MIT.
48 -
49 -LICENSE="UoI-NCSA rc BSD public-domain
50 - arm? ( LLVM-Grant )
51 - arm64? ( LLVM-Grant )
52 - multitarget? ( LLVM-Grant )"
53 -SLOT="0/3.8.0"
54 -KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
55 -IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml
56 - python +static-analyzer test xml video_cards_radeon
57 - kernel_Darwin kernel_FreeBSD"
58 -
59 -COMMON_DEPEND="
60 - sys-libs/zlib:0=
61 - clang? (
62 - python? ( ${PYTHON_DEPS} )
63 - static-analyzer? (
64 - dev-lang/perl:*
65 - ${PYTHON_DEPS}
66 - )
67 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
68 - )
69 - gold? ( >=sys-devel/binutils-2.22:*[cxx] )
70 - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
71 - libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
72 - lldb? ( dev-python/six[${PYTHON_USEDEP}] )
73 - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
74 - ocaml? (
75 - >=dev-lang/ocaml-4.00.0:0=
76 - dev-ml/findlib
77 - dev-ml/ocaml-ctypes
78 - !!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
79 -# configparser-3.2 breaks the build (3.3 or none at all are fine)
80 -DEPEND="${COMMON_DEPEND}
81 - dev-lang/perl
82 - >=sys-devel/make-3.81
83 - >=sys-devel/flex-2.5.4
84 - >=sys-devel/bison-1.875d
85 - || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
86 - ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
87 - )
88 - || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
89 - clang? ( xml? ( virtual/pkgconfig ) )
90 - doc? ( dev-python/sphinx )
91 - gold? ( sys-libs/binutils-libs )
92 - libffi? ( virtual/pkgconfig )
93 - lldb? ( dev-lang/swig )
94 - !!<dev-python/configparser-3.3.0.2
95 - ocaml? ( test? ( dev-ml/ounit ) )
96 - ${PYTHON_DEPS}"
97 -RDEPEND="${COMMON_DEPEND}
98 - clang? ( !<=sys-devel/clang-${PV}-r99 )
99 - abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
100 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
101 -PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )
102 - kernel_Darwin? ( =sys-libs/libcxx-${PV%.*}* )"
103 -
104 -# pypy gives me around 1700 unresolved tests due to open file limit
105 -# being exceeded. probably GC does not close them fast enough.
106 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
107 - lldb? ( clang xml )"
108 -
109 -S=${WORKDIR}/${P/_}.src
110 -
111 -check_space() {
112 - # in megs
113 - # !clang !debug !multitarget -O2 400
114 - # !clang !debug multitarget -O2 550
115 - # clang !debug !multitarget -O2 950
116 - # clang !debug multitarget -O2 1200
117 - # !clang debug multitarget -O2 5G
118 - # clang !debug multitarget -O0 -g 12G
119 - # clang debug multitarget -O2 16G
120 - # clang debug multitarget -O0 -g 14G
121 -
122 - local build_size=550
123 - use clang && build_size=1200
124 -
125 - if use debug; then
126 - ewarn "USE=debug is known to increase the size of package considerably"
127 - ewarn "and cause the tests to fail."
128 - ewarn
129 -
130 - (( build_size *= 14 ))
131 - elif is-flagq '-g?(gdb)?([1-9])'; then
132 - ewarn "The C++ compiler -g option is known to increase the size of the package"
133 - ewarn "considerably. If you run out of space, please consider removing it."
134 - ewarn
135 -
136 - (( build_size *= 10 ))
137 - fi
138 -
139 - # Multiply by number of ABIs :).
140 - local abis=( $(multilib_get_enabled_abis) )
141 - (( build_size *= ${#abis[@]} ))
142 -
143 - local CHECKREQS_DISK_BUILD=${build_size}M
144 - check-reqs_pkg_pretend
145 -}
146 -
147 -pkg_pretend() {
148 - check_space
149 -}
150 -
151 -pkg_setup() {
152 - check_space
153 -}
154 -
155 -src_unpack() {
156 - default
157 -
158 - if use clang; then
159 - mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
160 - || die "clang source directory move failed"
161 - mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
162 - || die "compiler-rt source directory move failed"
163 - mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
164 - || die "clang-tools-extra source directory move failed"
165 - fi
166 -
167 - if use lldb; then
168 - mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
169 - || die "lldb source directory move failed"
170 - fi
171 -}
172 -
173 -src_prepare() {
174 - python_setup
175 -
176 - # Make ocaml warnings non-fatal, bug #537308
177 - sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
178 - # Fix libdir for ocaml bindings install, bug #559134
179 - eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
180 - # Do not build/install ocaml docs with USE=-doc, bug #562008
181 - eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
182 -
183 - # Make it possible to override Sphinx HTML install dirs
184 - # https://llvm.org/bugs/show_bug.cgi?id=23780
185 - eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
186 -
187 - # Prevent race conditions with parallel Sphinx runs
188 - # https://llvm.org/bugs/show_bug.cgi?id=23781
189 - eapply "${FILESDIR}"/3.8.1/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
190 -
191 - # Prevent installing libgtest
192 - # https://llvm.org/bugs/show_bug.cgi?id=18341
193 - eapply "${FILESDIR}"/3.8.1/0005-cmake-Do-not-install-libgtest.patch
194 -
195 - # Allow custom cmake build types (like 'Gentoo')
196 - eapply "${FILESDIR}"/3.9.1/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch
197 -
198 - # Fix llvm-config for shared linking and sane flags
199 - # https://bugs.gentoo.org/show_bug.cgi?id=565358
200 - eapply "${FILESDIR}"/3.8.1/llvm-config.patch
201 -
202 - # Restore SOVERSIONs for shared libraries
203 - # https://bugs.gentoo.org/show_bug.cgi?id=578392
204 - eapply "${FILESDIR}"/3.8.1/0008-cmake-Restore-SOVERSIONs-on-shared-libraries.patch
205 -
206 - # disable use of SDK on OSX, bug #568758
207 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
208 -
209 - # Workaround, can be compiled with gcc on Gentoo/FreeBSD, bug #578064
210 - use kernel_FreeBSD && tc-is-gcc && append-cppflags "-D_GLIBCXX_USE_C99"
211 -
212 - if use clang; then
213 - # Automatically select active system GCC's libraries, bugs #406163 and #417913
214 - eapply "${FILESDIR}"/3.9.0/clang/gentoo-runtime-gcc-detection-v3.patch
215 -
216 - # Support gcc4.9 search paths
217 - # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
218 - eapply "${FILESDIR}"/3.8.1/clang/gcc4.9-search-path.patch
219 -
220 - eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch
221 - eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
222 -
223 - eapply "${FILESDIR}"/3.8.1/compiler-rt/darwin-default-sysroot.patch
224 -
225 - sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
226 - tools/clang/tools/scan-build/bin/scan-build || die
227 -
228 - # Install clang runtime into /usr/lib/clang
229 - # https://llvm.org/bugs/show_bug.cgi?id=23792
230 - eapply "${FILESDIR}"/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
231 - eapply "${FILESDIR}"/3.8.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
232 -
233 - # Do not force -march flags on arm platforms
234 - # https://bugs.gentoo.org/show_bug.cgi?id=562706
235 - eapply "${FILESDIR}"/3.8.1/compiler-rt/arm_march_flags.patch
236 -
237 - # Make it possible to override CLANG_LIBDIR_SUFFIX
238 - # (that is used only to find LLVMgold.so)
239 - # https://llvm.org/bugs/show_bug.cgi?id=23793
240 - eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
241 -
242 - # Fix git-clang-format shebang, bug #562688
243 - python_fix_shebang tools/clang/tools/clang-format/git-clang-format
244 -
245 - # Fix 'stdarg.h' file not found on Gentoo/FreeBSD, bug #578064
246 - # https://llvm.org/bugs/show_bug.cgi?id=26651
247 - eapply "${FILESDIR}"/3.8.1/compiler-rt/fbsd.patch
248 -
249 - pushd projects/compiler-rt >/dev/null || die
250 -
251 - # Fix WX sections, bug #421527
252 - find lib/builtins -type f -name '*.S' -exec sed \
253 - -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
254 - -i {} + || die
255 -
256 - popd >/dev/null || die
257 - fi
258 -
259 - if use lldb; then
260 - # Do not install dummy readline.so module from
261 - # https://llvm.org/bugs/show_bug.cgi?id=18841
262 - sed -e 's/add_subdirectory(readline)/#&/' \
263 - -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
264 - # Do not install bundled six module
265 - eapply "${FILESDIR}"/3.9.1/lldb/six.patch
266 - fi
267 -
268 - # User patches
269 - eapply_user
270 -
271 - # Native libdir is used to hold LLVMgold.so
272 - NATIVE_LIBDIR=$(get_libdir)
273 -}
274 -
275 -multilib_src_configure() {
276 - local targets
277 - if use multitarget; then
278 - targets=all
279 - else
280 - targets='host;BPF;CppBackend'
281 - use video_cards_radeon && targets+=';AMDGPU'
282 - fi
283 -
284 - local ffi_cflags ffi_ldflags
285 - if use libffi; then
286 - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
287 - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
288 - fi
289 -
290 - local libdir=$(get_libdir)
291 - local mycmakeargs=(
292 - -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
293 -
294 - -DBUILD_SHARED_LIBS=ON
295 - -DLLVM_ENABLE_TIMESTAMPS=OFF
296 - -DLLVM_TARGETS_TO_BUILD="${targets}"
297 - -DLLVM_BUILD_TESTS=$(usex test)
298 -
299 - -DLLVM_ENABLE_FFI=$(usex libffi)
300 - -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
301 - -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
302 - -DLLVM_ENABLE_EH=ON
303 - -DLLVM_ENABLE_RTTI=ON
304 -
305 - -DWITH_POLLY=OFF # TODO
306 -
307 - -DLLVM_HOST_TRIPLE="${CHOST}"
308 -
309 - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
310 - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
311 -
312 - -DHAVE_HISTEDIT_H=$(usex libedit)
313 - )
314 -
315 - if use clang; then
316 - mycmakeargs+=(
317 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
318 - # libgomp support fails to find headers without explicit -I
319 - # furthermore, it provides only syntax checking
320 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
321 - )
322 - fi
323 -
324 - if use lldb; then
325 - mycmakeargs+=(
326 - -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
327 - -DLLDB_DISABLE_CURSES=$(usex !ncurses)
328 - -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
329 - )
330 - fi
331 -
332 - if ! multilib_is_native_abi || ! use ocaml; then
333 - mycmakeargs+=(
334 - -DOCAMLFIND=NO
335 - )
336 - fi
337 -# Note: go bindings have no CMake rules at the moment
338 -# but let's kill the check in case they are introduced
339 -# if ! multilib_is_native_abi || ! use go; then
340 - mycmakeargs+=(
341 - -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
342 - )
343 -# fi
344 -
345 - if multilib_is_native_abi; then
346 - mycmakeargs+=(
347 - -DLLVM_BUILD_DOCS=$(usex doc)
348 - -DLLVM_ENABLE_SPHINX=$(usex doc)
349 - -DLLVM_ENABLE_DOXYGEN=OFF
350 - -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
351 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
352 - -DLLVM_INSTALL_UTILS=ON
353 - )
354 -
355 - if use clang; then
356 - mycmakeargs+=(
357 - -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
358 - )
359 - fi
360 -
361 - if use gold; then
362 - mycmakeargs+=(
363 - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
364 - )
365 - fi
366 -
367 - if use lldb; then
368 - mycmakeargs+=(
369 - -DLLDB_DISABLE_PYTHON=$(usex !python)
370 - )
371 - fi
372 -
373 - else
374 - if use clang; then
375 - mycmakeargs+=(
376 - # disable compiler-rt on non-native ABI because:
377 - # 1. it fails to configure because of -m32
378 - # 2. it is shared between ABIs so no point building
379 - # it multiple times
380 - -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
381 - -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
382 - )
383 - fi
384 - if use lldb; then
385 - mycmakeargs+=(
386 - # only run swig on native abi
387 - -DLLDB_DISABLE_PYTHON=ON
388 - )
389 - fi
390 - fi
391 -
392 - if use clang; then
393 - mycmakeargs+=(
394 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
395 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
396 - -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
397 - )
398 -
399 - # -- not needed when compiler-rt is built with host compiler --
400 - # cmake passes host C*FLAGS to compiler-rt build
401 - # which is performed using clang, so we need to filter out
402 - # some flags clang does not support
403 - # (if you know some more flags that don't work, let us know)
404 - #filter-flags -msahf -frecord-gcc-switches
405 - fi
406 -
407 - if tc-is-cross-compiler; then
408 - [[ -x "/usr/bin/llvm-tblgen" ]] \
409 - || die "/usr/bin/llvm-tblgen not found or usable"
410 - mycmakeargs+=(
411 - -DCMAKE_CROSSCOMPILING=ON
412 - -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
413 - )
414 -
415 - if use clang; then
416 - [[ -x "/usr/bin/clang-tblgen" ]] \
417 - || die "/usr/bin/clang-tblgen not found or usable"
418 - mycmakeargs+=(
419 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
420 - )
421 - fi
422 - fi
423 -
424 - cmake-utils_src_configure
425 -}
426 -
427 -multilib_src_compile() {
428 - cmake-utils_src_compile
429 - # TODO: not sure why this target is not correctly called
430 - multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
431 -
432 - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
433 - pax-mark m "${BUILD_DIR}"/bin/lli
434 - pax-mark m "${BUILD_DIR}"/bin/lli-child-target
435 -
436 - if use test; then
437 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
438 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
439 - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
440 - fi
441 -}
442 -
443 -multilib_src_test() {
444 - # respect TMPDIR!
445 - local -x LIT_PRESERVES_TMP=1
446 - local test_targets=( check )
447 - # clang tests won't work on non-native ABI because we skip compiler-rt
448 - multilib_is_native_abi && use clang && test_targets+=( check-clang )
449 - cmake-utils_src_make "${test_targets[@]}"
450 -}
451 -
452 -src_install() {
453 - local MULTILIB_CHOST_TOOLS=(
454 - /usr/bin/llvm-config
455 - )
456 -
457 - local MULTILIB_WRAPPED_HEADERS=(
458 - /usr/include/llvm/Config/config.h
459 - /usr/include/llvm/Config/llvm-config.h
460 - )
461 -
462 - if use clang; then
463 - # note: magic applied in multilib_src_install()!
464 - CLANG_VERSION=${PV%.*}
465 -
466 - MULTILIB_CHOST_TOOLS+=(
467 - /usr/bin/clang
468 - /usr/bin/clang++
469 - /usr/bin/clang-cl
470 - /usr/bin/clang-${CLANG_VERSION}
471 - /usr/bin/clang++-${CLANG_VERSION}
472 - /usr/bin/clang-cl-${CLANG_VERSION}
473 - )
474 -
475 - MULTILIB_WRAPPED_HEADERS+=(
476 - /usr/include/clang/Config/config.h
477 - )
478 - fi
479 -
480 - multilib-minimal_src_install
481 -
482 - # Remove unnecessary headers on FreeBSD, bug #417171
483 - if use kernel_FreeBSD && use clang; then
484 - rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
485 - fi
486 -}
487 -
488 -multilib_src_install() {
489 - cmake-utils_src_install
490 -
491 - if multilib_is_native_abi; then
492 - # Install man pages.
493 - use doc || doman "${WORKDIR}"/${PN}-3.8.0-manpages/*.1
494 -
495 - # Symlink the gold plugin.
496 - if use gold; then
497 - dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
498 - dosym "../../../../$(get_libdir)/LLVMgold.so" \
499 - "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
500 - fi
501 - fi
502 -
503 - # apply CHOST and CLANG_VERSION to clang executables
504 - # they're statically linked so we don't have to worry about the lib
505 - if use clang; then
506 - local clang_tools=( clang clang++ clang-cl )
507 - local i
508 -
509 - # cmake gives us:
510 - # - clang-X.Y
511 - # - clang -> clang-X.Y
512 - # - clang++, clang-cl -> clang
513 - # we want to have:
514 - # - clang-X.Y
515 - # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
516 - # - clang, clang++, clang-cl -> clang*-X.Y
517 - # so we need to fix the two tools
518 - for i in "${clang_tools[@]:1}"; do
519 - rm "${ED%/}/usr/bin/${i}" || die
520 - dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
521 - dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
522 - done
523 -
524 - # now prepend ${CHOST} and let the multilib-build.eclass symlink it
525 - if ! multilib_is_native_abi; then
526 - # non-native? let's replace it with a simple wrapper
527 - for i in "${clang_tools[@]}"; do
528 - rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
529 - cat > "${T}"/wrapper.tmp <<-_EOF_
530 - #!${EPREFIX}/bin/sh
531 - exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
532 - _EOF_
533 - newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
534 - done
535 - fi
536 - fi
537 -}
538 -
539 -multilib_src_install_all() {
540 - insinto /usr/share/vim/vimfiles
541 - doins -r utils/vim/*/.
542 - # some users may find it useful
543 - dodoc utils/vim/vimrc
544 -
545 - if use clang; then
546 - pushd tools/clang >/dev/null || die
547 -
548 - if use python ; then
549 - pushd bindings/python/clang >/dev/null || die
550 -
551 - python_moduleinto clang
552 - python_domodule *.py
553 -
554 - popd >/dev/null || die
555 - fi
556 -
557 - # AddressSanitizer symbolizer (currently separate)
558 - dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
559 -
560 - popd >/dev/null || die
561 -
562 - python_fix_shebang "${ED}"
563 - if use static-analyzer; then
564 - python_optimize "${ED}"usr/share/scan-view
565 - fi
566 - fi
567 -}
568 -
569 -pkg_postinst() {
570 - if use clang && ! has_version 'sys-libs/libomp'; then
571 - elog "To enable OpenMP support in clang, install sys-libs/libomp."
572 - fi
573 -}
574
575 diff --git a/sys-devel/llvm/llvm-3.9.1.ebuild b/sys-devel/llvm/llvm-3.9.1.ebuild
576 deleted file mode 100644
577 index 6919e9857ce..00000000000
578 --- a/sys-devel/llvm/llvm-3.9.1.ebuild
579 +++ /dev/null
580 @@ -1,544 +0,0 @@
581 -# Copyright 1999-2017 Gentoo Foundation
582 -# Distributed under the terms of the GNU General Public License v2
583 -
584 -EAPI=6
585 -
586 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
587 -PYTHON_COMPAT=( python2_7 )
588 -
589 -inherit check-reqs cmake-utils eutils flag-o-matic multilib \
590 - multilib-minimal python-single-r1 toolchain-funcs pax-utils prefix
591 -
592 -DESCRIPTION="Low Level Virtual Machine"
593 -HOMEPAGE="http://llvm.org/"
594 -SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
595 - clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
596 - http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
597 - http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
598 - lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
599 - !doc? ( http://dev.gentoo.org/~mgorny/dist/${PN}-3.9.0_rc3-manpages.tar.bz2 )"
600 -
601 -# Keep in sync with CMakeLists.txt
602 -ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Mips MSP430
603 - NVPTX PowerPC Sparc SystemZ X86 XCore )
604 -ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
605 -
606 -# Additional licenses:
607 -# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
608 -# 2. ARM backend: LLVM Software Grant by ARM.
609 -# 3. MD5 code: public-domain.
610 -# 4. Tests (not installed):
611 -# a. gtest: BSD.
612 -# b. YAML tests: MIT.
613 -
614 -LICENSE="UoI-NCSA rc BSD public-domain
615 - llvm_targets_ARM? ( LLVM-Grant )"
616 -SLOT="0/${PV}"
617 -KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
618 -IUSE="clang debug default-compiler-rt default-libcxx doc gold libedit +libffi
619 - lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml
620 - elibc_musl kernel_Darwin kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
621 -
622 -COMMON_DEPEND="
623 - sys-libs/zlib:0=
624 - clang? (
625 - python? ( ${PYTHON_DEPS} )
626 - static-analyzer? (
627 - dev-lang/perl:*
628 - ${PYTHON_DEPS}
629 - )
630 - xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
631 - )
632 - gold? ( >=sys-devel/binutils-2.22:*[cxx] )
633 - libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
634 - libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
635 - lldb? ( dev-python/six[${PYTHON_USEDEP}] )
636 - ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
637 - ocaml? (
638 - >=dev-lang/ocaml-4.00.0:0=
639 - dev-ml/ocaml-ctypes:=
640 - !!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
641 -# configparser-3.2 breaks the build (3.3 or none at all are fine)
642 -DEPEND="${COMMON_DEPEND}
643 - dev-lang/perl
644 - >=sys-devel/make-3.81
645 - >=sys-devel/flex-2.5.4
646 - >=sys-devel/bison-1.875d
647 - || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
648 - ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
649 - )
650 - || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
651 - kernel_Darwin? ( <sys-libs/libcxx-${PV%_rc*}.9999 )
652 - clang? ( xml? ( virtual/pkgconfig ) )
653 - doc? ( dev-python/sphinx )
654 - gold? ( sys-libs/binutils-libs )
655 - libffi? ( virtual/pkgconfig )
656 - lldb? ( dev-lang/swig )
657 - !!<dev-python/configparser-3.3.0.2
658 - ocaml? ( dev-ml/findlib
659 - test? ( dev-ml/ounit ) )
660 - ${PYTHON_DEPS}"
661 -RDEPEND="${COMMON_DEPEND}
662 - clang? ( !<=sys-devel/clang-${PV}-r99 )
663 - abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
664 - !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
665 -PDEPEND="
666 - clang? (
667 - =sys-devel/clang-${PV}-r100
668 - ~sys-devel/clang-runtime-${PV}
669 - )
670 - default-libcxx? ( sys-libs/libcxx )
671 - kernel_Darwin? ( =sys-libs/libcxx-${PV%.*}* )"
672 -
673 -# pypy gives me around 1700 unresolved tests due to open file limit
674 -# being exceeded. probably GC does not close them fast enough.
675 -REQUIRED_USE="${PYTHON_REQUIRED_USE}
676 - lldb? ( clang xml )
677 - || ( ${ALL_LLVM_TARGETS[*]} )
678 - multitarget? ( ${ALL_LLVM_TARGETS[*]} )"
679 -
680 -S=${WORKDIR}/${P/_}.src
681 -
682 -check_space() {
683 - # in megs
684 - # !clang !debug !multitarget -O2 400
685 - # !clang !debug multitarget -O2 550
686 - # clang !debug !multitarget -O2 950
687 - # clang !debug multitarget -O2 1200
688 - # !clang debug multitarget -O2 5G
689 - # clang !debug multitarget -O0 -g 12G
690 - # clang debug multitarget -O2 16G
691 - # clang debug multitarget -O0 -g 14G
692 -
693 - local build_size=550
694 - use clang && build_size=1200
695 -
696 - if use debug; then
697 - ewarn "USE=debug is known to increase the size of package considerably"
698 - ewarn "and cause the tests to fail."
699 - ewarn
700 -
701 - (( build_size *= 14 ))
702 - elif is-flagq '-g?(gdb)?([1-9])'; then
703 - ewarn "The C++ compiler -g option is known to increase the size of the package"
704 - ewarn "considerably. If you run out of space, please consider removing it."
705 - ewarn
706 -
707 - (( build_size *= 10 ))
708 - fi
709 -
710 - # Multiply by number of ABIs :).
711 - local abis=( $(multilib_get_enabled_abis) )
712 - (( build_size *= ${#abis[@]} ))
713 -
714 - local CHECKREQS_DISK_BUILD=${build_size}M
715 - check-reqs_pkg_pretend
716 -}
717 -
718 -pkg_pretend() {
719 - check_space
720 -}
721 -
722 -pkg_setup() {
723 - check_space
724 -}
725 -
726 -src_unpack() {
727 - default
728 -
729 - if use clang; then
730 - mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
731 - || die "clang source directory move failed"
732 - mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
733 - || die "compiler-rt source directory move failed"
734 - mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
735 - || die "clang-tools-extra source directory move failed"
736 - fi
737 -
738 - if use lldb; then
739 - mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
740 - || die "lldb source directory move failed"
741 - fi
742 -}
743 -
744 -src_prepare() {
745 - python_setup
746 -
747 - # Fix libdir for ocaml bindings install, bug #559134
748 - eapply "${FILESDIR}"/3.9.1/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
749 - # Do not build/install ocaml docs with USE=-doc, bug #562008
750 - eapply "${FILESDIR}"/3.9.1/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
751 -
752 - # Make it possible to override Sphinx HTML install dirs
753 - # https://llvm.org/bugs/show_bug.cgi?id=23780
754 - eapply "${FILESDIR}"/3.9.1/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
755 -
756 - # Prevent race conditions with parallel Sphinx runs
757 - # https://llvm.org/bugs/show_bug.cgi?id=23781
758 - eapply "${FILESDIR}"/3.9.1/0004-cmake-Use-separate-doctrees-to-prevent-races-between.patch
759 -
760 - # Allow custom cmake build types (like 'Gentoo')
761 - eapply "${FILESDIR}"/3.9.1/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch
762 -
763 - # Fix llvm-config for shared linking and sane flags
764 - # https://bugs.gentoo.org/show_bug.cgi?id=565358
765 - eapply "${FILESDIR}"/3.9.1/llvm-config-r1.patch
766 -
767 - # Restore SOVERSIONs for shared libraries
768 - # https://bugs.gentoo.org/show_bug.cgi?id=578392
769 - eapply "${FILESDIR}"/3.9.1/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch
770 -
771 - # support building llvm against musl-libc
772 - use elibc_musl && eapply "${FILESDIR}"/9999/musl-fixes.patch
773 -
774 - # disable use of SDK on OSX, bug #568758
775 - sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
776 -
777 - # Workaround, can be compiled with gcc on Gentoo/FreeBSD, bug #578064
778 - use kernel_FreeBSD && tc-is-gcc && append-cppflags "-D_GLIBCXX_USE_C99"
779 -
780 - if use clang; then
781 - # Automatically select active system GCC's libraries, bugs #406163 and #417913
782 - eapply "${FILESDIR}"/3.9.1/clang/gcc-config.patch
783 -
784 - eapply "${FILESDIR}"/3.9.1/clang/darwin_prefix-include-paths.patch
785 - eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
786 -
787 - eapply "${FILESDIR}"/3.8.1/compiler-rt/darwin-default-sysroot.patch
788 -
789 - pushd "${S}"/tools/clang >/dev/null || die
790 - # be able to specify default values for -stdlib and -rtlib at build time
791 - eapply "${FILESDIR}"/3.9.1/clang/default-libs.patch
792 - popd >/dev/null || die
793 -
794 - sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
795 - tools/clang/tools/scan-build/bin/scan-build || die
796 -
797 - # Install clang runtime into /usr/lib/clang
798 - # https://llvm.org/bugs/show_bug.cgi?id=23792
799 - eapply "${FILESDIR}"/3.9.1/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
800 - eapply "${FILESDIR}"/3.9.1/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
801 -
802 - # Make it possible to override CLANG_LIBDIR_SUFFIX
803 - # (that is used only to find LLVMgold.so)
804 - # https://llvm.org/bugs/show_bug.cgi?id=23793
805 - eapply "${FILESDIR}"/3.9.1/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
806 -
807 - # Fix git-clang-format shebang, bug #562688
808 - python_fix_shebang tools/clang/tools/clang-format/git-clang-format
809 -
810 - pushd projects/compiler-rt >/dev/null || die
811 -
812 - # Fix WX sections, bug #421527
813 - find lib/builtins -type f -name '*.S' -exec sed \
814 - -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
815 - -i {} + || die
816 -
817 - popd >/dev/null || die
818 - fi
819 -
820 - if use lldb; then
821 - # Do not install dummy readline.so module from
822 - # https://llvm.org/bugs/show_bug.cgi?id=18841
823 - sed -e 's/add_subdirectory(readline)/#&/' \
824 - -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
825 - # Do not install bundled six module
826 - eapply "${FILESDIR}"/3.9.1/lldb/six.patch
827 - fi
828 -
829 - # User patches
830 - eapply_user
831 -
832 - # Native libdir is used to hold LLVMgold.so
833 - NATIVE_LIBDIR=$(get_libdir)
834 -}
835 -
836 -multilib_src_configure() {
837 - local ffi_cflags ffi_ldflags
838 - if use libffi; then
839 - ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
840 - ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
841 - fi
842 -
843 - local libdir=$(get_libdir)
844 - local mycmakeargs=(
845 - -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
846 -
847 - -DBUILD_SHARED_LIBS=ON
848 - -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
849 - -DLLVM_BUILD_TESTS=$(usex test)
850 -
851 - -DLLVM_ENABLE_FFI=$(usex libffi)
852 - -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
853 - -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
854 - -DLLVM_ENABLE_EH=ON
855 - -DLLVM_ENABLE_RTTI=ON
856 -
857 - -DWITH_POLLY=OFF # TODO
858 -
859 - -DLLVM_HOST_TRIPLE="${CHOST}"
860 -
861 - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
862 - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
863 -
864 - -DHAVE_HISTEDIT_H=$(usex libedit)
865 - )
866 -
867 - if use clang; then
868 - mycmakeargs+=(
869 - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
870 - # libgomp support fails to find headers without explicit -I
871 - # furthermore, it provides only syntax checking
872 - -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
873 -
874 - # override default stdlib and rtlib
875 - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
876 - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
877 -
878 - # compiler-rt's test cases depend on sanitizer
879 - -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
880 - -DCOMPILER_RT_INCLUDE_TESTS=$(usex sanitize)
881 - )
882 - fi
883 -
884 - if use lldb; then
885 - mycmakeargs+=(
886 - -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
887 - -DLLDB_DISABLE_CURSES=$(usex !ncurses)
888 - -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
889 - )
890 - fi
891 -
892 - if ! multilib_is_native_abi || ! use ocaml; then
893 - mycmakeargs+=(
894 - -DOCAMLFIND=NO
895 - )
896 - fi
897 -# Note: go bindings have no CMake rules at the moment
898 -# but let's kill the check in case they are introduced
899 -# if ! multilib_is_native_abi || ! use go; then
900 - mycmakeargs+=(
901 - -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
902 - )
903 -# fi
904 -
905 - if multilib_is_native_abi; then
906 - mycmakeargs+=(
907 - -DLLVM_BUILD_DOCS=$(usex doc)
908 - -DLLVM_ENABLE_SPHINX=$(usex doc)
909 - -DLLVM_ENABLE_DOXYGEN=OFF
910 - -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
911 - -DSPHINX_WARNINGS_AS_ERRORS=OFF
912 - -DLLVM_INSTALL_UTILS=ON
913 - )
914 -
915 - if use clang; then
916 - mycmakeargs+=(
917 - -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
918 - )
919 - fi
920 -
921 - if use gold; then
922 - mycmakeargs+=(
923 - -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
924 - )
925 - fi
926 -
927 - if use lldb; then
928 - mycmakeargs+=(
929 - -DLLDB_DISABLE_PYTHON=$(usex !python)
930 - )
931 - fi
932 -
933 - else
934 - if use clang; then
935 - mycmakeargs+=(
936 - # disable compiler-rt on non-native ABI because:
937 - # 1. it fails to configure because of -m32
938 - # 2. it is shared between ABIs so no point building
939 - # it multiple times
940 - -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
941 - -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
942 - )
943 - fi
944 - if use lldb; then
945 - mycmakeargs+=(
946 - # only run swig on native abi
947 - -DLLDB_DISABLE_PYTHON=ON
948 - )
949 - fi
950 - fi
951 -
952 - if use clang; then
953 - mycmakeargs+=(
954 - -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
955 - -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
956 - -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
957 - )
958 -
959 - # -- not needed when compiler-rt is built with host compiler --
960 - # cmake passes host C*FLAGS to compiler-rt build
961 - # which is performed using clang, so we need to filter out
962 - # some flags clang does not support
963 - # (if you know some more flags that don't work, let us know)
964 - #filter-flags -msahf -frecord-gcc-switches
965 - fi
966 -
967 - if tc-is-cross-compiler; then
968 - [[ -x "/usr/bin/llvm-tblgen" ]] \
969 - || die "/usr/bin/llvm-tblgen not found or usable"
970 - mycmakeargs+=(
971 - -DCMAKE_CROSSCOMPILING=ON
972 - -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
973 - )
974 -
975 - if use clang; then
976 - [[ -x "/usr/bin/clang-tblgen" ]] \
977 - || die "/usr/bin/clang-tblgen not found or usable"
978 - mycmakeargs+=(
979 - -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
980 - )
981 - fi
982 - fi
983 -
984 - cmake-utils_src_configure
985 -}
986 -
987 -multilib_src_compile() {
988 - cmake-utils_src_compile
989 - # TODO: not sure why this target is not correctly called
990 - multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
991 -
992 - pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
993 - pax-mark m "${BUILD_DIR}"/bin/lli
994 - pax-mark m "${BUILD_DIR}"/bin/lli-child-target
995 -
996 - if use test; then
997 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
998 - pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
999 - pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
1000 - fi
1001 -
1002 - # provide a symlink for tests
1003 - if [[ $(get_libdir) != lib ]]; then
1004 - ln -s "../$(get_libdir)/clang" lib/clang || die
1005 - fi
1006 -}
1007 -
1008 -multilib_src_test() {
1009 - # respect TMPDIR!
1010 - local -x LIT_PRESERVES_TMP=1
1011 - local test_targets=( check )
1012 - # clang tests won't work on non-native ABI because we skip compiler-rt
1013 - multilib_is_native_abi && use clang && test_targets+=( check-clang )
1014 - cmake-utils_src_make "${test_targets[@]}"
1015 -}
1016 -
1017 -src_install() {
1018 - local MULTILIB_CHOST_TOOLS=(
1019 - /usr/bin/llvm-config
1020 - )
1021 -
1022 - local MULTILIB_WRAPPED_HEADERS=(
1023 - /usr/include/llvm/Config/config.h
1024 - /usr/include/llvm/Config/llvm-config.h
1025 - )
1026 -
1027 - if use clang; then
1028 - MULTILIB_WRAPPED_HEADERS+=(
1029 - /usr/include/clang/Config/config.h
1030 - )
1031 - fi
1032 -
1033 - multilib-minimal_src_install
1034 -
1035 - if use clang; then
1036 - # Apply CHOST and version suffix to clang tools
1037 - local clang_version=${PV%.*}
1038 - local clang_tools=( clang clang++ clang-cl clang-cpp )
1039 - local abi i
1040 -
1041 - # cmake gives us:
1042 - # - clang-X.Y
1043 - # - clang -> clang-X.Y
1044 - # - clang++, clang-cl, clang-cpp -> clang
1045 - # we want to have:
1046 - # - clang-X.Y
1047 - # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
1048 - # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
1049 - # also in CHOST variant
1050 - for i in "${clang_tools[@]:1}"; do
1051 - rm -f "${ED%/}/usr/bin/${i}" || die
1052 - dosym "clang-${clang_version}" "/usr/bin/${i}-${clang_version}"
1053 - dosym "${i}-${clang_version}" "/usr/bin/${i}"
1054 - done
1055 -
1056 - # now create target symlinks for all supported ABIs
1057 - for abi in $(get_all_abis); do
1058 - local abi_chost=$(get_abi_CHOST "${abi}")
1059 - for i in "${clang_tools[@]}"; do
1060 - dosym "${i}-${clang_version}" \
1061 - "/usr/bin/${abi_chost}-${i}-${clang_version}"
1062 - dosym "${abi_chost}-${i}-${clang_version}" \
1063 - "/usr/bin/${abi_chost}-${i}"
1064 - done
1065 - done
1066 - fi
1067 -
1068 - # Remove unnecessary headers on FreeBSD, bug #417171
1069 - if use kernel_FreeBSD && use clang; then
1070 - rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
1071 - fi
1072 -}
1073 -
1074 -multilib_src_install() {
1075 - cmake-utils_src_install
1076 -
1077 - if multilib_is_native_abi; then
1078 - # Symlink the gold plugin.
1079 - if use gold; then
1080 - dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
1081 - dosym "../../../../$(get_libdir)/LLVMgold.so" \
1082 - "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
1083 - fi
1084 - fi
1085 -}
1086 -
1087 -multilib_src_install_all() {
1088 - insinto /usr/share/vim/vimfiles
1089 - doins -r utils/vim/*/.
1090 - # some users may find it useful
1091 - dodoc utils/vim/vimrc
1092 -
1093 - # Install man pages from the prebuilt package
1094 - if ! use doc; then
1095 - if ! use clang; then
1096 - rm "${WORKDIR}"/${PN}-3.9.0_rc3-manpages/{clang,extraclangtools,scan-build}.1 || die
1097 - fi
1098 -
1099 - doman "${WORKDIR}"/${PN}-3.9.0_rc3-manpages/*.1
1100 - fi
1101 -
1102 - if use clang; then
1103 - pushd tools/clang >/dev/null || die
1104 -
1105 - if use python ; then
1106 - pushd bindings/python/clang >/dev/null || die
1107 -
1108 - python_moduleinto clang
1109 - python_domodule *.py
1110 -
1111 - popd >/dev/null || die
1112 - fi
1113 -
1114 - # AddressSanitizer symbolizer (currently separate)
1115 - dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
1116 -
1117 - popd >/dev/null || die
1118 -
1119 - python_fix_shebang "${ED}"
1120 - if use static-analyzer; then
1121 - python_optimize "${ED}"usr/share/scan-view
1122 - fi
1123 - fi
1124 -}