diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-12-01 11:27:25 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-12-02 00:40:29 +0100 |
commit | fb604b479e82366c145ed4721b3ce2345d82a59c (patch) | |
tree | d5eb943fdade9c17e50808a59dbf2255685c9770 /sys-devel/clang | |
parent | sys-devel/lld: Bump to 5.0.1_rc2 (diff) | |
download | gentoo-fb604b479e82366c145ed4721b3ce2345d82a59c.tar.gz gentoo-fb604b479e82366c145ed4721b3ce2345d82a59c.tar.bz2 gentoo-fb604b479e82366c145ed4721b3ce2345d82a59c.zip |
sys-devel/clang: Bump to 5.0.1_rc2
Diffstat (limited to 'sys-devel/clang')
-rw-r--r-- | sys-devel/clang/Manifest | 3 | ||||
-rw-r--r-- | sys-devel/clang/clang-5.0.1_rc2.ebuild | 288 |
2 files changed, 291 insertions, 0 deletions
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest index e85f2684ef76..9cda082e140e 100644 --- a/sys-devel/clang/Manifest +++ b/sys-devel/clang/Manifest @@ -1,8 +1,11 @@ DIST cfe-4.0.1.src.tar.xz 10933628 SHA256 61738a735852c23c3bdbe52d035488cdb2083013f384d67c1ba36fabebd8769b SHA512 936c9e1626b27e63a4fb11f3c0cb998eeaf9a520ad6e2bcd67cb4352e59e7781ecc700df79794f3fd70473d90b7e2ba418a39038eb0146b68e843f0705c1f964 WHIRLPOOL 1cb56b36e21eab8004eec43d9c0f7377588cdbcd1d654cd0e6d836d43bc68dc0759993215439c1607e09ed3fa1f68b80504a222f73c1b76d3841cdf638dcbef2 DIST cfe-5.0.0.src.tar.xz 11437024 SHA256 019f23c2192df793ac746595e94a403908749f8e0c484b403476d2611dd20970 SHA512 14acdd622310122b544c952ee5b932b7006d9d8424319f0e3974f2503d40a0cec4200fdd3d813a32ce0d877bcfbb9a5bd5c36f6142b4330e6c814f113ca2efe8 WHIRLPOOL 9d2fff35324621be191cc69b45db472681c9ebdf05aead09510f3178853ac8a179f2c454c2e6513e57f84a99980052671cd9a23d38d6d14b42dfda1853a7844a +DIST cfe-5.0.1rc2.src.tar.xz 11512960 BLAKE2B f6f53a985abfc07869984a8b6461549df80d8511645ff0ba46c035b04f247d9f56a63a178da7496b60064aed059518175d2d34aa661b72877f3e62b27c9eed13 SHA512 069fa3dc549ed046a004ca31a1e571fe83fca986635b5515e9eab3f91e3a962af99022e927d15fa2482969c64fa9b33c9c7e79a8cd9dd8fa77b554ba3f08d1ea DIST clang-tools-extra-4.0.1.src.tar.xz 581788 SHA256 35d1e64efc108076acbe7392566a52c35df9ec19778eb9eb12245fc7d8b915b6 SHA512 ea26d926f428e62e76cf8a073e63ffe05645f6592e05d7717d5c257908870ae9217727d3e1578227b14eda5937085872463f1a8e99970256179c68b8a92e69e0 WHIRLPOOL 7db97e7164657af786ec49975e730e8731bece87cfeb1e45894be6d5e3455530c17461ce894b263a0cdfee917d97566db49225374112a543f6355419f15c1d8f DIST clang-tools-extra-5.0.0.src.tar.xz 646416 SHA256 87d078b959c4a6e5ff9fd137c2f477cadb1245f93812512996f73986a6d973c6 SHA512 bf51c4d851bdc25bd2162e186b3080a30ad523f68859fd3dbce6c1094465382f794917b66406088c3bb1b15bee49821bcef5ef4b1a1e18704596354f7d0639bc WHIRLPOOL ffa57d51ad1b1c3d485f21aaf4cd82336ab6d9291b1e49af07ad05c0c9cc5b529b5571e49a6139c43afb4bcc1e920c1129f3dce73e73792bc965ec9cb8ed1db4 +DIST clang-tools-extra-5.0.1rc2.src.tar.xz 647236 BLAKE2B d916baf928e46f8222b95ca1be715ac16548730035d3a96172ec5f1cd0761c3b5d37b676038a02e78d5e13e95a64784664b60e1a1656798294b2da2d02b6dbe5 SHA512 0186de93b95c19b5d45089479fc7354f5294d78cbd1dee8e03145e7d6cb0f0974dc342636c1e464717af5acd41566ba6971e278ad4e2aca0937fb617970c52aa DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d DIST llvm-5.0.0.src.tar.xz 23411980 BLAKE2B bc3d8b75b766c83912252b51d6b57c8151c9d83415eff7bc771923d35138ed253a788d6c8e0a384c5e78ce1a1065f10d66ef5004df163b4c3b0c6274bb3aa6b7 SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a +DIST llvm-5.0.1rc2.src.tar.xz 23508164 BLAKE2B 3594d1658310a99787b4ff6f85aa8dd12a0405464bcb095ba4f205ce5b4ed3240a8ae1bef726ff98aba61ae5c8f8c10eeb8e415320d210af60f9e74bff7a8d5c SHA512 0a156e3949d22304b5e173dc9a3628161dff2798ad67924341c11494544350ef3a35a3ebb6ec8e7223b2407ce47cf12dafa6de8c006c5799a620e35a86c30b1b DIST llvm-manpages-4.0.1.tar.bz2 87981 SHA256 28fa1dcd4774156247ba253d2d79c81796ef0f0763b4f37c9c5ae27af93f4320 SHA512 d5b3213567c25db58ef364d272314a79c311a80fc21d98c09a5540af45a8190a38f489228663fe9a9b63bf0f2b952c460c4196a8fc8d6f221619f6e7ed2fc415 WHIRLPOOL da897ea8d3713a5c4c10a6320f0e7dd13e0125e942e3444b0e8a2a062b83a8e86e3754be025b89ae00f63f557ec0518ab62d8cd21237962e93c708ca72c8e3f5 DIST llvm-manpages-5.0.0.tar.bz2 94240 SHA256 5082c316cf09e6c15d76f0b184745bf3392d3fd42a56cf0a5119b45918a67cb9 SHA512 0bccfb00caa0796bed8ea4e591616e025e43d304f05589180820c17f8567fa3a1f1f76c323098ed0d0e4590765415b1c1c272a94c6e2e7544788f4088ef0ffea WHIRLPOOL 410fe9eda01519c7ded00b2ca61dd323bafb3418a0a81fdc5c3b60d64ee80b75a6372ea29eb66a1b1ce6bb020c011cff7d9e896469dd6f9534fc19fb5b5a4696 diff --git a/sys-devel/clang/clang-5.0.1_rc2.ebuild b/sys-devel/clang/clang-5.0.1_rc2.ebuild new file mode 100644 index 000000000000..941177f9291f --- /dev/null +++ b/sys-devel/clang/clang-5.0.1_rc2.ebuild @@ -0,0 +1,288 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +: ${CMAKE_MAKEFILE_GENERATOR:=ninja} +# (needed due to CMAKE_BUILD_TYPE != Gentoo) +CMAKE_MIN_VERSION=3.7.0-r1 +PYTHON_COMPAT=( python2_7 ) + +inherit cmake-utils eapi7-ver flag-o-matic llvm \ + multilib-minimal pax-utils python-single-r1 toolchain-funcs + +MY_P=cfe-${PV/_/}.src +EXTRA_P=clang-tools-extra-${PV/_/}.src +LLVM_P=llvm-${PV/_/}.src + +DESCRIPTION="C language family frontend for LLVM" +HOMEPAGE="https://llvm.org/" +SRC_URI="http://prereleases.llvm.org/${PV/_//}/${MY_P}.tar.xz + http://prereleases.llvm.org/${PV/_//}/${EXTRA_P}.tar.xz + test? ( http://prereleases.llvm.org/${PV/_//}/${LLVM_P}.tar.xz )" +# !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )" + +# Keep in sync with sys-devel/llvm +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 + NVPTX PowerPC Sparc SystemZ X86 XCore ) +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} + +LICENSE="UoI-NCSA" +SLOT="$(ver_cut 1)" +KEYWORDS="" +IUSE="debug default-compiler-rt default-libcxx +doc +static-analyzer + test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}" + +RDEPEND=" + ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}] + static-analyzer? ( + dev-lang/perl:* + z3? ( sci-mathematics/z3:0= ) + ) + xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] ) + ${PYTHON_DEPS}" +# configparser-3.2 breaks the build (3.3 or none at all are fine) +DEPEND="${RDEPEND} + doc? ( dev-python/sphinx ) + xml? ( virtual/pkgconfig ) + !!<dev-python/configparser-3.3.0.2 + ${PYTHON_DEPS}" +RDEPEND="${RDEPEND} + !<sys-devel/llvm-4.0.0_rc:0 + !sys-devel/clang:0" +PDEPEND=" + ~sys-devel/clang-runtime-${PV} + default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* ) + default-libcxx? ( sys-libs/libcxx )" + +REQUIRED_USE="${PYTHON_REQUIRED_USE} + || ( ${ALL_LLVM_TARGETS[*]} )" + +# We need extra level of indirection for CLANG_RESOURCE_DIR +S=${WORKDIR}/x/y/${MY_P} + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +PATCHES=( + # fix finding compiler-rt libs + "${FILESDIR}"/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch +) + +# Multilib notes: +# 1. ABI_* flags control ABIs libclang* is built for only. +# 2. clang is always capable of compiling code for all ABIs for enabled +# target. However, you will need appropriate crt* files (installed +# e.g. by sys-devel/gcc and sys-libs/glibc). +# 3. ${CHOST}-clang wrappers are always installed for all ABIs included +# in the current profile (i.e. alike supported by sys-devel/gcc). +# +# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need +# multilib clang* libraries (not runtime, not wrappers). + +pkg_setup() { + LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup + python-single-r1_pkg_setup +} + +src_unpack() { + # create extra parent dir for CLANG_RESOURCE_DIR + mkdir -p x/y || die + cd x/y || die + + einfo "Unpacking ${MY_P}.tar.xz ..." + tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die + einfo "Unpacking ${EXTRA_P}.tar.xz ..." + tar -xf "${DISTDIR}/${EXTRA_P}.tar.xz" || die + + mv "${EXTRA_P}" "${S}"/tools/extra || die + if use test; then + einfo "Unpacking parts of ${LLVM_P}.tar.xz ..." + tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \ + "${LLVM_P}"/utils/{lit,unittest} || die + mv "${LLVM_P}" "${WORKDIR}"/llvm || die + fi +} + +multilib_src_configure() { + local llvm_version=$(llvm-config --version) || die + local clang_version=$(ver_cut 1-3 "${llvm_version}") + + local mycmakeargs=( + # ensure that the correct llvm-config is used + -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}" + # relative to bindir + -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}" + + -DBUILD_SHARED_LIBS=ON + -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" + -DLLVM_BUILD_TESTS=$(usex test) + + # these are not propagated reliably, so redefine them + -DLLVM_ENABLE_EH=ON + -DLLVM_ENABLE_RTTI=ON + + -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml) + # libgomp support fails to find headers without explicit -I + # furthermore, it provides only syntax checking + -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp + + # override default stdlib and rtlib + -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "") + -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "") + + -DCLANG_ENABLE_ARCMT=$(usex static-analyzer) + -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer) + # z3 is not multilib-friendly + -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3) + ) + use test && mycmakeargs+=( + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" + ) + + if multilib_is_native_abi; then + mycmakeargs+=( + # normally copied from LLVM_INCLUDE_DOCS but the latter + # is lacking value in stand-alone builds + -DCLANG_INCLUDE_DOCS=$(usex doc) + -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc) + ) + use doc && mycmakeargs+=( + -DLLVM_BUILD_DOCS=ON + -DLLVM_ENABLE_SPHINX=ON + -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html" + -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra" + -DSPHINX_WARNINGS_AS_ERRORS=OFF + ) + use z3 && mycmakeargs+=( + -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3" + ) + else + mycmakeargs+=( + -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF + ) + fi + + if tc-is-cross-compiler; then + [[ -x "/usr/bin/clang-tblgen" ]] \ + || die "/usr/bin/clang-tblgen not found or usable" + mycmakeargs+=( + -DCMAKE_CROSSCOMPILING=ON + -DCLANG_TABLEGEN=/usr/bin/clang-tblgen + ) + fi + + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + cmake-utils_src_configure +} + +multilib_src_compile() { + cmake-utils_src_compile + + # provide a symlink for tests + if [[ ! -L ${WORKDIR}/lib/clang ]]; then + mkdir -p "${WORKDIR}"/lib || die + ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die + fi +} + +multilib_src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + cmake-utils_src_make check-clang + # clang-tidy requires [static-analyzer] and tests are not split + # correctly, so they are all disabled when static-analyzer is off + if multilib_is_native_abi && use static-analyzer; then + cmake-utils_src_make check-clang-tools + fi +} + +src_install() { + MULTILIB_WRAPPED_HEADERS=( + /usr/include/clang/Config/config.h + ) + + multilib-minimal_src_install + + # Move runtime headers to /usr/lib/clang, where they belong + mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die + # move (remaining) wrapped headers back + mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die + + # Apply CHOST and version suffix to clang tools + # note: we use two version components here (vs 3 in runtime path) + local llvm_version=$(llvm-config --version) || die + local clang_version=$(ver_cut 1-2 "${llvm_version}") + local clang_full_version=$(ver_cut 1-3 "${llvm_version}") + local clang_tools=( clang clang++ clang-cl clang-cpp ) + local abi i + + # cmake gives us: + # - clang-X.Y + # - clang -> clang-X.Y + # - clang++, clang-cl, clang-cpp -> clang + # we want to have: + # - clang-X.Y + # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y + # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y + # also in CHOST variant + for i in "${clang_tools[@]:1}"; do + rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die + dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}" + dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}" + done + + # now create target symlinks for all supported ABIs + for abi in $(get_all_abis); do + local abi_chost=$(get_abi_CHOST "${abi}") + for i in "${clang_tools[@]}"; do + dosym "${i}-${clang_version}" \ + "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}" + dosym "${abi_chost}-${i}-${clang_version}" \ + "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}" + done + done + + # Remove unnecessary headers on FreeBSD, bug #417171 + if use kernel_FreeBSD; then + rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die + fi +} + +multilib_src_install() { + cmake-utils_src_install + + # move headers to /usr/include for wrapping & ABI mismatch checks + # (also drop the version suffix from runtime headers) + rm -rf "${ED%/}"/usr/include || die + mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die + mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die +} + +multilib_src_install_all() { + python_fix_shebang "${ED}" + if use static-analyzer; then + python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view + fi + + docompress "/usr/lib/llvm/${SLOT}/share/man" + # match 'html' non-compression + use doc && docompress -x "/usr/share/doc/${PF}/tools-extra" + # +x for some reason; TODO: investigate + use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1" +} + +pkg_postinst() { + if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then + eselect compiler-shadow update all + fi +} + +pkg_postrm() { + if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then + eselect compiler-shadow clean all + fi +} |