1 |
commit: 25cb8d050c81a4afc69c10bdd5049eecfe6b8524 |
2 |
Author: Alex R <lyssdod <AT> gmail <DOT> com> |
3 |
AuthorDate: Sun Jul 4 22:57:31 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jul 5 05:40:07 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25cb8d05 |
7 |
|
8 |
sys-libs/llvm-libunwind: use compiler-rt if possible |
9 |
|
10 |
Signed-off-by: Alex Revin <lyssdod <AT> gmail.com> |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
sys-libs/llvm-libunwind/llvm-libunwind-12.0.0.ebuild | 16 +++++++++++++++- |
14 |
.../llvm-libunwind/llvm-libunwind-12.0.1.9999.ebuild | 16 +++++++++++++++- |
15 |
sys-libs/llvm-libunwind/llvm-libunwind-12.0.1_rc2.ebuild | 16 +++++++++++++++- |
16 |
.../llvm-libunwind/llvm-libunwind-13.0.0.9999.ebuild | 16 +++++++++++++++- |
17 |
4 files changed, 60 insertions(+), 4 deletions(-) |
18 |
|
19 |
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.0.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.0.ebuild |
20 |
index 0f82c1251fa..7d7b9833902 100644 |
21 |
--- a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.0.ebuild |
22 |
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.0.ebuild |
23 |
@@ -5,7 +5,7 @@ EAPI=7 |
24 |
|
25 |
CMAKE_ECLASS=cmake |
26 |
PYTHON_COMPAT=( python3_{7..9} ) |
27 |
-inherit cmake-multilib llvm llvm.org python-any-r1 |
28 |
+inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
29 |
|
30 |
DESCRIPTION="C++ runtime stack unwinder from LLVM" |
31 |
HOMEPAGE="https://github.com/llvm-mirror/libunwind" |
32 |
@@ -38,8 +38,19 @@ pkg_setup() { |
33 |
} |
34 |
|
35 |
multilib_src_configure() { |
36 |
+ local use_compiler_rt=OFF |
37 |
local libdir=$(get_libdir) |
38 |
|
39 |
+ # link to compiler-rt |
40 |
+ # https://github.com/gentoo/gentoo/pull/21516 |
41 |
+ if tc-is-clang; then |
42 |
+ local compiler-rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
43 |
+ ${LD_FLAGS} -print-libgcc-file-name) |
44 |
+ if [[ ${compiler_rt} == *libclang_rt* ]]; then |
45 |
+ use_compiler_rt=ON |
46 |
+ fi |
47 |
+ fi |
48 |
+ |
49 |
local mycmakeargs=( |
50 |
-DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
51 |
-DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) |
52 |
@@ -49,6 +60,9 @@ multilib_src_configure() { |
53 |
# support non-native unwinding; given it's small enough, |
54 |
# enable it unconditionally |
55 |
-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON |
56 |
+ |
57 |
+ # avoid dependency on libgcc_s if compiler-rt is used |
58 |
+ -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} |
59 |
) |
60 |
if use test; then |
61 |
local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
62 |
|
63 |
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.9999.ebuild |
64 |
index bf538b66689..4f13111b557 100644 |
65 |
--- a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.9999.ebuild |
66 |
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1.9999.ebuild |
67 |
@@ -5,7 +5,7 @@ EAPI=7 |
68 |
|
69 |
CMAKE_ECLASS=cmake |
70 |
PYTHON_COMPAT=( python3_{7..9} ) |
71 |
-inherit cmake-multilib llvm llvm.org python-any-r1 |
72 |
+inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
73 |
|
74 |
DESCRIPTION="C++ runtime stack unwinder from LLVM" |
75 |
HOMEPAGE="https://github.com/llvm-mirror/libunwind" |
76 |
@@ -38,8 +38,19 @@ pkg_setup() { |
77 |
} |
78 |
|
79 |
multilib_src_configure() { |
80 |
+ local use_compiler_rt=OFF |
81 |
local libdir=$(get_libdir) |
82 |
|
83 |
+ # link to compiler-rt |
84 |
+ # https://github.com/gentoo/gentoo/pull/21516 |
85 |
+ if tc-is-clang; then |
86 |
+ local compiler-rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
87 |
+ ${LD_FLAGS} -print-libgcc-file-name) |
88 |
+ if [[ ${compiler_rt} == *libclang_rt* ]]; then |
89 |
+ use_compiler_rt=ON |
90 |
+ fi |
91 |
+ fi |
92 |
+ |
93 |
local mycmakeargs=( |
94 |
-DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
95 |
-DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) |
96 |
@@ -49,6 +60,9 @@ multilib_src_configure() { |
97 |
# support non-native unwinding; given it's small enough, |
98 |
# enable it unconditionally |
99 |
-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON |
100 |
+ |
101 |
+ # avoid dependency on libgcc_s if compiler-rt is used |
102 |
+ -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} |
103 |
) |
104 |
if use test; then |
105 |
local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
106 |
|
107 |
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1_rc2.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1_rc2.ebuild |
108 |
index bf538b66689..4f13111b557 100644 |
109 |
--- a/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1_rc2.ebuild |
110 |
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-12.0.1_rc2.ebuild |
111 |
@@ -5,7 +5,7 @@ EAPI=7 |
112 |
|
113 |
CMAKE_ECLASS=cmake |
114 |
PYTHON_COMPAT=( python3_{7..9} ) |
115 |
-inherit cmake-multilib llvm llvm.org python-any-r1 |
116 |
+inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
117 |
|
118 |
DESCRIPTION="C++ runtime stack unwinder from LLVM" |
119 |
HOMEPAGE="https://github.com/llvm-mirror/libunwind" |
120 |
@@ -38,8 +38,19 @@ pkg_setup() { |
121 |
} |
122 |
|
123 |
multilib_src_configure() { |
124 |
+ local use_compiler_rt=OFF |
125 |
local libdir=$(get_libdir) |
126 |
|
127 |
+ # link to compiler-rt |
128 |
+ # https://github.com/gentoo/gentoo/pull/21516 |
129 |
+ if tc-is-clang; then |
130 |
+ local compiler-rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
131 |
+ ${LD_FLAGS} -print-libgcc-file-name) |
132 |
+ if [[ ${compiler_rt} == *libclang_rt* ]]; then |
133 |
+ use_compiler_rt=ON |
134 |
+ fi |
135 |
+ fi |
136 |
+ |
137 |
local mycmakeargs=( |
138 |
-DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
139 |
-DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) |
140 |
@@ -49,6 +60,9 @@ multilib_src_configure() { |
141 |
# support non-native unwinding; given it's small enough, |
142 |
# enable it unconditionally |
143 |
-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON |
144 |
+ |
145 |
+ # avoid dependency on libgcc_s if compiler-rt is used |
146 |
+ -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} |
147 |
) |
148 |
if use test; then |
149 |
local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
150 |
|
151 |
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.9999.ebuild |
152 |
index bf538b66689..4f13111b557 100644 |
153 |
--- a/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.9999.ebuild |
154 |
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-13.0.0.9999.ebuild |
155 |
@@ -5,7 +5,7 @@ EAPI=7 |
156 |
|
157 |
CMAKE_ECLASS=cmake |
158 |
PYTHON_COMPAT=( python3_{7..9} ) |
159 |
-inherit cmake-multilib llvm llvm.org python-any-r1 |
160 |
+inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
161 |
|
162 |
DESCRIPTION="C++ runtime stack unwinder from LLVM" |
163 |
HOMEPAGE="https://github.com/llvm-mirror/libunwind" |
164 |
@@ -38,8 +38,19 @@ pkg_setup() { |
165 |
} |
166 |
|
167 |
multilib_src_configure() { |
168 |
+ local use_compiler_rt=OFF |
169 |
local libdir=$(get_libdir) |
170 |
|
171 |
+ # link to compiler-rt |
172 |
+ # https://github.com/gentoo/gentoo/pull/21516 |
173 |
+ if tc-is-clang; then |
174 |
+ local compiler-rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
175 |
+ ${LD_FLAGS} -print-libgcc-file-name) |
176 |
+ if [[ ${compiler_rt} == *libclang_rt* ]]; then |
177 |
+ use_compiler_rt=ON |
178 |
+ fi |
179 |
+ fi |
180 |
+ |
181 |
local mycmakeargs=( |
182 |
-DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
183 |
-DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) |
184 |
@@ -49,6 +60,9 @@ multilib_src_configure() { |
185 |
# support non-native unwinding; given it's small enough, |
186 |
# enable it unconditionally |
187 |
-DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON |
188 |
+ |
189 |
+ # avoid dependency on libgcc_s if compiler-rt is used |
190 |
+ -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} |
191 |
) |
192 |
if use test; then |
193 |
local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |