1 |
commit: 3bdbb08f39ee8ad706760eca5138470e88722510 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 26 21:44:04 2022 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 26 21:44:43 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3bdbb08f |
7 |
|
8 |
dev-lang/rust: attempt to support libcxx in 1.61.0-r1 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/732632 |
11 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
12 |
|
13 |
dev-lang/rust/rust-1.61.0-r1.ebuild | 13 ++++++++++++- |
14 |
1 file changed, 12 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/dev-lang/rust/rust-1.61.0-r1.ebuild b/dev-lang/rust/rust-1.61.0-r1.ebuild |
17 |
index 2e877f2f2bdd..250c7e2f1db2 100644 |
18 |
--- a/dev-lang/rust/rust-1.61.0-r1.ebuild |
19 |
+++ b/dev-lang/rust/rust-1.61.0-r1.ebuild |
20 |
@@ -259,7 +259,7 @@ src_prepare() { |
21 |
} |
22 |
|
23 |
src_configure() { |
24 |
- local rust_target="" rust_targets="" arch_cflags |
25 |
+ local rust_target="" rust_targets="" arch_cflags use_libcxx="false" |
26 |
|
27 |
# Collect rust target names to compile standard libs for all ABIs. |
28 |
for v in $(multilib_get_enabled_abi_pairs); do |
29 |
@@ -308,6 +308,14 @@ src_configure() { |
30 |
|
31 |
rust_target="$(rust_abi)" |
32 |
|
33 |
+ # https://bugs.gentoo.org/732632 |
34 |
+ if tc-is-clang; then |
35 |
+ local clang_slot="$(clang-major-version)" |
36 |
+ if { has_version "sys-devel/clang:${clang_slot}[default-libcxx]" || is-flagq -stdlib=libc++; }; then |
37 |
+ use_libcxx="true" |
38 |
+ fi |
39 |
+ fi |
40 |
+ |
41 |
cat <<- _EOF_ > "${S}"/config.toml |
42 |
changelog-seen = 2 |
43 |
[llvm] |
44 |
@@ -319,6 +327,7 @@ src_configure() { |
45 |
targets = "${LLVM_TARGETS// /;}" |
46 |
experimental-targets = "" |
47 |
link-shared = $(toml_usex system-llvm) |
48 |
+ use-libcxx = ${use_libcxx} |
49 |
$(case "${rust_target}" in |
50 |
i586-*-linux-*) |
51 |
# https://github.com/rust-lang/rust/issues/93059 |
52 |
@@ -326,6 +335,8 @@ src_configure() { |
53 |
echo 'cxxflags = "-fcf-protection=none"' |
54 |
echo 'ldflags = "-fcf-protection=none"' |
55 |
;; |
56 |
+ *) |
57 |
+ ;; |
58 |
esac) |
59 |
[build] |
60 |
build-stage = 2 |