From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4632F158095 for ; Fri, 16 Sep 2022 00:46:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 62C81E0917; Fri, 16 Sep 2022 00:46:32 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 47B8EE0917 for ; Fri, 16 Sep 2022 00:46:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 50A9D335D35 for ; Fri, 16 Sep 2022 00:46:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9F7BC5C7 for ; Fri, 16 Sep 2022 00:46:29 +0000 (UTC) From: "Georgy Yakovlev" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Georgy Yakovlev" Message-ID: <1663289172.941cc3c5faae01bff0045d92e62da0a9689a0358.gyakovlev@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/rust/rust-1.63.0-r1.ebuild X-VCS-Directories: dev-lang/rust/ X-VCS-Committer: gyakovlev X-VCS-Committer-Name: Georgy Yakovlev X-VCS-Revision: 941cc3c5faae01bff0045d92e62da0a9689a0358 X-VCS-Branch: master Date: Fri, 16 Sep 2022 00:46:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3eaf5927-307b-482d-a297-1cd0137500e3 X-Archives-Hash: ab15b660bbadf26f189b4ce77eaef9a9 commit: 941cc3c5faae01bff0045d92e62da0a9689a0358 Author: Georgy Yakovlev gentoo org> AuthorDate: Fri Sep 16 00:17:38 2022 +0000 Commit: Georgy Yakovlev gentoo org> CommitDate: Fri Sep 16 00:46:12 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=941cc3c5 dev-lang/rust: fix bootstrap on musl systems without gcc_s After extensive debug session we can bootstrap rust with upstream tarball on clang-musl-no-gcc system Thanks-to: Arfrever Frehtes Taifersar Arahesis Apache.Org> Thanks-to: Sam James gentoo.org> Closes: https://bugs.gentoo.org/870280 Signed-off-by: Georgy Yakovlev gentoo.org> dev-lang/rust/rust-1.63.0-r1.ebuild | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dev-lang/rust/rust-1.63.0-r1.ebuild b/dev-lang/rust/rust-1.63.0-r1.ebuild index 6031ffd57528..2fdf93de9880 100644 --- a/dev-lang/rust/rust-1.63.0-r1.ebuild +++ b/dev-lang/rust/rust-1.63.0-r1.ebuild @@ -253,8 +253,29 @@ 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)" @@ -551,6 +572,7 @@ src_configure() { 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