1 |
commit: 52b4c3988313f8f4875ff6d12236c0b6120bb46f |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 1 06:59:20 2016 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 1 13:05:54 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52b4c398 |
7 |
|
8 |
sys-devel/llvm: Backport uncond wrapper install to 3.9.0 |
9 |
|
10 |
sys-devel/llvm/llvm-3.9.0.ebuild | 76 +++++++++++++++++----------------------- |
11 |
1 file changed, 33 insertions(+), 43 deletions(-) |
12 |
|
13 |
diff --git a/sys-devel/llvm/llvm-3.9.0.ebuild b/sys-devel/llvm/llvm-3.9.0.ebuild |
14 |
index a5269d3..8ead13e 100644 |
15 |
--- a/sys-devel/llvm/llvm-3.9.0.ebuild |
16 |
+++ b/sys-devel/llvm/llvm-3.9.0.ebuild |
17 |
@@ -426,18 +426,6 @@ src_install() { |
18 |
) |
19 |
|
20 |
if use clang; then |
21 |
- # note: magic applied in multilib_src_install()! |
22 |
- CLANG_VERSION=${PV%.*} |
23 |
- |
24 |
- MULTILIB_CHOST_TOOLS+=( |
25 |
- /usr/bin/clang |
26 |
- /usr/bin/clang++ |
27 |
- /usr/bin/clang-cl |
28 |
- /usr/bin/clang-${CLANG_VERSION} |
29 |
- /usr/bin/clang++-${CLANG_VERSION} |
30 |
- /usr/bin/clang-cl-${CLANG_VERSION} |
31 |
- ) |
32 |
- |
33 |
MULTILIB_WRAPPED_HEADERS+=( |
34 |
/usr/include/clang/Config/config.h |
35 |
) |
36 |
@@ -445,29 +433,11 @@ src_install() { |
37 |
|
38 |
multilib-minimal_src_install |
39 |
|
40 |
- # Remove unnecessary headers on FreeBSD, bug #417171 |
41 |
- if use kernel_FreeBSD && use clang; then |
42 |
- rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die |
43 |
- fi |
44 |
-} |
45 |
- |
46 |
-multilib_src_install() { |
47 |
- cmake-utils_src_install |
48 |
- |
49 |
- if multilib_is_native_abi; then |
50 |
- # Symlink the gold plugin. |
51 |
- if use gold; then |
52 |
- dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins" |
53 |
- dosym "../../../../$(get_libdir)/LLVMgold.so" \ |
54 |
- "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so" |
55 |
- fi |
56 |
- fi |
57 |
- |
58 |
- # apply CHOST and CLANG_VERSION to clang executables |
59 |
- # they're statically linked so we don't have to worry about the lib |
60 |
if use clang; then |
61 |
+ # Apply CHOST and version suffix to clang tools |
62 |
+ local clang_version=${PV%.*} |
63 |
local clang_tools=( clang clang++ clang-cl ) |
64 |
- local i |
65 |
+ local abi i |
66 |
|
67 |
# cmake gives us: |
68 |
# - clang-X.Y |
69 |
@@ -477,24 +447,44 @@ multilib_src_install() { |
70 |
# - clang-X.Y |
71 |
# - clang++-X.Y, clang-cl-X.Y -> clang-X.Y |
72 |
# - clang, clang++, clang-cl -> clang*-X.Y |
73 |
- # so we need to fix the two tools |
74 |
+ # also in CHOST variant |
75 |
for i in "${clang_tools[@]:1}"; do |
76 |
rm "${ED%/}/usr/bin/${i}" || die |
77 |
- dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}" |
78 |
- dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}" |
79 |
+ dosym "clang-${clang_version}" "/usr/bin/${i}-${clang_version}" |
80 |
+ dosym "${i}-${clang_version}" "/usr/bin/${i}" |
81 |
done |
82 |
|
83 |
- # now prepend ${CHOST} and let the multilib-build.eclass symlink it |
84 |
- if ! multilib_is_native_abi; then |
85 |
- # non-native? let's replace it with a simple wrapper |
86 |
+ # now create wrappers for all supported ABIs |
87 |
+ for abi in $(get_all_abis); do |
88 |
+ local abi_flags=$(get_abi_CFLAGS "${abi}") |
89 |
+ local abi_chost=$(get_abi_CHOST "${abi}") |
90 |
for i in "${clang_tools[@]}"; do |
91 |
- rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die |
92 |
- cat > "${T}"/wrapper.tmp <<-_EOF_ |
93 |
+ cat > "${T}"/wrapper.tmp <<-_EOF_ || die |
94 |
#!${EPREFIX}/bin/sh |
95 |
- exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}" |
96 |
+ exec "${i}-${clang_version}" ${abi_flags} "\${@}" |
97 |
_EOF_ |
98 |
- newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}" |
99 |
+ newbin "${T}"/wrapper.tmp "${abi_chost}-${i}-${clang_version}" |
100 |
+ dosym "${abi_chost}-${i}-${clang_version}" \ |
101 |
+ "/usr/bin/${abi_chost}-${i}" |
102 |
done |
103 |
+ done |
104 |
+ fi |
105 |
+ |
106 |
+ # Remove unnecessary headers on FreeBSD, bug #417171 |
107 |
+ if use kernel_FreeBSD && use clang; then |
108 |
+ rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die |
109 |
+ fi |
110 |
+} |
111 |
+ |
112 |
+multilib_src_install() { |
113 |
+ cmake-utils_src_install |
114 |
+ |
115 |
+ if multilib_is_native_abi; then |
116 |
+ # Symlink the gold plugin. |
117 |
+ if use gold; then |
118 |
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins" |
119 |
+ dosym "../../../../$(get_libdir)/LLVMgold.so" \ |
120 |
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so" |
121 |
fi |
122 |
fi |
123 |
} |