diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-10-01 08:59:20 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-10-01 15:05:54 +0200 |
commit | 52b4c3988313f8f4875ff6d12236c0b6120bb46f (patch) | |
tree | 7a68d48f847fab4c0cd7ed7274f3882c9cd02f3f /sys-devel/llvm | |
parent | e42c7312d89d25ed0eb0e3d60b920db1e99c1c75 (diff) | |
download | gentoo-52b4c3988313f8f4875ff6d12236c0b6120bb46f.tar.gz gentoo-52b4c3988313f8f4875ff6d12236c0b6120bb46f.tar.xz |
sys-devel/llvm: Backport uncond wrapper install to 3.9.0
Diffstat (limited to 'sys-devel/llvm')
-rw-r--r-- | sys-devel/llvm/llvm-3.9.0.ebuild | 76 |
1 files changed, 33 insertions, 43 deletions
diff --git a/sys-devel/llvm/llvm-3.9.0.ebuild b/sys-devel/llvm/llvm-3.9.0.ebuild index a5269d33ce3..8ead13ed622 100644 --- a/sys-devel/llvm/llvm-3.9.0.ebuild +++ b/sys-devel/llvm/llvm-3.9.0.ebuild @@ -426,18 +426,6 @@ src_install() { ) if use clang; then - # note: magic applied in multilib_src_install()! - CLANG_VERSION=${PV%.*} - - MULTILIB_CHOST_TOOLS+=( - /usr/bin/clang - /usr/bin/clang++ - /usr/bin/clang-cl - /usr/bin/clang-${CLANG_VERSION} - /usr/bin/clang++-${CLANG_VERSION} - /usr/bin/clang-cl-${CLANG_VERSION} - ) - MULTILIB_WRAPPED_HEADERS+=( /usr/include/clang/Config/config.h ) @@ -445,29 +433,11 @@ src_install() { multilib-minimal_src_install - # Remove unnecessary headers on FreeBSD, bug #417171 - if use kernel_FreeBSD && use clang; then - rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die - fi -} - -multilib_src_install() { - cmake-utils_src_install - - if multilib_is_native_abi; then - # 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 - fi - - # apply CHOST and CLANG_VERSION to clang executables - # they're statically linked so we don't have to worry about the lib if use clang; then + # Apply CHOST and version suffix to clang tools + local clang_version=${PV%.*} local clang_tools=( clang clang++ clang-cl ) - local i + local abi i # cmake gives us: # - clang-X.Y @@ -477,24 +447,44 @@ multilib_src_install() { # - clang-X.Y # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y # - clang, clang++, clang-cl -> clang*-X.Y - # so we need to fix the two tools + # also in CHOST variant for i in "${clang_tools[@]:1}"; do rm "${ED%/}/usr/bin/${i}" || die - dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}" - dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}" + dosym "clang-${clang_version}" "/usr/bin/${i}-${clang_version}" + dosym "${i}-${clang_version}" "/usr/bin/${i}" done - # now prepend ${CHOST} and let the multilib-build.eclass symlink it - if ! multilib_is_native_abi; then - # non-native? let's replace it with a simple wrapper + # now create wrappers for all supported ABIs + for abi in $(get_all_abis); do + local abi_flags=$(get_abi_CFLAGS "${abi}") + local abi_chost=$(get_abi_CHOST "${abi}") for i in "${clang_tools[@]}"; do - rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die - cat > "${T}"/wrapper.tmp <<-_EOF_ + cat > "${T}"/wrapper.tmp <<-_EOF_ || die #!${EPREFIX}/bin/sh - exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}" + exec "${i}-${clang_version}" ${abi_flags} "\${@}" _EOF_ - newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}" + newbin "${T}"/wrapper.tmp "${abi_chost}-${i}-${clang_version}" + dosym "${abi_chost}-${i}-${clang_version}" \ + "/usr/bin/${abi_chost}-${i}" done + done + fi + + # Remove unnecessary headers on FreeBSD, bug #417171 + if use kernel_FreeBSD && use clang; then + rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die + fi +} + +multilib_src_install() { + cmake-utils_src_install + + if multilib_is_native_abi; then + # 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 fi } |