summaryrefslogtreecommitdiff
path: root/dev-lang/rust/rust-1.63.0-r1.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-09-16 05:14:17 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-09-16 05:14:17 +0100
commit121b314457e147271cd95353cf8886d35b329845 (patch)
treed7f2f3186727afdecbfff3bac5e3b88c84d46625 /dev-lang/rust/rust-1.63.0-r1.ebuild
parente87ef1b6ce856ae8859bdfce8028fb992f3e3763 (diff)
gentoo auto-resync : 16:09:2022 - 05:14:17
Diffstat (limited to 'dev-lang/rust/rust-1.63.0-r1.ebuild')
-rw-r--r--dev-lang/rust/rust-1.63.0-r1.ebuild27
1 files changed, 24 insertions, 3 deletions
diff --git a/dev-lang/rust/rust-1.63.0-r1.ebuild b/dev-lang/rust/rust-1.63.0-r1.ebuild
index 6031ffd57528..b5696d6d71ab 100644
--- a/dev-lang/rust/rust-1.63.0-r1.ebuild
+++ b/dev-lang/rust/rust-1.63.0-r1.ebuild
@@ -253,8 +253,28 @@ pkg_setup() {
fi
}
+esetup_unwind_hack() {
+ # https://bugs.gentoo.org/870280
+ # this is a hack needed to bootstrap with libgcc_s linked tarball on llvm-libunwind system.
+ # it should trigger for internal bootstrap or system-bootstrap with rust-bin.
+ # the whole idea is for stage0 to bootstrap with fake libgcc_s.
+ # final stage will receive -L${T}/lib but not -lgcc_s args, producing clean compiler.
+ local fakelib="${T}/fakelib"
+ mkdir -p "${fakelib}" || die
+ # we need both symlinks, one for cargo runtime, other for linker.
+ ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so.1" || die
+ ln -s "${ESYSROOT}/usr/lib/libunwind.so" "${fakelib}/libgcc_s.so" || die
+ export LD_LIBRARY_PATH="${fakelib}"
+ export RUSTFLAGS+=" -L${fakelib}"
+ # this is a literally magic variable that gets through cargo cache, without it some
+ # crates ignore RUSTFLAGS.
+ # this variable can not contain leading space.
+ export MAGIC_EXTRA_RUSTFLAGS+="${MAGIC_EXTRA_RUSTFLAGS:+ }-L${fakelib}"
+}
+
src_prepare() {
if ! use system-bootstrap; then
+ has_version sys-devel/gcc || esetup_unwind_hack
local rust_stage0_root="${WORKDIR}"/rust-stage0
local rust_stage0="rust-${RUST_STAGE0_VERSION}-$(rust_abi)"
@@ -548,9 +568,10 @@ src_configure() {
einfo "Rust configured with the following flags:"
echo
- echo RUSTFLAGS="${RUSTFLAGS:-}"
- echo RUSTFLAGS_BOOTSTRAP="${RUSTFLAGS_BOOTSTRAP:-}"
- echo RUSTFLAGS_NOT_BOOTSTRAP="${RUSTFLAGS_NOT_BOOTSTRAP:-}"
+ echo RUSTFLAGS="\"${RUSTFLAGS}\""
+ echo RUSTFLAGS_BOOTSTRAP="\"${RUSTFLAGS_BOOTSTRAP}\""
+ echo RUSTFLAGS_NOT_BOOTSTRAP="\"${RUSTFLAGS_NOT_BOOTSTRAP}\""
+ echo MAGIC_EXTRA_RUSTFLAGS="\"${MAGIC_EXTRA_RUSTFLAGS}\""
env | grep "CARGO_TARGET_.*_RUSTFLAGS="
cat "${S}"/config.env || die
echo