commit: 7e9333237199d0e062d94e4ca026cb41b9dcb28f Author: Yuta Satoh <nigoro.dev <AT> gmail <DOT> com> AuthorDate: Mon Feb 8 11:48:04 2016 +0000 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> CommitDate: Mon Feb 8 11:48:04 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e933323
sys-devel/llvm: Re add the code for Gentoo/FreeBSD. Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=417171 ...{llvm-3.8.0_rc1.ebuild => llvm-3.7.1-r1.ebuild} | 83 ++++++++++++++++------ sys-devel/llvm/llvm-3.8.0_rc1.ebuild | 6 +- sys-devel/llvm/llvm-9999.ebuild | 6 +- 3 files changed, 73 insertions(+), 22 deletions(-) diff --git a/sys-devel/llvm/llvm-3.8.0_rc1.ebuild b/sys-devel/llvm/llvm-3.7.1-r1.ebuild similarity index 86% copy from sys-devel/llvm/llvm-3.8.0_rc1.ebuild copy to sys-devel/llvm/llvm-3.7.1-r1.ebuild index 613a5fa..97e8e20 100644 --- a/sys-devel/llvm/llvm-3.8.0_rc1.ebuild +++ b/sys-devel/llvm/llvm-3.7.1-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -12,18 +12,19 @@ inherit check-reqs cmake-utils eutils flag-o-matic multilib \ DESCRIPTION="Low Level Virtual Machine" HOMEPAGE="http://llvm.org/" -SRC_URI="http://llvm.org/pre-releases/${PV/_rc*}/${PV/3.8.0_}/${P/_}.src.tar.xz - clang? ( http://llvm.org/pre-releases/${PV/_rc*}/${PV/3.8.0_}/compiler-rt-${PV/_}.src.tar.xz - http://llvm.org/pre-releases/${PV/_rc*}/${PV/3.8.0_}/cfe-${PV/_}.src.tar.xz - http://llvm.org/pre-releases/${PV/_rc*}/${PV/3.8.0_}/clang-tools-extra-${PV/_}.src.tar.xz ) - lldb? ( http://llvm.org/pre-releases/${PV/_rc*}/${PV/3.8.0_}/lldb-${PV/_}.src.tar.xz ) - !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P/_rc*}-manpages.tar.bz2 )" +SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz + clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz + http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz + http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz ) + lldb? ( http://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz ) + !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${PN}-3.7.0-manpages.tar.bz2 )" LICENSE="UoI-NCSA" SLOT="0/${PV}" 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" IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml - python +static-analyzer test xml video_cards_radeon kernel_Darwin" + python +static-analyzer test xml video_cards_radeon + kernel_Darwin kernel_FreeBSD" COMMON_DEPEND=" sys-libs/zlib:0= @@ -166,12 +167,12 @@ src_prepare() { # https://llvm.org/bugs/show_bug.cgi?id=18341 epatch "${FILESDIR}"/cmake/0004-cmake-Do-not-install-libgtest.patch - # Allow custom cmake build types (like 'Gentoo') - epatch "${FILESDIR}"/cmake/${PN}-3.8-allow_custom_cmake_build_types.patch - # Fix llvm-config for shared linking and sane flags # https://bugs.gentoo.org/show_bug.cgi?id=565358 - epatch "${FILESDIR}"/llvm-3.8-llvm-config.patch + epatch "${FILESDIR}"/llvm-3.7-llvm-config.patch + + # Fix msan with newer kernels, #569894 + epatch "${FILESDIR}"/llvm-3.7-msan-fix.patch # disable use of SDK on OSX, bug #568758 sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die @@ -180,20 +181,22 @@ src_prepare() { # Automatically select active system GCC's libraries, bugs #406163 and #417913 epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch + epatch "${FILESDIR}"/clang-3.6-gentoo-install.patch + epatch "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp sed -i -e "s^@EPREFIX@^${EPREFIX}^" \ - tools/clang/tools/scan-build/bin/scan-build || die + tools/clang/tools/scan-build/scan-build || die # Install clang runtime into /usr/lib/clang # https://llvm.org/bugs/show_bug.cgi?id=23792 - epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix-3.8.patch + epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch epatch "${FILESDIR}"/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch # Do not force -march flags on arm platforms # https://bugs.gentoo.org/show_bug.cgi?id=562706 - epatch "${FILESDIR}"/cmake/${PN}-3.8.0-compiler_rt_arm_march_flags.patch + epatch "${FILESDIR}"/cmake/${PN}-3.7.0-compiler_rt_arm_march_flags.patch # Make it possible to override CLANG_LIBDIR_SUFFIX # (that is used only to find LLVMgold.so) @@ -202,6 +205,9 @@ src_prepare() { pushd projects/compiler-rt >/dev/null || die + # Fix msan with newer kernels, compiler-rt part, #569894 + epatch "${FILESDIR}"/compiler-rt-3.7-msan-fix.patch + # Fix WX sections, bug #421527 find lib/builtins -type f -name '*.S' -exec sed \ -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \ @@ -215,6 +221,15 @@ src_prepare() { # https://llvm.org/bugs/show_bug.cgi?id=18841 sed -e 's/add_subdirectory(readline)/#&/' \ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die + + # Fix Python paths, bugs #562436 and #562438 + epatch "${FILESDIR}"/${PN}-3.7-lldb_python.patch + sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \ + -i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die + + # Fix build with ncurses[tinfo], #560474 + # http://llvm.org/viewvc/llvm-project?view=revision&revision=247842 + epatch "${FILESDIR}"/cmake/${PN}-3.7.0-lldb_tinfo.patch fi # User patches @@ -246,7 +261,7 @@ multilib_src_configure() { "${mycmakeargs[@]}" -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - -DLLVM_LINK_LLVM_DYLIB=ON + -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_TARGETS_TO_BUILD="${targets}" -DLLVM_BUILD_TESTS=$(usex test) @@ -416,6 +431,9 @@ src_install() { fi 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() { @@ -423,7 +441,7 @@ multilib_src_install() { if multilib_is_native_abi; then # Install man pages. - use doc || doman "${WORKDIR}"/${P/_rc*}-manpages/*.1 + use doc || doman "${WORKDIR}"/${PN}-3.7.0-manpages/*.1 # Symlink the gold plugin. if use gold; then @@ -478,6 +496,31 @@ multilib_src_install_all() { if use clang; then pushd tools/clang >/dev/null || die + if use static-analyzer ; then + pushd tools/scan-build >/dev/null || die + + dobin ccc-analyzer scan-build + dosym ccc-analyzer /usr/bin/c++-analyzer + doman scan-build.1 + + insinto /usr/share/llvm + doins scanview.css sorttable.js + + popd >/dev/null || die + fi + + 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 *.py Resources + + popd >/dev/null || die + fi + if use python ; then pushd bindings/python/clang >/dev/null || die @@ -493,14 +536,14 @@ multilib_src_install_all() { popd >/dev/null || die python_fix_shebang "${ED}" - if use static-analyzer; then - python_optimize "${ED}"usr/share/scan-view + if use lldb && use python; then + python_optimize fi fi } pkg_postinst() { - if use clang && ! has_version 'sys-libs/libomp'; then + if use clang && ! has_version sys-libs/libomp; then elog "To enable OpenMP support in clang, install sys-libs/libomp." fi } diff --git a/sys-devel/llvm/llvm-3.8.0_rc1.ebuild b/sys-devel/llvm/llvm-3.8.0_rc1.ebuild index 613a5fa..8c598b7 100644 --- a/sys-devel/llvm/llvm-3.8.0_rc1.ebuild +++ b/sys-devel/llvm/llvm-3.8.0_rc1.ebuild @@ -23,7 +23,8 @@ LICENSE="UoI-NCSA" SLOT="0/${PV}" 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" IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml - python +static-analyzer test xml video_cards_radeon kernel_Darwin" + python +static-analyzer test xml video_cards_radeon + kernel_Darwin kernel_FreeBSD" COMMON_DEPEND=" sys-libs/zlib:0= @@ -416,6 +417,9 @@ src_install() { fi 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() { diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild index c0f1cfc..369c227 100644 --- a/sys-devel/llvm/llvm-9999.ebuild +++ b/sys-devel/llvm/llvm-9999.ebuild @@ -20,7 +20,8 @@ LICENSE="UoI-NCSA" SLOT="0/${PV}" KEYWORDS="" IUSE="clang debug +doc gold libedit +libffi lldb multitarget ncurses ocaml - python +static-analyzer test xml video_cards_radeon kernel_Darwin" + python +static-analyzer test xml video_cards_radeon + kernel_Darwin kernel_FreeBSD" COMMON_DEPEND=" sys-libs/zlib:0= @@ -393,6 +394,9 @@ src_install() { fi 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() {