diff options
author | Julian Ospald <hasufell@gentoo.org> | 2014-04-02 23:24:34 +0000 |
---|---|---|
committer | Julian Ospald <hasufell@gentoo.org> | 2014-04-02 23:24:34 +0000 |
commit | 2d916ef3d2fb83402bea17bb163f78af66cce317 (patch) | |
tree | b8f941b0bff829032f3adfb38ee858cfbf3da551 /sys-devel | |
parent | Version bump. Refactored ebuild to use more system dependencies, cleanup, add... (diff) | |
download | historical-2d916ef3d2fb83402bea17bb163f78af66cce317.tar.gz historical-2d916ef3d2fb83402bea17bb163f78af66cce317.tar.bz2 historical-2d916ef3d2fb83402bea17bb163f78af66cce317.zip |
revert last commit causing /usr/bin/clang being 32bit on amd64 systems
Package-Manager: portage-2.2.10/cvs/Linux x86_64
Manifest-Sign-Key: 0xBDEED020
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/llvm/ChangeLog | 8 | ||||
-rw-r--r-- | sys-devel/llvm/Manifest | 35 | ||||
-rw-r--r-- | sys-devel/llvm/llvm-3.4-r1.ebuild | 512 | ||||
-rw-r--r-- | sys-devel/llvm/llvm-9999.ebuild | 28 |
4 files changed, 554 insertions, 29 deletions
diff --git a/sys-devel/llvm/ChangeLog b/sys-devel/llvm/ChangeLog index d8ff7910c2e9..dfd2887d21cc 100644 --- a/sys-devel/llvm/ChangeLog +++ b/sys-devel/llvm/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-devel/llvm # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.184 2014/04/01 17:24:02 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.185 2014/04/02 23:24:29 hasufell Exp $ + +*llvm-3.4-r1 (02 Apr 2014) + + 02 Apr 2014; Julian Ospald <hasufell@gentoo.org> +llvm-3.4-r1.ebuild, + llvm-9999.ebuild: + revert last commit causing /usr/bin/clang being 32bit on amd64 systems 01 Apr 2014; Michał Górny <mgorny@gentoo.org> llvm-3.4.ebuild, llvm-9999.ebuild: diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest index 8656705a87f7..b03ce3de2553 100644 --- a/sys-devel/llvm/Manifest +++ b/sys-devel/llvm/Manifest @@ -55,26 +55,27 @@ EBUILD llvm-3.2.ebuild 6534 SHA256 eb16cc91887fdb035722d268caaa3e4843825403786fc EBUILD llvm-3.3-r1.ebuild 12001 SHA256 c4ad8c3268cadca54cf9f003a4c325bec30ae703abb7f801e4f0c6004c2988e0 SHA512 abe1d467bdfffd869acdbd19b492f00f8e0f3a938286694c9988f1613e894cf93a68cb1265d7a565b6ea801383545acdf26e6c9472770e26bc7056f3f2d1a834 WHIRLPOOL dcee9deff038dab67b4080b9ddf77a5d612d154e66b413d30a1461a8e0ee77d69270e45c7503f680f63d8300cdcc8dc351077cb94c3ca35c20c4f6489b63a634 EBUILD llvm-3.3-r3.ebuild 14223 SHA256 41dd967a26ec4b6a8b0b230ee62b25d8b8e1447d40ff02ab103485fa527a9c23 SHA512 37e9ef5381a0b9b417796c2a46932fcf273057e40e09ccc07ae03ec47992e05944c30393460cc68bffeb519974907649ee0c896f4da1e5bccc78330f9da189c3 WHIRLPOOL d75cd990229d0c297d9bd29c2efea48251959611b8f349b04debe1601a5ae569960e7f1649cb0e628dc521d3b13caa0a4c69ee5889ead58032bd6d37516a1786 EBUILD llvm-3.3.ebuild 6798 SHA256 4e53042e76ce97e6a460cda74c5dbadc1cee9009345e8f0232e28d53c8f77579 SHA512 5513887c3b5a25a678713b68c216a40801ddecbf5a4dc58d7ad01c1ec8411589e20d8662c34f117e6d64924302504c8ce74b48f3edca1f292b56881eb6176271 WHIRLPOOL 79d6adefc281699477a271f76cb8eb7992d0946b6fcda9149a0976c30138ac882f735eff08c25c0edf37ccc8e31700f6d2d51d38c354c82c06695962e8f9243b +EBUILD llvm-3.4-r1.ebuild 14806 SHA256 eb56a521612ee0a9ef4375d7908a7fee73950acba71006e50223a83b3927483f SHA512 391fcd8eedd6c4777db48dfd23799079e4b333b78fb8a21c3b42fd1d291edfacf56ffecf072c1b01e7b248fd913b778b547b8c885317d1efd906433b867420dc WHIRLPOOL 3650a3c0f5ea67a81cdcd1ae4f4c0e7b700c96ee37d9122b9aa357182d5ade1b10ada64ced8dd8ea2157043047a10aa538192324139bd3742026ea4f8aa071e1 EBUILD llvm-3.4.ebuild 14517 SHA256 89ff017e78d65e03c3334b732358a374c357c25579239ef87146436a32a58bda SHA512 0d6dc970cb65cd4ca8d6706f4993d068c753582bdfec9f23c3ad1d6343425f4b07ad1664d0a5e6dd1be9923fb11f93a629c8e690c0b7311949fa2de921a2b21f WHIRLPOOL a60dd2ffa9abc18875f4bcb263a0e494459d7a86d7a9bdf75a5d869f82e566dd0d8c1b0da203936ffd85580d77e04a641e2924239dff7e051f11954a56afa03e -EBUILD llvm-9999.ebuild 13564 SHA256 d3d58080217d47b3d82b6bcd2027c67c4fd8cc63ff2e50e44a2830f3988968df SHA512 b6f4e1b8e9fefea3f1c1c3c482cb5d3f202a35e33a3617f77489a996d3889ff8b95d50eff42259b3c272fd3294c3d848cd429f852fe904cb13323e712d7a1310 WHIRLPOOL b469d97d82f8c843e9fd9c40da3e5d4cf9f3ad4c41c87d4f5fc6fab6821e6325c12ed1e8b1734b3182b1567cd66e608a8e2c75986680c51b89385e8ffff5ee1b -MISC ChangeLog 30539 SHA256 ca9ba4eea20d7dae59cd3eefdc9ae30f9047a386e07a9002be4b9e9e3d647988 SHA512 18d893a5aa4ecac4b000a10bd75cbc35b15f2256c4147ed687c77e43c6fe6674317ec9fdbaa92a73adb720c208621829a0ee9fe2275732d56d33d7a6ac6aa8b0 WHIRLPOOL 840ddf4e19bd9a49a57709607014e786f7256d5ccbeaafe488198f382bfdb72035877d0840621a0e14d3c323c1746139a4dc53bb6785b43ad6e46a7c1778b0f2 +EBUILD llvm-9999.ebuild 13851 SHA256 7edd821219db73687a25b5c9d679b7017721556a77beda94b63bb102a655f595 SHA512 af040c9d721bd2fb41f26258982952672efc8ee1a3356e1df739697f875d2cc2971f981b7d6ba59f372743b1a0bae56f64e5b7cdde3760d9dcba74aece4e59df WHIRLPOOL c7520396b95696518d4d27cac3cfac27feb73af418aa38736f5e15ad0d251cae1a6b2abfecb574ec1fc94c2d2169b89a243e25fe9921488d9c086d51dede00a8 +MISC ChangeLog 30735 SHA256 94c7e128d30336156ab34bc9f37b3655db8cc84d4a2feea75e9b73836eb42ccd SHA512 3e9735275fe274eb1dc82d3ba6bf19673a84991ac75382069c157ebb0c9ed1711f44affd4b60e8d39056b4c69ad9d8c1cc4854fecd05feb0ea125276d3cde947 WHIRLPOOL b51bce0bf861208630050d318539171aa8e5f9f3551ed1ecea2d902995dc349dffd97d0973534650c59c8942daaa9e6a3da8513ebc32d46376fc56116f98f31f MISC metadata.xml 2723 SHA256 d1bbe72da2553592ad60522f744b8339bce17487343abf372d966c1fe9cd163d SHA512 800f72039a5f0fdb175a8ddab7ae8f184907865802ffd5f139006f3a8c77053f114e2f7b01cef3f41f6fffb3f8f8b2b474fdf95461f27b2dc8ae31cbd732a14e WHIRLPOOL 462d3d2f22e29d3678621a9f89ed98a58ee60fde57da7be21fbca7fd61e106abbcb19c0e491424869302c19ca93b15c480cd7ca2a3181f2148174d44e891e190 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) -iQJ8BAEBCABmBQJTOvY2XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w -ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC -MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZOX+MP/3Eg/+YwZV21Phf3FhQO/tJc -mg2AvaHwpX9dCpWLQQ3GP8sOCKEJc15g7Ewtgbrlaj5vdiUhDVTBKHVAd9pKRyC1 -fEPUV6rvblbvYUESlBTwOiq1IwrHiv5kJEIOI1Yy5Si55Ey8S59D1A1rfpu/Qoa3 -2s63TWmNjGPTVeXyiX9jpWiT8PX/4NYTyBnHmXlwLj2Xeap23nV69o9xAhSUZ90u -5D9vUVym/LR8oWr0nc2TECQclnNbTJPVbFI7Cl42qlGh9f7zlzXXWDZ44wSmoqhh -Tk6LfH2bnbwUZa2dbP2+QFsVM6PKei6YJyVHhogR/503ymeGBmfoMJ/rRgnSD6/Z -5b+6zvZgkSYffTvhucBVLeIbaQAVcsfhsM/8mmC2ocKunBBgPOuv5J9PBc/XowTH -SQhPIa8DJrTPRsHlCFyjPF1DNdzUzxM1pkXB+oozJ0yflQtpcMiGFHPCdt5QTKeg -FynHOJB74/CQZ0T6jsKnzxs/ZLaPvIIM7j+n7zrui93zIcYwojvbGPqHUEh/eKgu -0zhT4+Gh7oz6Ga7/w0ltpHZAGbnAjUMIWJ0/rbldkIXVQHdTt01sIsHtKAfAjkw7 -CamK3RZ3EcC/3pIYzN5R5jH2v2sOJ0+wyJAmmCUepaHh4NPuyzlOR5WyrvYdvUzv -DblNtFm8J2u64MCLFvg8 -=vPqk +iQJ8BAEBCABmBQJTPJwwXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzMDlCNDQ4NjEyNDI4NjA5REVEMDI3MzIy +MjBDRDFDNUJERUVEMDIwAAoJECIM0cW97tAgNm8P/iFocSeI71s7yILCiBR69aS1 +wrZQ3ax5CQe+vy0++A69xCdLgi64oRGquiRHn6e+9wldUK0KxJozJkCSRGDQ9FNf +Ws2MOKiyU5UJyTb98NUY/SjkEGG303T51hC01ZtDKW+heiZKT1E2gAK3MLVKse0V +N24c5MD0f1uf+5WEda64RpZfHzDLixDmEGdQ29QuY1lBT97g/u3XZJgzFB3e3+g9 +BE9z/u3sAdeENhHoN3AxFSU581v1clIR/TtDlffCpYBXwPRB4/eo2tsFoFHxik8k +HkFTwY6WaVVRCA3E6IxBTWV9BKGf9mx4dct/JQTlz+ONY99UAIc+qmuONVhataki +uwSh0kcek1blQ2NELq3H+xhWFIWkLkVwoXd5EFsSSseYvXD0xicIRttTWX/1pwEr +uUs+dC3LIGFeNHBTJALjhXfNDTfS0FDImuU6fO+8LECFTDUKWBtFbPDV9t14KiTB +sLFXYLZHtK4YLCNL52eVbLPJTBvD+5dJ959RFKCzD//YYLJvtqX+89DqKd9n3awt +CYV0mp7X+ympuZOpfGgk5a8QYJ5/rE+mleMo0q4cs7oHVeDortrFHuVQrxZ76kj/ +dKIvk0XERXpKcu+FToTpTpSxqVnSCNfGmBgdburEKd/foUNct/Kzfe8AN3R/B74f +3ZVl7nismu5sFm6WytDA +=516L -----END PGP SIGNATURE----- diff --git a/sys-devel/llvm/llvm-3.4-r1.ebuild b/sys-devel/llvm/llvm-3.4-r1.ebuild new file mode 100644 index 000000000000..0c86e8001301 --- /dev/null +++ b/sys-devel/llvm/llvm-3.4-r1.ebuild @@ -0,0 +1,512 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.4-r1.ebuild,v 1.1 2014/04/02 23:24:29 hasufell Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python{2_6,2_7} pypy pypy2_0 ) + +inherit cmake-utils eutils flag-o-matic multilib multilib-minimal \ + python-r1 toolchain-funcs pax-utils check-reqs + +DESCRIPTION="Low Level Virtual Machine" +HOMEPAGE="http://llvm.org/" +SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz + clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.gz + http://llvm.org/releases/${PV}/clang-${PV}.src.tar.gz + http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.gz ) + !doc? ( http://dev.gentoo.org/~mgorny/dist/${P}-manpages.tar.bz2 )" + +LICENSE="UoI-NCSA" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos" +IUSE="clang debug doc gold +libffi multitarget ncurses ocaml python + +static-analyzer test udis86 xml video_cards_radeon + kernel_Darwin kernel_FreeBSD" + +COMMON_DEPEND=" + sys-libs/zlib:0= + clang? ( + python? ( ${PYTHON_DEPS} ) + static-analyzer? ( + dev-lang/perl:* + ${PYTHON_DEPS} + ) + xml? ( dev-libs/libxml2:2= ) + ) + gold? ( >=sys-devel/binutils-2.22:*[cxx] ) + libffi? ( virtual/libffi:0=[${MULTILIB_USEDEP}] ) + ncurses? ( sys-libs/ncurses:5=[${MULTILIB_USEDEP}] ) + ocaml? ( dev-lang/ocaml:0= ) + udis86? ( dev-libs/udis86:0=[pic(+),${MULTILIB_USEDEP}] )" +DEPEND="${COMMON_DEPEND} + dev-lang/perl + >=sys-devel/make-3.81 + >=sys-devel/flex-2.5.4 + >=sys-devel/bison-1.875d + || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 + ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx ) + ) + || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 ) + clang? ( xml? ( virtual/pkgconfig ) ) + doc? ( dev-python/sphinx ) + libffi? ( virtual/pkgconfig ) + ${PYTHON_DEPS}" +RDEPEND="${COMMON_DEPEND} + clang? ( !<=sys-devel/clang-3.4-r99 + !>=sys-devel/clang-9999 ) + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )" +PDEPEND="clang? ( =sys-devel/clang-3.4-r100 )" + +# pypy gives me around 1700 unresolved tests due to open file limit +# being exceeded. probably GC does not close them fast enough. +REQUIRED_USE="${PYTHON_REQUIRED_USE} + test? ( || ( $(python_gen_useflags 'python*') ) )" + +# Some people actually override that in make.conf. That sucks since +# we need to run install per-directory, and ninja can't do that... +# so why did it call itself ninja in the first place? +CMAKE_MAKEFILE_GENERATOR=emake + +pkg_pretend() { + # in megs + # !clang !debug !multitarget -O2 400 + # !clang !debug multitarget -O2 550 + # clang !debug !multitarget -O2 950 + # clang !debug multitarget -O2 1200 + # !clang debug multitarget -O2 5G + # clang !debug multitarget -O0 -g 12G + # clang debug multitarget -O2 16G + # clang debug multitarget -O0 -g 14G + + local build_size=550 + use clang && build_size=1200 + + if use debug; then + ewarn "USE=debug is known to increase the size of package considerably" + ewarn "and cause the tests to fail." + ewarn + + (( build_size *= 14 )) + elif is-flagq -g || is-flagq -ggdb; then + ewarn "The C++ compiler -g option is known to increase the size of the package" + ewarn "considerably. If you run out of space, please consider removing it." + ewarn + + (( build_size *= 10 )) + fi + + # Multiply by number of ABIs :). + local abis=( $(multilib_get_enabled_abis) ) + (( build_size *= ${#abis[@]} )) + + local CHECKREQS_DISK_BUILD=${build_size}M + check-reqs_pkg_pretend +} + +pkg_setup() { + pkg_pretend + + # need to check if the active compiler is ok + + broken_gcc=( 3.2.2 3.2.3 3.3.2 4.1.1 ) + broken_gcc_x86=( 3.4.0 3.4.2 ) + broken_gcc_amd64=( 3.4.6 ) + + gcc_vers=$(gcc-fullversion) + + if has "${gcc_vers}" "${broken_gcc[@]}"; then + elog "Your version of gcc is known to miscompile llvm." + elog "Check http://www.llvm.org/docs/GettingStarted.html for" + elog "possible solutions." + die "Your currently active version of gcc is known to miscompile llvm" + fi + + if use abi_x86_32 && has "${gcc_vers}" "${broken_gcc_x86[@]}"; then + elog "Your version of gcc is known to miscompile llvm on x86" + elog "architectures. Check" + elog "http://www.llvm.org/docs/GettingStarted.html for possible" + elog "solutions." + die "Your currently active version of gcc is known to miscompile llvm" + fi + + if use abi_x86_64 && has "${gcc_vers}" "${broken_gcc_amd64[@]}"; then + elog "Your version of gcc is known to miscompile llvm in amd64" + elog "architectures. Check" + elog "http://www.llvm.org/docs/GettingStarted.html for possible" + elog "solutions." + die "Your currently active version of gcc is known to miscompile llvm" + fi +} + +src_unpack() { + default + + rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \ + || die "symlinks removal failed" + + if use clang; then + mv "${WORKDIR}"/clang-${PV} "${S}"/tools/clang \ + || die "clang source directory move failed" + mv "${WORKDIR}"/compiler-rt-${PV} "${S}"/projects/compiler-rt \ + || die "compiler-rt source directory move failed" + mv "${WORKDIR}"/clang-tools-extra-${PV} "${S}"/tools/clang/tools/extra \ + || die "clang-tools-extra source directory move failed" + fi +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-fix_varargs.patch + + epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch + epatch "${FILESDIR}"/${PN}-3.4-gentoo-install.patch + # Hack cmake search path for Gentoo, bug #496480 + epatch "${FILESDIR}"/${PN}-3.3-cmake-modulepath.patch + + if use clang; then + # Automatically select active system GCC's libraries, bugs #406163 and #417913 + epatch "${FILESDIR}"/clang-3.1-gentoo-runtime-gcc-detection-v3.patch + + epatch "${FILESDIR}"/clang-3.4-gentoo-install.patch + fi + + local sub_files=( + Makefile.config.in + Makefile.rules + tools/llvm-config/llvm-config.cpp + ) + use clang && sub_files+=( + tools/clang/lib/Driver/Tools.cpp + tools/clang/tools/scan-build/scan-build + ) + + # unfortunately ./configure won't listen to --mandir and the-like, so take + # care of this. + # note: we're setting the main libdir intentionally. + # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make. + einfo "Fixing install dirs" + sed -e "s,@libdir@,$(get_libdir),g" \ + -e "s,@PF@,${PF},g" \ + -e "s,@EPREFIX@,${EPREFIX},g" \ + -i "${sub_files[@]}" \ + || die "install paths sed failed" + + # User patches + epatch_user +} + +multilib_src_configure() { + # disable timestamps since they confuse ccache + local conf_flags=( + --disable-timestamps + --enable-keep-symbols + --enable-shared + --with-optimize-option= + $(use_enable !debug optimized) + $(use_enable debug assertions) + $(use_enable debug expensive-checks) + $(use_enable ncurses terminfo) + $(use_enable libffi) + ) + + if use clang; then + conf_flags+=( --with-clang-resource-dir=../lib/clang/${PV} ) + fi + # well, it's used only by clang executable c-index-test + if multilib_build_binaries && use clang && use xml; then + conf_flags+=( XML2CONFIG="$(tc-getPKG_CONFIG) libxml-2.0" ) + else + conf_flags+=( ac_cv_prog_XML2CONFIG="" ) + fi + + local targets bindings + if use multitarget; then + targets='all' + else + targets='host,cpp' + use video_cards_radeon && targets+=',r600' + fi + conf_flags+=( --enable-targets=${targets} ) + + if multilib_build_binaries; then + use gold && conf_flags+=( --with-binutils-include="${EPREFIX}"/usr/include/ ) + # extra commas don't hurt + use ocaml && bindings+=',ocaml' + fi + + [[ ${bindings} ]] || bindings='none' + conf_flags+=( --enable-bindings=${bindings} ) + + if use udis86; then + conf_flags+=( --with-udis86 ) + fi + + if use libffi; then + local CPPFLAGS=${CPPFLAGS} + append-cppflags "$(pkg-config --cflags libffi)" + fi + + # build with a suitable Python version + python_export_best + + # llvm prefers clang over gcc, so we may need to force that + tc-export CC CXX + + ECONF_SOURCE=${S} \ + econf "${conf_flags[@]}" + + multilib_build_binaries && cmake_configure +} + +cmake_configure() { + # sadly, cmake doesn't seem to have host autodetection + # but it's fairly easy to steal this from configured autotools + local targets=$(sed -n -e 's/^TARGETS_TO_BUILD=//p' Makefile.config || die) + local libdir=$(get_libdir) + local mycmakeargs=( + # just the stuff needed to get correct cmake modules + $(cmake-utils_use ncurses LLVM_ENABLE_TERMINFO) + + -DLLVM_TARGETS_TO_BUILD="${targets// /;}" + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + ) + + BUILD_DIR=${S%/}_cmake \ + cmake-utils_src_configure +} + +set_makeargs() { + MAKEARGS=( + VERBOSE=1 + REQUIRES_RTTI=1 + GENTOO_LIBDIR=$(get_libdir) + ) + + # for tests, we want it all! otherwise, we may use a little filtering... + # adding ONLY_TOOLS also disables unittest building... + if [[ ${EBUILD_PHASE_FUNC} != src_test ]]; then + local tools=( llvm-config ) + use clang && tools+=( clang ) + + if multilib_build_binaries; then + tools+=( + opt llvm-as llvm-dis llc llvm-ar llvm-nm llvm-link lli + llvm-extract llvm-mc llvm-bcanalyzer llvm-diff macho-dump + llvm-objdump llvm-readobj llvm-rtdyld llvm-dwarfdump llvm-cov + llvm-size llvm-stress llvm-mcmarkup llvm-symbolizer obj2yaml + yaml2obj lto bugpoint + ) + + # the build system runs explicitly specified tools in parallel, + # so we need to split it into two runs + if [[ ${1} != -1 ]]; then + # those require lto + tools+=( llvm-lto ) + use gold && tools+=( gold ) + + # those require clang :) + # we need to explicitly specify all its tools + # since we're passing BUILD_CLANG_ONLY + use clang && tools+=( + clang/tools/{clang-check,clang-format,extra} + ) + fi + fi + + MAKEARGS+=( + # filter tools + disable unittests implicitly + ONLY_TOOLS="${tools[*]}" + + # this disables unittests & docs from clang + BUILD_CLANG_ONLY=YES + ) + fi +} + +multilib_src_compile() { + local MAKEARGS + set_makeargs -1 + emake "${MAKEARGS[@]}" + + if multilib_build_binaries; then + set_makeargs + emake -C tools "${MAKEARGS[@]}" + + if use doc; then + emake -C "${S}"/docs -f Makefile.sphinx man + use clang && emake -C "${S}"/tools/clang/docs/tools \ + BUILD_FOR_WEBSITE=1 DST_MAN_DIR="${T}"/ man + emake -C "${S}"/docs -f Makefile.sphinx html + fi + fi + + if use debug; then + pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld + pax-mark m Debug+Asserts+Checks/bin/lli + else + pax-mark m Release/bin/llvm-rtdyld + pax-mark m Release/bin/lli + fi +} + +multilib_src_test() { + local MAKEARGS + set_makeargs + + # build the remaining tools & unittests + emake "${MAKEARGS[@]}" + + pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests + pax-mark m unittests/ExecutionEngine/MCJIT/Release/MCJITTests + pax-mark m unittests/Support/Release/SupportTests + + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + emake "${MAKEARGS[@]}" check + use clang && emake "${MAKEARGS[@]}" -C tools/clang test +} + +src_install() { + local MULTILIB_WRAPPED_HEADERS=( + /usr/include/llvm/Config/config.h + /usr/include/llvm/Config/llvm-config.h + ) + + use clang && MULTILIB_WRAPPED_HEADERS+=( + /usr/include/clang/Config/config.h + ) + + multilib-minimal_src_install + + # Remove unnecessary headers on FreeBSD, bug #417171 + use kernel_FreeBSD && use clang && rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h +} + +multilib_src_install() { + local MAKEARGS + set_makeargs + + emake "${MAKEARGS[@]}" DESTDIR="${D}" install + + # Preserve ABI-variant of llvm-config. + dodir /tmp + mv "${ED}"/usr/bin/llvm-config "${ED}"/tmp/"${CHOST}"-llvm-config || die + + if ! multilib_build_binaries; then + # Drop all the executables since LLVM doesn't like to + # clobber when installing. + rm -r "${ED}"/usr/bin || die + + # Backwards compat, will be happily removed someday. + dosym "${CHOST}"-llvm-config /tmp/llvm-config.${ABI} + else + # Move files back. + mv "${ED}"/tmp/*llvm-config* "${ED}"/usr/bin || die + # Create a symlink for host's llvm-config. + dosym "${CHOST}"-llvm-config /usr/bin/llvm-config + + # Install docs. + if use doc; then + doman "${S}"/docs/_build/man/*.1 + use clang && doman "${T}"/clang.1 + dohtml -r "${S}"/docs/_build/html/ + else + if ! use clang; then + rm "${WORKDIR}"/${P}-manpages/clang.1 || die + fi + doman "${WORKDIR}"/${P}-manpages/*.1 + fi + + # Symlink the gold plugin. + if use gold; then + dodir /usr/${CHOST}/binutils-bin/lib/bfd-plugins + dosym ../../../../$(get_libdir)/LLVMgold.so \ + /usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so + fi + + # install cmake modules + emake -C "${S%/}"_cmake/cmake/modules DESTDIR="${D}" install + fi + + # Fix install_names on Darwin. The build system is too complicated + # to just fix this, so we correct it post-install + local lib= f= odylib= libpv=${PV} + if [[ ${CHOST} == *-darwin* ]] ; then + eval $(grep PACKAGE_VERSION= configure) + [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION} + for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib ; do + # libEnhancedDisassembly is Darwin10 only, so non-fatal + # + omit clang libs if not enabled + [[ -f ${ED}/usr/lib/${lib} ]] || continue + + ebegin "fixing install_name of $lib" + install_name_tool \ + -id "${EPREFIX}"/usr/lib/${lib} \ + "${ED}"/usr/lib/${lib} + eend $? + done + for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib{LTO,clang}.dylib ; do + # omit clang libs if not enabled + [[ -f ${ED}/usr/lib/${lib} ]] || continue + + odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${libpv}.dylib) + ebegin "fixing install_name reference to ${odylib} of ${f##*/}" + install_name_tool \ + -change "${odylib}" \ + "${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib \ + -change "@rpath/libclang.dylib" \ + "${EPREFIX}"/usr/lib/libclang.dylib \ + -change "${S}"/Release/lib/libclang.dylib \ + "${EPREFIX}"/usr/lib/libclang.dylib \ + "${f}" + eend $? + done + fi +} + +multilib_src_install_all() { + insinto /usr/share/vim/vimfiles/syntax + doins utils/vim/*.vim + + if use clang; then + cd tools/clang || die + + if use static-analyzer ; then + dobin tools/scan-build/ccc-analyzer + dosym ccc-analyzer /usr/bin/c++-analyzer + dobin tools/scan-build/scan-build + + insinto /usr/share/${PN} + doins tools/scan-build/scanview.css + doins tools/scan-build/sorttable.js + fi + + python_inst() { + if use static-analyzer ; then + pushd tools/scan-view >/dev/null || die + + python_doscript scan-view + + touch __init__.py || die + python_moduleinto clang + python_domodule __init__.py Reporter.py Resources ScanView.py startfile.py + + popd >/dev/null || die + fi + + if use python ; then + pushd bindings/python/clang >/dev/null || die + + python_moduleinto clang + python_domodule __init__.py cindex.py enumerations.py + + popd >/dev/null || die + fi + + # AddressSanitizer symbolizer (currently separate) + python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py + } + python_foreach_impl python_inst + fi +} diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild index 9ee7bac47638..ab992b3e21f5 100644 --- a/sys-devel/llvm/llvm-9999.ebuild +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -1,13 +1,13 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-9999.ebuild,v 1.80 2014/04/01 17:24:02 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-9999.ebuild,v 1.81 2014/04/02 23:24:29 hasufell Exp $ EAPI=5 PYTHON_COMPAT=( python{2_5,2_6,2_7} pypy{1_9,2_0} ) -inherit cmake-utils eutils flag-o-matic git-r3 multibuild multilib \ - multilib-minimal python-r1 toolchain-funcs pax-utils check-reqs +inherit cmake-utils eutils flag-o-matic git-r3 multilib multilib-minimal \ + python-r1 toolchain-funcs pax-utils check-reqs DESCRIPTION="Low Level Virtual Machine" HOMEPAGE="http://llvm.org/" @@ -65,10 +65,6 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE} # so why did it call itself ninja in the first place? CMAKE_MAKEFILE_GENERATOR=emake -MULTILIB_CHOST_TOOLS=( - /usr/bin/llvm-config -) - pkg_pretend() { # in megs # !clang !debug !multitarget -O2 400 @@ -375,15 +371,25 @@ multilib_src_install() { local MAKEARGS set_makeargs - local root=${D}/_${ABI} + emake "${MAKEARGS[@]}" DESTDIR="${D}" install - emake "${MAKEARGS[@]}" DESTDIR="${root}" install - multibuild_merge_root "${root}" "${D}" + # Preserve ABI-variant of llvm-config. + dodir /tmp + mv "${ED}"/usr/bin/llvm-config "${ED}"/tmp/"${CHOST}"-llvm-config || die if ! multilib_build_binaries; then + # Drop all the executables since LLVM doesn't like to + # clobber when installing. + rm -r "${ED}"/usr/bin || die + # Backwards compat, will be happily removed someday. - dosym "${CHOST}"-llvm-config /usr/bin/llvm-config.${ABI} + dosym "${CHOST}"-llvm-config /tmp/llvm-config.${ABI} else + # Move files back. + mv "${ED}"/tmp/*llvm-config* "${ED}"/usr/bin || die + # Create a symlink for host's llvm-config. + dosym "${CHOST}"-llvm-config /usr/bin/llvm-config + # Install docs. doman "${S}"/docs/_build/man/*.1 use clang && doman "${T}"/clang.1 |