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: Sun, 13 Dec 2015 14:40:11
Message-Id: 1450017492.570a1aa0e0ca2137f86350351eace21af78b18ad.mgorny@gentoo
1 commit: 570a1aa0e0ca2137f86350351eace21af78b18ad
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 12 22:50:47 2015 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 13 14:38:12 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=570a1aa0
7
8 sys-devel/llvm: Clean Python, enable libomp and BPF backend in 3.7
9
10 Backport some of the changes from -9999 as 3.7.0-r4. Remove multi-Python
11 support which was working only partially because of lldb, also fixing
12 byte-compilation of Python modules, #567550. Default to libomp instead
13 of semi-broken libgomp support, #562990. Enable BPF backend by default,
14 GitHub PR #450.
15
16 Fixes: https://bugs.gentoo.org/show_bug.cgi?id=567550
17 Fixes: https://bugs.gentoo.org/show_bug.cgi?id=562990
18 Fixes: https://github.com/gentoo/gentoo/pull/450
19
20 sys-devel/llvm/llvm-3.7.0-r4.ebuild | 530 ++++++++++++++++++++++++++++++++++++
21 1 file changed, 530 insertions(+)
22
23 diff --git a/sys-devel/llvm/llvm-3.7.0-r4.ebuild b/sys-devel/llvm/llvm-3.7.0-r4.ebuild
24 new file mode 100644
25 index 0000000..8f74d07
26 --- /dev/null
27 +++ b/sys-devel/llvm/llvm-3.7.0-r4.ebuild
28 @@ -0,0 +1,530 @@
29 +# Copyright 1999-2015 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +# $Id$
32 +
33 +EAPI=5
34 +
35 +: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
36 +PYTHON_COMPAT=( python2_7 )
37 +
38 +inherit check-reqs cmake-utils eutils flag-o-matic multilib \
39 + multilib-minimal python-single-r1 toolchain-funcs pax-utils
40 +
41 +DESCRIPTION="Low Level Virtual Machine"
42 +HOMEPAGE="http://llvm.org/"
43 +SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
44 + clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
45 + http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
46 + http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
47 + lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
48 + !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
49 +
50 +LICENSE="UoI-NCSA"
51 +SLOT="0/${PV}"
52 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
53 +IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml
54 + python +static-analyzer test xml video_cards_radeon kernel_Darwin"
55 +
56 +COMMON_DEPEND="
57 + sys-libs/zlib:0=
58 + clang? (
59 + python? ( ${PYTHON_DEPS} )
60 + static-analyzer? (
61 + dev-lang/perl:*
62 + ${PYTHON_DEPS}
63 + )
64 + xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
65 + )
66 + gold? ( >=sys-devel/binutils-2.22:*[cxx] )
67 + libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
68 + libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
69 + ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
70 + ocaml? (
71 + >=dev-lang/ocaml-4.00.0:0=
72 + dev-ml/findlib
73 + dev-ml/ocaml-ctypes
74 + !!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
75 +# configparser-3.2 breaks the build (3.3 or none at all are fine)
76 +DEPEND="${COMMON_DEPEND}
77 + dev-lang/perl
78 + >=sys-devel/make-3.81
79 + >=sys-devel/flex-2.5.4
80 + >=sys-devel/bison-1.875d
81 + || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
82 + ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
83 + )
84 + || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
85 + kernel_Darwin? ( sys-libs/libcxx )
86 + clang? ( xml? ( virtual/pkgconfig ) )
87 + doc? ( dev-python/sphinx )
88 + gold? ( sys-libs/binutils-libs )
89 + libffi? ( virtual/pkgconfig )
90 + lldb? ( dev-lang/swig )
91 + !!<dev-python/configparser-3.3.0.2
92 + ocaml? ( test? ( dev-ml/ounit ) )
93 + ${PYTHON_DEPS}"
94 +RDEPEND="${COMMON_DEPEND}
95 + clang? ( !<=sys-devel/clang-${PV}-r99 )
96 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
97 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
98 +PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
99 +
100 +# pypy gives me around 1700 unresolved tests due to open file limit
101 +# being exceeded. probably GC does not close them fast enough.
102 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
103 + lldb? ( clang xml )"
104 +
105 +S=${WORKDIR}/${P/_}.src
106 +
107 +pkg_pretend() {
108 + # in megs
109 + # !clang !debug !multitarget -O2 400
110 + # !clang !debug multitarget -O2 550
111 + # clang !debug !multitarget -O2 950
112 + # clang !debug multitarget -O2 1200
113 + # !clang debug multitarget -O2 5G
114 + # clang !debug multitarget -O0 -g 12G
115 + # clang debug multitarget -O2 16G
116 + # clang debug multitarget -O0 -g 14G
117 +
118 + local build_size=550
119 + use clang && build_size=1200
120 +
121 + if use debug; then
122 + ewarn "USE=debug is known to increase the size of package considerably"
123 + ewarn "and cause the tests to fail."
124 + ewarn
125 +
126 + (( build_size *= 14 ))
127 + elif is-flagq '-g?(gdb)?([1-9])'; then
128 + ewarn "The C++ compiler -g option is known to increase the size of the package"
129 + ewarn "considerably. If you run out of space, please consider removing it."
130 + ewarn
131 +
132 + (( build_size *= 10 ))
133 + fi
134 +
135 + # Multiply by number of ABIs :).
136 + local abis=( $(multilib_get_enabled_abis) )
137 + (( build_size *= ${#abis[@]} ))
138 +
139 + local CHECKREQS_DISK_BUILD=${build_size}M
140 + check-reqs_pkg_pretend
141 +
142 + if [[ ${MERGE_TYPE} != binary ]]; then
143 + echo 'int main() {return 0;}' > "${T}"/test.cxx || die
144 + ebegin "Trying to build a C++11 test program"
145 + if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
146 + eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
147 + eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
148 + eerror "to gcc-4.7 or an equivalent version supporting C++11."
149 + die "Currently active compiler does not support -std=c++11"
150 + fi
151 + eend ${?}
152 + fi
153 +}
154 +
155 +pkg_setup() {
156 + pkg_pretend
157 +}
158 +
159 +src_unpack() {
160 + default
161 +
162 + if use clang; then
163 + mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
164 + || die "clang source directory move failed"
165 + mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
166 + || die "compiler-rt source directory move failed"
167 + mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
168 + || die "clang-tools-extra source directory move failed"
169 + fi
170 +
171 + if use lldb; then
172 + mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
173 + || die "lldb source directory move failed"
174 + fi
175 +}
176 +
177 +src_prepare() {
178 + # Make ocaml warnings non-fatal, bug #537308
179 + sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
180 + # Fix libdir for ocaml bindings install, bug #559134
181 + epatch "${FILESDIR}"/cmake/${P}-ocaml-multilib.patch
182 + # Do not build/install ocaml docs with USE=-doc, bug #562008
183 + epatch "${FILESDIR}"/cmake/${P}-ocaml-build_doc.patch
184 +
185 + # Make it possible to override Sphinx HTML install dirs
186 + # https://llvm.org/bugs/show_bug.cgi?id=23780
187 + epatch "${FILESDIR}"/cmake/0002-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
188 +
189 + # Prevent race conditions with parallel Sphinx runs
190 + # https://llvm.org/bugs/show_bug.cgi?id=23781
191 + epatch "${FILESDIR}"/cmake/0003-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
192 +
193 + # Prevent installing libgtest
194 + # https://llvm.org/bugs/show_bug.cgi?id=18341
195 + epatch "${FILESDIR}"/cmake/0004-cmake-Do-not-install-libgtest.patch
196 +
197 + # Fix llvm-config for shared linking and sane flags
198 + # https://bugs.gentoo.org/show_bug.cgi?id=565358
199 + epatch "${FILESDIR}"/llvm-3.7-llvm-config.patch
200 +
201 + if use clang; then
202 + # Automatically select active system GCC's libraries, bugs #406163 and #417913
203 + epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
204 +
205 + epatch "${FILESDIR}"/clang-3.6-gentoo-install.patch
206 +
207 + sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
208 + tools/clang/tools/scan-build/scan-build || die
209 +
210 + # Install clang runtime into /usr/lib/clang
211 + # https://llvm.org/bugs/show_bug.cgi?id=23792
212 + epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
213 + epatch "${FILESDIR}"/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
214 +
215 + # Do not force -march flags on arm platforms
216 + # https://bugs.gentoo.org/show_bug.cgi?id=562706
217 + epatch "${FILESDIR}"/cmake/${P}-compiler_rt_arm_march_flags.patch
218 +
219 + # Make it possible to override CLANG_LIBDIR_SUFFIX
220 + # (that is used only to find LLVMgold.so)
221 + # https://llvm.org/bugs/show_bug.cgi?id=23793
222 + epatch "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
223 +
224 + # Fix WX sections, bug #421527
225 + find "${S}"/projects/compiler-rt/lib/builtins -type f -name \*.S -exec sed \
226 + -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
227 + -i {} \; || die
228 + fi
229 +
230 + if use lldb; then
231 + # Do not install dummy readline.so module from
232 + # https://llvm.org/bugs/show_bug.cgi?id=18841
233 + sed -e 's/add_subdirectory(readline)/#&/' \
234 + -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
235 +
236 + # Fix Python paths, bugs #562436 and #562438
237 + epatch "${FILESDIR}"/${PN}-3.7-lldb_python.patch
238 + sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \
239 + -i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die
240 +
241 + # Fix build with ncurses[tinfo], #560474
242 + # http://llvm.org/viewvc/llvm-project?view=revision&revision=247842
243 + epatch "${FILESDIR}"/cmake/${P}-lldb_tinfo.patch
244 + fi
245 +
246 + # User patches
247 + epatch_user
248 +
249 + python_setup
250 +
251 + # Native libdir is used to hold LLVMgold.so
252 + NATIVE_LIBDIR=$(get_libdir)
253 +}
254 +
255 +multilib_src_configure() {
256 + local targets
257 + if use multitarget; then
258 + targets=all
259 + else
260 + targets='host;BPF;CppBackend'
261 + use video_cards_radeon && targets+=';AMDGPU'
262 + fi
263 +
264 + local ffi_cflags ffi_ldflags
265 + if use libffi; then
266 + ffi_cflags=$(pkg-config --cflags-only-I libffi)
267 + ffi_ldflags=$(pkg-config --libs-only-L libffi)
268 + fi
269 +
270 + local libdir=$(get_libdir)
271 + local mycmakeargs=(
272 + "${mycmakeargs[@]}"
273 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
274 +
275 + -DBUILD_SHARED_LIBS=ON
276 + -DLLVM_ENABLE_TIMESTAMPS=OFF
277 + -DLLVM_TARGETS_TO_BUILD="${targets}"
278 + -DLLVM_BUILD_TESTS=$(usex test)
279 +
280 + -DLLVM_ENABLE_FFI=$(usex libffi)
281 + -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
282 + -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
283 + -DLLVM_ENABLE_EH=ON
284 + -DLLVM_ENABLE_RTTI=ON
285 +
286 + -DWITH_POLLY=OFF # TODO
287 +
288 + -DLLVM_HOST_TRIPLE="${CHOST}"
289 +
290 + -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
291 + -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
292 +
293 + -DHAVE_HISTEDIT_H=$(usex libedit)
294 + )
295 +
296 + if use clang; then
297 + mycmakeargs+=(
298 + -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
299 + # libgomp support fails to find headers without explicit -I
300 + # furthermore, it provides only syntax checking
301 + -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
302 + )
303 + fi
304 +
305 + if use lldb; then
306 + mycmakeargs+=(
307 + -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
308 + -DLLDB_DISABLE_CURSES=$(usex !ncurses)
309 + -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
310 + )
311 + fi
312 +
313 + if ! multilib_is_native_abi || ! use ocaml; then
314 + mycmakeargs+=(
315 + -DOCAMLFIND=NO
316 + )
317 + fi
318 +# Note: go bindings have no CMake rules at the moment
319 +# but let's kill the check in case they are introduced
320 +# if ! multilib_is_native_abi || ! use go; then
321 + mycmakeargs+=(
322 + -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
323 + )
324 +# fi
325 +
326 + if multilib_is_native_abi; then
327 + mycmakeargs+=(
328 + -DLLVM_BUILD_DOCS=$(usex doc)
329 + -DLLVM_ENABLE_SPHINX=$(usex doc)
330 + -DLLVM_ENABLE_DOXYGEN=OFF
331 + -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
332 + -DSPHINX_WARNINGS_AS_ERRORS=OFF
333 + -DLLVM_INSTALL_UTILS=ON
334 + )
335 +
336 + if use clang; then
337 + mycmakeargs+=(
338 + -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
339 + )
340 + fi
341 +
342 + if use gold; then
343 + mycmakeargs+=(
344 + -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
345 + )
346 + fi
347 +
348 + if use lldb; then
349 + mycmakeargs+=(
350 + -DLLDB_DISABLE_PYTHON=$(usex !python)
351 + )
352 + fi
353 +
354 + else
355 + if use clang; then
356 + mycmakeargs+=(
357 + # disable compiler-rt on non-native ABI because:
358 + # 1. it fails to configure because of -m32
359 + # 2. it is shared between ABIs so no point building
360 + # it multiple times
361 + -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
362 + -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
363 + )
364 + fi
365 + if use lldb; then
366 + mycmakeargs+=(
367 + # only run swig on native abi
368 + -DLLDB_DISABLE_PYTHON=ON
369 + )
370 + fi
371 + fi
372 +
373 + if use clang; then
374 + mycmakeargs+=(
375 + -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
376 + -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
377 + -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
378 + )
379 +
380 + # -- not needed when compiler-rt is built with host compiler --
381 + # cmake passes host C*FLAGS to compiler-rt build
382 + # which is performed using clang, so we need to filter out
383 + # some flags clang does not support
384 + # (if you know some more flags that don't work, let us know)
385 + #filter-flags -msahf -frecord-gcc-switches
386 + fi
387 +
388 + cmake-utils_src_configure
389 +}
390 +
391 +multilib_src_compile() {
392 + cmake-utils_src_compile
393 + # TODO: not sure why this target is not correctly called
394 + multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
395 +
396 + pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
397 + pax-mark m "${BUILD_DIR}"/bin/lli
398 + pax-mark m "${BUILD_DIR}"/bin/lli-child-target
399 +
400 + if use test; then
401 + pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
402 + pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
403 + pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
404 + fi
405 +}
406 +
407 +multilib_src_test() {
408 + # respect TMPDIR!
409 + local -x LIT_PRESERVES_TMP=1
410 + local test_targets=( check )
411 + # clang tests won't work on non-native ABI because we skip compiler-rt
412 + multilib_is_native_abi && use clang && test_targets+=( check-clang )
413 + cmake-utils_src_make "${test_targets[@]}"
414 +}
415 +
416 +src_install() {
417 + local MULTILIB_CHOST_TOOLS=(
418 + /usr/bin/llvm-config
419 + )
420 +
421 + local MULTILIB_WRAPPED_HEADERS=(
422 + /usr/include/llvm/Config/config.h
423 + /usr/include/llvm/Config/llvm-config.h
424 + )
425 +
426 + if use clang; then
427 + # note: magic applied in multilib_src_install()!
428 + CLANG_VERSION=${PV%.*}
429 +
430 + MULTILIB_CHOST_TOOLS+=(
431 + /usr/bin/clang
432 + /usr/bin/clang++
433 + /usr/bin/clang-cl
434 + /usr/bin/clang-${CLANG_VERSION}
435 + /usr/bin/clang++-${CLANG_VERSION}
436 + /usr/bin/clang-cl-${CLANG_VERSION}
437 + )
438 +
439 + MULTILIB_WRAPPED_HEADERS+=(
440 + /usr/include/clang/Config/config.h
441 + )
442 + fi
443 +
444 + multilib-minimal_src_install
445 +}
446 +
447 +multilib_src_install() {
448 + cmake-utils_src_install
449 +
450 + if multilib_is_native_abi; then
451 + # Install man pages.
452 + use doc || doman "${WORKDIR}"/${P}-manpages/*.1
453 +
454 + # Symlink the gold plugin.
455 + if use gold; then
456 + dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
457 + dosym "../../../../$(get_libdir)/LLVMgold.so" \
458 + "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
459 + fi
460 + fi
461 +
462 + # apply CHOST and CLANG_VERSION to clang executables
463 + # they're statically linked so we don't have to worry about the lib
464 + if use clang; then
465 + local clang_tools=( clang clang++ clang-cl )
466 + local i
467 +
468 + # cmake gives us:
469 + # - clang-X.Y
470 + # - clang -> clang-X.Y
471 + # - clang++, clang-cl -> clang
472 + # we want to have:
473 + # - clang-X.Y
474 + # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
475 + # - clang, clang++, clang-cl -> clang*-X.Y
476 + # so we need to fix the two tools
477 + for i in "${clang_tools[@]:1}"; do
478 + rm "${ED%/}/usr/bin/${i}" || die
479 + dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
480 + dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
481 + done
482 +
483 + # now prepend ${CHOST} and let the multilib-build.eclass symlink it
484 + if ! multilib_is_native_abi; then
485 + # non-native? let's replace it with a simple wrapper
486 + for i in "${clang_tools[@]}"; do
487 + rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
488 + cat > "${T}"/wrapper.tmp <<-_EOF_
489 + #!${EPREFIX}/bin/sh
490 + exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
491 + _EOF_
492 + newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
493 + done
494 + fi
495 + fi
496 +}
497 +
498 +multilib_src_install_all() {
499 + insinto /usr/share/vim/vimfiles
500 + doins -r utils/vim/*/.
501 + # some users may find it useful
502 + dodoc utils/vim/vimrc
503 +
504 + if use clang; then
505 + pushd tools/clang >/dev/null || die
506 +
507 + if use static-analyzer ; then
508 + pushd tools/scan-build >/dev/null || die
509 +
510 + dobin ccc-analyzer scan-build
511 + dosym ccc-analyzer /usr/bin/c++-analyzer
512 + doman scan-build.1
513 +
514 + insinto /usr/share/llvm
515 + doins scanview.css sorttable.js
516 +
517 + popd >/dev/null || die
518 + fi
519 +
520 + if use static-analyzer ; then
521 + pushd tools/scan-view >/dev/null || die
522 +
523 + python_doscript scan-view
524 +
525 + touch __init__.py || die
526 + python_moduleinto clang
527 + python_domodule *.py Resources
528 +
529 + popd >/dev/null || die
530 + fi
531 +
532 + if use python ; then
533 + pushd bindings/python/clang >/dev/null || die
534 +
535 + python_moduleinto clang
536 + python_domodule *.py
537 +
538 + popd >/dev/null || die
539 + fi
540 +
541 + # AddressSanitizer symbolizer (currently separate)
542 + dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
543 +
544 + popd >/dev/null || die
545 +
546 + python_fix_shebang "${ED}"
547 + if use lldb && use python; then
548 + python_optimize
549 + fi
550 + fi
551 +}
552 +
553 +pkg_postinst() {
554 + if use clang; then
555 + elog "To enable OpenMP support in clang, install sys-libs/libomp"
556 + elog "and use the '-fopenmp=libomp' command line option"
557 + fi
558 +}