Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/
Date: Thu, 15 Sep 2022 03:15:57
Message-Id: 1663210501.55bc9f2304d70f79be3130b6ded482406b631958.gyakovlev@gentoo
1 commit: 55bc9f2304d70f79be3130b6ded482406b631958
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 15 02:51:02 2022 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 15 02:55:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55bc9f23
7
8 dev-lang/rust: add llvm-libunwind handling in 1.63.0
9
10 tested working on clang-glibc-llvm system, untested on musl, but logic
11 is the same as in PR 22221
12
13 Bug: https://bugs.gentoo.org/733242
14 PR: https://github.com/gentoo/gentoo/pull/22221
15 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
16
17 dev-lang/rust/rust-1.63.0.ebuild | 17 +++++++++++++----
18 1 file changed, 13 insertions(+), 4 deletions(-)
19
20 diff --git a/dev-lang/rust/rust-1.63.0.ebuild b/dev-lang/rust/rust-1.63.0.ebuild
21 index 55f67445ef7e..900816d560ac 100644
22 --- a/dev-lang/rust/rust-1.63.0.ebuild
23 +++ b/dev-lang/rust/rust-1.63.0.ebuild
24 @@ -41,7 +41,7 @@ LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/(-)?}
25
26 LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
27
28 -IUSE="clippy cpu_flags_x86_sse2 debug dist doc miri nightly parallel-compiler profiler rls rustfmt rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
29 +IUSE="clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind miri nightly parallel-compiler profiler rls rustfmt rust-src system-bootstrap system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
30
31 # Please keep the LLVM dependency block separate. Since LLVM is slotted,
32 # we need to *really* make sure we're not pulling more than one slot
33 @@ -105,8 +105,15 @@ DEPEND="
34 net-misc/curl:=[http2,ssl]
35 sys-libs/zlib:=
36 dev-libs/openssl:0=
37 - elibc_musl? ( sys-libs/libunwind:= )
38 - system-llvm? ( ${LLVM_DEPEND} )
39 + system-llvm? (
40 + ${LLVM_DEPEND}
41 + llvm-libunwind? ( sys-libs/llvm-libunwind:= )
42 + )
43 + !system-llvm? (
44 + !llvm-libunwind? (
45 + elibc_musl? ( sys-libs/libunwind:= )
46 + )
47 + )
48 "
49
50 RDEPEND="${DEPEND}
51 @@ -430,8 +437,10 @@ src_configure() {
52 cxx = "$(tc-getCXX)"
53 linker = "$(tc-getCC)"
54 ranlib = "$(tc-getRANLIB)"
55 + llvm-libunwind = "$(usex llvm-libunwind $(usex system-llvm system in-tree) no)"
56 _EOF_
57 - # librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
58 + # by default librustc_target/spec/linux_musl_base.rs sets base.crt_static_default = true;
59 + # but we patch it and set to false here as well
60 if use elibc_musl; then
61 cat <<- _EOF_ >> "${S}"/config.toml
62 crt-static = false