summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2016-02-04 14:51:12 +0100
committerFabian Groffen <grobian@gentoo.org>2016-02-04 14:51:42 +0100
commitac229ee43b4c0e763d1968a5496490056a5502f7 (patch)
treef5120074e06363b03f1539e809ff4bbee16429b1 /sys-devel
parentapp-editors/emacs: add alpha keyword (diff)
downloadgentoo-ac229ee43b4c0e763d1968a5496490056a5502f7.tar.gz
gentoo-ac229ee43b4c0e763d1968a5496490056a5502f7.tar.bz2
gentoo-ac229ee43b4c0e763d1968a5496490056a5502f7.zip
sys-devel/llvm: add CHOST-clang wrappers to 3.4.2 too for Prefix bootstrap
Package-Manager: portage-2.2.20-prefix
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/llvm/llvm-3.4.2.ebuild28
1 files changed, 28 insertions, 0 deletions
diff --git a/sys-devel/llvm/llvm-3.4.2.ebuild b/sys-devel/llvm/llvm-3.4.2.ebuild
index 5268c28b23e..c2ef13a7f72 100644
--- a/sys-devel/llvm/llvm-3.4.2.ebuild
+++ b/sys-devel/llvm/llvm-3.4.2.ebuild
@@ -445,6 +445,34 @@ multilib_src_install() {
fi
fi
+ # apply CHOST and PV to clang executables
+ # they're statically linked so we don't have to worry about the lib
+ if use clang; then
+ local clang_tools=( clang clang++ )
+ local i
+
+ # append ${PV} and symlink back
+ # TODO: use alternatives.eclass? does that make any sense?
+ # maybe with USE=-clang on :0 and USE=clang on older
+ for i in "${clang_tools[@]}"; do
+ mv "${ED%/}/usr/bin/${i}"{,-${PV}} || die
+ dosym "${i}"-${PV} /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
+ for i in "${clang_tools[@]}"; do
+ rm "${ED%/}/usr/bin/${i}-${PV}" || die
+ cat > "${T}"/wrapper.tmp <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec "${i}-${PV}" $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+ newbin "${T}"/wrapper.tmp "${i}-${PV}"
+ done
+ fi
+ 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= ndylib= libpv=${PV}