diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-01-30 09:10:03 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-02-15 13:47:17 +0100 |
commit | 9563cd26049e21cd10b23372a1e58ef501bcf960 (patch) | |
tree | 7c47c77d980ba5b6687559cdb82858f9b5b77439 /sys-libs | |
parent | sys-libs/compiler-rt: Add slotted version (diff) | |
download | gentoo-9563cd26049e21cd10b23372a1e58ef501bcf960.tar.gz gentoo-9563cd26049e21cd10b23372a1e58ef501bcf960.tar.bz2 gentoo-9563cd26049e21cd10b23372a1e58ef501bcf960.zip |
sys-libs/compiler-rt-sanitizers: Add slotted version
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.0_rc1-r1.ebuild (renamed from sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.0_rc1.ebuild) | 48 | ||||
-rw-r--r-- | sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild | 48 |
2 files changed, 44 insertions, 52 deletions
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.0_rc1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.0_rc1-r1.ebuild index e80334139e90..679d166d733f 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.0_rc1.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-4.0.0_rc1-r1.ebuild @@ -9,7 +9,7 @@ EAPI=6 CMAKE_MIN_VERSION=3.7.0-r1 PYTHON_COMPAT=( python2_7 ) -inherit cmake-utils flag-o-matic python-any-r1 +inherit cmake-utils flag-o-matic python-any-r1 versionator DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" HOMEPAGE="http://llvm.org/" @@ -17,23 +17,22 @@ SRC_URI="http://www.llvm.org/pre-releases/${PV/_//}/compiler-rt-${PV/_/}.src.tar test? ( http://www.llvm.org/pre-releases/${PV/_//}/llvm-${PV/_/}.src.tar.xz )" LICENSE="|| ( UoI-NCSA MIT )" -SLOT="0/${PV%.*}" +SLOT="${PV%_*}" KEYWORDS="~amd64 ~arm64 ~x86" IUSE="test" -RDEPEND="!<sys-devel/llvm-${PV}" +LLVM_SLOT=${SLOT%%.*} +RDEPEND="!=sys-libs/compiler-rt-sanitizers-${SLOT}*:0" # llvm-4 needed for --cmakedir -DEPEND="${RDEPEND} +DEPEND=" >=sys-devel/llvm-4 test? ( app-portage/unsandbox $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") - ~sys-devel/clang-${PV} - ~sys-libs/compiler-rt-${PV} ) + =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} + sys-libs/compiler-rt:${SLOT} ) ${PYTHON_DEPS}" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - S=${WORKDIR}/compiler-rt-${PV/_/}.src # least intrusive of all @@ -51,14 +50,11 @@ src_configure() { # pre-set since we need to pass it to cmake BUILD_DIR=${WORKDIR}/${P}_build - local llvm_version=$(llvm-config --version) || die - local clang_version=$(get_version_component_range 1-3 "${llvm_version}") - local libdir=$(get_libdir) local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${clang_version}" + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" # use a build dir structure consistent with install # this makes it possible to easily deploy test-friendly clang - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${clang_version}" + -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}" -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) # built-ins installed by sys-libs/compiler-rt @@ -72,8 +68,8 @@ src_configure() { -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit" # they are created during src_test() - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/bin/clang++" + -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++" ) # same flags are passed for build & tests, so we need to strip @@ -84,23 +80,23 @@ src_configure() { cmake-utils_src_configure if use test; then - local sys_dir=( "${EPREFIX}/usr/lib/clang/${clang_version}/lib"/* ) + local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* ) [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[@]}" + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" # copy clang over since resource_dir is located relatively to binary # therefore, we can put our new libraries in it - mkdir -p "${BUILD_DIR}"/{bin,$(get_libdir),lib/clang/"${clang_version}"/include} || die - cp "${EPREFIX}/usr/bin/clang" "${EPREFIX}/usr/bin/clang++" \ - "${BUILD_DIR}"/bin/ || die - cp "${EPREFIX}/usr/lib/clang/${clang_version}/include"/*.h \ - "${BUILD_DIR}/lib/clang/${clang_version}/include/" || die + mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die + cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \ + "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die + cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \ + "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die cp "${sys_dir}"/*builtins*.a \ - "${BUILD_DIR}/lib/clang/${clang_version}/lib/${sys_dir##*/}/" || die + "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die # we also need LLVMgold.so for gold-based tests - if [[ -f ${EPREFIX}/usr/$(get_libdir)/LLVMgold.so ]]; then - ln -s "${EPREFIX}/usr/$(get_libdir)/LLVMgold.so" \ - "${BUILD_DIR}/$(get_libdir)/" || die + if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then + ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \ + "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die fi fi } diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild index 83addde69848..6e4198615177 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9999.ebuild @@ -9,7 +9,7 @@ EAPI=6 CMAKE_MIN_VERSION=3.7.0-r1 PYTHON_COMPAT=( python2_7 ) -inherit cmake-utils flag-o-matic git-r3 python-any-r1 +inherit cmake-utils flag-o-matic git-r3 python-any-r1 versionator DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" HOMEPAGE="http://llvm.org/" @@ -18,23 +18,22 @@ EGIT_REPO_URI="http://llvm.org/git/compiler-rt.git https://github.com/llvm-mirror/compiler-rt.git" LICENSE="|| ( UoI-NCSA MIT )" -SLOT="0/${PV%.*}" +# Note: this needs to be updated to match version of clang-9999 +SLOT="5.0.0" KEYWORDS="" IUSE="test" -RDEPEND="!<sys-devel/llvm-${PV}" +LLVM_SLOT=${SLOT%%.*} # llvm-4 needed for --cmakedir -DEPEND="${RDEPEND} +DEPEND=" >=sys-devel/llvm-4 test? ( app-portage/unsandbox $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") - ~sys-devel/clang-${PV} - ~sys-libs/compiler-rt-${PV} ) + =sys-devel/clang-${PV%_*}*:${LLVM_SLOT} + sys-libs/compiler-rt:${SLOT} ) ${PYTHON_DEPS}" -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - # least intrusive of all CMAKE_BUILD_TYPE=RelWithDebInfo @@ -57,14 +56,11 @@ src_configure() { # pre-set since we need to pass it to cmake BUILD_DIR=${WORKDIR}/${P}_build - local llvm_version=$(llvm-config --version) || die - local clang_version=$(get_version_component_range 1-3 "${llvm_version}") - local libdir=$(get_libdir) local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${clang_version}" + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${SLOT}" # use a build dir structure consistent with install # this makes it possible to easily deploy test-friendly clang - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${clang_version}" + -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${SLOT}" -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) # built-ins installed by sys-libs/compiler-rt @@ -78,8 +74,8 @@ src_configure() { -DLIT_COMMAND="${EPREFIX}/usr/bin/unsandbox;${EPREFIX}/usr/bin/lit" # they are created during src_test() - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/bin/clang++" + -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_SLOT}/bin/clang++" ) # same flags are passed for build & tests, so we need to strip @@ -90,23 +86,23 @@ src_configure() { cmake-utils_src_configure if use test; then - local sys_dir=( "${EPREFIX}/usr/lib/clang/${clang_version}/lib"/* ) + local sys_dir=( "${EPREFIX}"/usr/lib/clang/${SLOT}/lib/* ) [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[@]}" + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" # copy clang over since resource_dir is located relatively to binary # therefore, we can put our new libraries in it - mkdir -p "${BUILD_DIR}"/{bin,$(get_libdir),lib/clang/"${clang_version}"/include} || die - cp "${EPREFIX}/usr/bin/clang" "${EPREFIX}/usr/bin/clang++" \ - "${BUILD_DIR}"/bin/ || die - cp "${EPREFIX}/usr/lib/clang/${clang_version}/include"/*.h \ - "${BUILD_DIR}/lib/clang/${clang_version}/include/" || die + mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die + cp "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/bin/clang{,++} \ + "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/bin/ || die + cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \ + "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die cp "${sys_dir}"/*builtins*.a \ - "${BUILD_DIR}/lib/clang/${clang_version}/lib/${sys_dir##*/}/" || die + "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die # we also need LLVMgold.so for gold-based tests - if [[ -f ${EPREFIX}/usr/$(get_libdir)/LLVMgold.so ]]; then - ln -s "${EPREFIX}/usr/$(get_libdir)/LLVMgold.so" \ - "${BUILD_DIR}/$(get_libdir)/" || die + if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so ]]; then + ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_SLOT}/$(get_libdir)/LLVMgold.so \ + "${BUILD_DIR}"/lib/llvm/${LLVM_SLOT}/$(get_libdir)/ || die fi fi } |