diff options
author | Richard Yao <ryao@gentoo.org> | 2012-06-05 02:03:46 +0000 |
---|---|---|
committer | Richard Yao <ryao@gentoo.org> | 2012-06-05 02:03:46 +0000 |
commit | 72b68b478cbf5c3c6b8d2532710fb797728a0724 (patch) | |
tree | a1093877a407c9a345a457ec011ffdc6d84e1134 /sys-devel/clang | |
parent | Dev channel bump. (diff) | |
download | historical-72b68b478cbf5c3c6b8d2532710fb797728a0724.tar.gz historical-72b68b478cbf5c3c6b8d2532710fb797728a0724.tar.bz2 historical-72b68b478cbf5c3c6b8d2532710fb797728a0724.zip |
Generalize GCC version check, which fixes bug #417913 and bug #418141
Package-Manager: portage-2.1.10.49/cvs/Linux x86_64
Diffstat (limited to 'sys-devel/clang')
-rw-r--r-- | sys-devel/clang/ChangeLog | 8 | ||||
-rw-r--r-- | sys-devel/clang/Manifest | 4 | ||||
-rw-r--r-- | sys-devel/clang/clang-3.1-r3.ebuild | 199 | ||||
-rw-r--r-- | sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch | 28 |
4 files changed, 237 insertions, 2 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog index f69260f9960b..ef49ef765adc 100644 --- a/sys-devel/clang/ChangeLog +++ b/sys-devel/clang/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-devel/clang # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.68 2012/06/05 01:33:18 ryao Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.69 2012/06/05 02:03:46 ryao Exp $ + +*clang-3.1-r3 (05 Jun 2012) + + 05 Jun 2012; Richard Yao <ryao@gentoo.org> +clang-3.1-r3.ebuild, + +files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch: + Generalize GCC version check, which fixes bug #417913 and bug #418141 05 Jun 2012; Richard Yao <ryao@gentoo.org> metadata.xml: Add self to maintainer list diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest index 0e7331d5c327..9117b9c267e4 100644 --- a/sys-devel/clang/Manifest +++ b/sys-devel/clang/Manifest @@ -13,6 +13,7 @@ AUX clang-3.1-fix_cxx_include_root.patch 1132 RMD160 68e10411c7848dcedd58707f328 AUX clang-3.1-gentoo-freebsd-fix-cxx-paths.patch 7959 RMD160 c00347f375bde4ef8c3aed9f1fe839175997fa6a SHA1 115bc02cf3ff10020da1d5fb6236ed38bf4aa635 SHA256 60e2477ff37baa3c43877a5962e39d88b1ad885f50aee418a44f53d7f5e87632 AUX clang-3.1-gentoo-freebsd-fix-lib-path.patch 646 RMD160 5c78398bf16c0cad3cc1d4c018cd8eb3dfeac30d SHA1 e9d5e4183ab8729d167afcdb7923ab8e9abe7c49 SHA256 4e0ac4fd0d5ce22d055c010d6696f8e625cfe56b10e26dc6575c81084c151751 AUX clang-3.1-gentoo-linux-fix-cxx-include.patch 836 RMD160 1ec5d07904cb6f8bac1bd6b364a23529695385ec SHA1 1e9d097f521bc1ac5ee04971442c069b07c20607 SHA256 5fa3d5094321084fdffad75492007c5f194cab2d4bb3b6d5eceaeae28ee1a1c0 +AUX clang-3.1-gentoo-runtime-gcc-detection-v2.patch 1402 RMD160 461b44ceb03a6032a61f208a0db209d148aef85d SHA1 bf583f79ecf0f2e5696ae39e953ceaf2d0ef8139 SHA256 3a3bca77dd11d7adb912e6c6f11b4cf3d4060e60e8e5475e979c118ab2dccb2c AUX clang-3.1-gentoo-runtime-gcc-detection.patch 1272 RMD160 c204c5aac4eb7be0247c65f2fee6246d63b3cb72 SHA1 a86028612d67b16d77973735028778260cbd3832 SHA256 d50176ae5aa1264bc8dd18c8e25e316d14bc0e8237e58980779d7f76d528d187 AUX clang-3.1-increase-parser-recursion-limit.patch 495 RMD160 ee36c645b66a71839fb8fef8827b51652ee0a0c2 SHA1 154f47395be58673b814c8140bde3dcb42edcc82 SHA256 a0800603a8162de3beff5cc508648d6c4f5c0b095635ec8317682b04c6ce8e95 DIST clang-2.8.tgz 5666777 RMD160 f00956b6de29cc09f3992aeabd140f2189c6cf39 SHA1 94977c84ce136307dbbeade95e67bfe3c25161ff SHA256 ed83481553e6a39a8a2953e89630d881d87833506f096a90f18d93ec2bdee0c1 @@ -29,6 +30,7 @@ EBUILD clang-2.9-r1.ebuild 6431 RMD160 cb9ed182675f9a76beb2caa0fc1fe26bfc534dd9 EBUILD clang-3.0-r4.ebuild 7155 RMD160 65d79627dfaa26bfd327dd173bb4b2b69883e4ca SHA1 ded3b2503e357a8335a816774fb4fcc4deceb50c SHA256 012f34451fdaaf2cc6947e013ba584a8df07bd37b15fb48ba436da71da436aad EBUILD clang-3.1-r1.ebuild 6078 RMD160 9240f45ff4f9b9fefde458968aa4002bd6409aa3 SHA1 60421abed151ce0a463b978c2d15d0236fb16d97 SHA256 92f13108a43de981b35437e9b7b68861fce5be395f313d4298b53d2e7e6999fe EBUILD clang-3.1-r2.ebuild 6504 RMD160 7b5701a3420c6fc86c4c23ec7391f4ccef5769a4 SHA1 7578a7bfc609a697724998adeaf62f09ecd67cb6 SHA256 572e92bfffd67eda07839a6a4f46469187cd5067ec98884cdc656688ea304849 +EBUILD clang-3.1-r3.ebuild 6522 RMD160 8693be517eb064780c91b0cb721c4b11500aaf3b SHA1 bf80bf19a353759e64eb45125b1f856a48a9000a SHA256 0ac56487d24d885234b58c1ae72295f2a9949edd1a278b45fb0852812f72afe4 EBUILD clang-9999.ebuild 5654 RMD160 841c52548946fbb662ecf07653d8f7d77ba83607 SHA1 f1a1639d29f9da5e775c9df29620df16168fe801 SHA256 f6c8ec9c9439859eae3f1a71d55e91fe8f51ba07249cddaaf2191898743cd7cd -MISC ChangeLog 13091 RMD160 bdf0b75c0fd9074f61da48e56b9d9db87671c979 SHA1 ea022e4b26da4e02d91c94577a56b5c91bc62856 SHA256 77d1950732a9ef5ca48c32a43b24daa88e6eab305304e5281dcc04c938132214 +MISC ChangeLog 13318 RMD160 879f41ca8508b10e3681aa6df1908c21a7c633da SHA1 a3731d5094b5af6558f69537378c92e1c0537648 SHA256 22929e32bac8772fe7d2d7aa7be180793a8e021877aa543970b8395b899297c2 MISC metadata.xml 1526 RMD160 d9a78d39d6024f98a9f7ed4bcb8479019b07e21e SHA1 d4aac42fd7d0cbc6570d0cadd0666eda7a3f8bf5 SHA256 142d229331f82d741b95b794866ca22b753722efd86d5d0e054f69cb5286f4bb diff --git a/sys-devel/clang/clang-3.1-r3.ebuild b/sys-devel/clang/clang-3.1-r3.ebuild new file mode 100644 index 000000000000..33daa251a623 --- /dev/null +++ b/sys-devel/clang/clang-3.1-r3.ebuild @@ -0,0 +1,199 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-3.1-r3.ebuild,v 1.1 2012/06/05 02:03:46 ryao Exp $ + +EAPI=4 + +RESTRICT_PYTHON_ABIS="3.*" +SUPPORT_PYTHON_ABIS="1" + +inherit eutils multilib python + +DESCRIPTION="C language family frontend for LLVM" +HOMEPAGE="http://clang.llvm.org/" +# Fetching LLVM as well: see http://llvm.org/bugs/show_bug.cgi?id=4840 +SRC_URI="http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz + http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.gz + http://llvm.org/releases/${PV}/${P}.src.tar.gz" + +LICENSE="UoI-NCSA" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="debug kernel_FreeBSD multitarget +static-analyzer test" + +DEPEND="static-analyzer? ( dev-lang/perl )" +RDEPEND="~sys-devel/llvm-${PV}[multitarget=]" + +S=${WORKDIR}/llvm-${PV}.src + +src_prepare() { + mv "${WORKDIR}"/clang-${PV}.src "${S}"/tools/clang \ + || die "clang source directory move failed" + mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \ + || die "compiler-rt source directory move failed" + + # Same as llvm doc patches + epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch + + # multilib-strict + sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \ + -i tools/clang/lib/Headers/Makefile \ + || die "clang Makefile failed" + sed -e "/PROJ_resources/s#lib/clang#$(get_libdir)/clang#" \ + -i tools/clang/runtime/compiler-rt/Makefile \ + || die "compiler-rt Makefile failed" + # fix the static analyzer for in-tree install + sed -e 's/import ScanView/from clang \0/' \ + -i tools/clang/tools/scan-view/scan-view \ + || die "scan-view sed failed" + sed -e "/scanview.css\|sorttable.js/s#\$RealBin#${EPREFIX}/usr/share/${PN}#" \ + -i tools/clang/tools/scan-build/scan-build \ + || die "scan-build sed failed" + # Set correct path for gold plugin + sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \ + -i tools/clang/lib/Driver/Tools.cpp \ + || die "gold plugin path sed failed" + # Specify python version + python_convert_shebangs 2 tools/clang/tools/scan-view/scan-view + python_convert_shebangs -r 2 test/Scripts + python_convert_shebangs 2 projects/compiler-rt/lib/asan/scripts/asan_symbolize.py + + # From llvm src_prepare + einfo "Fixing install dirs" + sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \ + -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \ + -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/llvm, \ + -i Makefile.config.in || die "Makefile.config sed failed" + + einfo "Fixing rpath and CFLAGS" + sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/llvm, \ + -e '/OmitFramePointer/s/-fomit-frame-pointer//' \ + -i Makefile.rules || die "rpath sed failed" + + # Use system llc (from llvm ebuild) for tests + sed -e "/^llc_props =/s/os.path.join(llvm_tools_dir, 'llc')/'llc'/" \ + -i tools/clang/test/lit.cfg || die "test path sed failed" + + # Automatically select active system GCC's libraries, bugs #406163, #417913, #418141 + epatch "${FILESDIR}"/${P}-gentoo-runtime-gcc-detection-v2.patch + + # Fix search paths on FreeBSD, bug #409269 + epatch "${FILESDIR}"/${P}-gentoo-freebsd-fix-lib-path.patch + + # Fix regression caused by removal of USE=system-cxx-headers, bug #417541 + epatch "${FILESDIR}"/${P}-gentoo-freebsd-fix-cxx-paths.patch + + # Fix regression that prevents Clang from building itself on Linux, bug #417537 + epatch "${FILESDIR}"/${P}-gentoo-linux-fix-cxx-include.patch + + # Increase recursion limit, bug #417545, upstream r155737 + epatch "${FILESDIR}"/${P}-increase-parser-recursion-limit.patch + + # User patches + epatch_user +} + +src_configure() { + local CONF_FLAGS="--enable-shared + --with-optimize-option= + $(use_enable !debug optimized) + $(use_enable debug assertions) + $(use_enable debug expensive-checks)" + + # Setup the search path to include the Prefix includes + if use prefix ; then + CONF_FLAGS="${CONF_FLAGS} \ + --with-c-include-dirs=${EPREFIX}/usr/include:/usr/include" + fi + + if use multitarget; then + CONF_FLAGS="${CONF_FLAGS} --enable-targets=all" + else + CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only" + fi + + if use amd64; then + CONF_FLAGS="${CONF_FLAGS} --enable-pic" + fi + + econf ${CONF_FLAGS} +} + +src_compile() { + emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 clang-only +} + +src_test() { + cd "${S}"/test || die "cd failed" + emake site.exp + + cd "${S}"/tools/clang || die "cd clang failed" + + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + + testing() { + if ! emake -j1 VERBOSE=1 test; then + has test $FEATURES && die "Make test failed. See above for details." + has test $FEATURES || eerror "Make test failed. See above for details." + fi + } + python_execute_function testing +} + +src_install() { + cd "${S}"/tools/clang || die "cd clang failed" + emake KEEP_SYMBOLS=1 DESTDIR="${D}" install + + 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 + + cd tools/scan-view || die "cd scan-view failed" + dobin scan-view + install-scan-view() { + insinto "$(python_get_sitedir)"/clang + doins Reporter.py Resources ScanView.py startfile.py + touch "${ED}"/"$(python_get_sitedir)"/clang/__init__.py + } + python_execute_function install-scan-view + fi + + # Fix install_names on Darwin. The build system is too complicated + # to just fix this, so we correct it post-install + if [[ ${CHOST} == *-darwin* ]] ; then + for lib in libclang.dylib ; do + ebegin "fixing install_name of $lib" + install_name_tool -id "${EPREFIX}"/usr/lib/llvm/${lib} \ + "${ED}"/usr/lib/llvm/${lib} + eend $? + done + for f in usr/bin/{c-index-test,clang} usr/lib/llvm/libclang.dylib ; do + ebegin "fixing references in ${f##*/}" + install_name_tool \ + -change "@rpath/libclang.dylib" \ + "${EPREFIX}"/usr/lib/llvm/libclang.dylib \ + -change "@executable_path/../lib/libLLVM-${PV}.dylib" \ + "${EPREFIX}"/usr/lib/llvm/libLLVM-${PV}.dylib \ + -change "${S}"/Release/lib/libclang.dylib \ + "${EPREFIX}"/usr/lib/llvm/libclang.dylib \ + "${ED}"/$f + eend $? + done + fi + + # Remove unnecessary headers on FreeBSD, bug #417171 + use kernel_FreeBSD && rm "${ED}"usr/$(get_libdir)/clang/${PV}/include/{arm_neon,std,float,iso,limits,tgmath,varargs}*.h +} + +pkg_postinst() { + python_mod_optimize clang +} + +pkg_postrm() { + python_mod_cleanup clang +} diff --git a/sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch b/sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch new file mode 100644 index 000000000000..47d554357bd8 --- /dev/null +++ b/sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch @@ -0,0 +1,28 @@ +diff -upNr a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp +--- a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:32:31.593191000 -0400 ++++ b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:38:31.733163513 -0400 +@@ -1145,6 +1145,24 @@ Generic_GCC::GCCInstallationDetector::GC + Prefixes.push_back(D.InstalledDir + "/.."); + } + ++ llvm::OwningPtr<llvm::MemoryBuffer> File; ++ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) { ++ if (!llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str(), File)) ++ { ++ bool Exists; ++ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str(); ++ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText; ++ if (!llvm::sys::fs::exists(GentooPath + "/crtbegin.o", Exists) && Exists) ++ { ++ Version = GCCVersion::Parse(VersionText); ++ GCCInstallPath = GentooPath; ++ GCCParentLibPath = GCCInstallPath + "/../../.."; ++ IsValid = true; ++ return; ++ } ++ } ++ } ++ + // Loop over the various components which exist and select the best GCC + // installation available. GCC installs are ranked by version number. + Version = GCCVersion::Parse("0.0.0"); |