public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: Nicolas Serafini via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>,
	Joseph Kogut <joseph.kogut@gmail.com>,
	Simon Richter <simon@sinic.eu>,
	David Pierret <david.pierret@smile.fr>,
	Danilo Bargen <mail@dbrgn.ch>, Bernd Kuhls <bernd@kuhls.net>,
	Graeme Smecher <gsmecher@threespeedlogic.com>,
	Julien Olivain <ju.o@free.fr>,
	Torben Voltmer <mail@t-voltmer.net>,
	Nicolas Serafini <nicolas.serafini@flyability.com>,
	James Hilliard <james.hilliard1@gmail.com>,
	Manuel Diener <manuel.diener@oss.othermo.de>,
	Alexander Shirokov <shirokovalexs@gmail.com>,
	Sam Voss <sam.voss@gmail.com>, Saeed Kazemi <kazemi.ms@gmail.com>,
	Alex Michel <alex.michel@wiedemann-group.com>,
	Leo Yu-Chi Liang <ycliang@andestech.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Shubham Chakraborty <chakrabortyshubham66@gmail.com>
Subject: [Buildroot] [PATCH 2/4] package/rust{, -bin}: fix bootstrap build for Rust >= 1.89.0
Date: Sat, 11 Apr 2026 00:42:19 +0200	[thread overview]
Message-ID: <20260410224221.1185631-3-nicolas.serafini@flyability.com> (raw)
In-Reply-To: <20260410224221.1185631-1-nicolas.serafini@flyability.com>

Since Rust 1.89.0, the bootstrap was redesigned (upstream PR #119899):
the stage 0 standard library is no longer built from source but copied
from the stage 0 compiler's sysroot. This breaks host-rust in two
ways.
https://github.com/rust-lang/rust/pull/119899

First, building std from source for a cross target at stage 0 now
requires build.local-rebuild to be set in config.toml. Without it,
the bootstrap refuses to proceed. Set local-rebuild = true since the
stage 0 compiler (host-rust-bin) is the same version as the compiler
being built from source.
https://github.com/rust-lang/rust/pull/145876

Second, host-rust-bin creates relative symlinks to expose the host
std libraries under its rustc component directory. The bootstrap's
copy_link_internal() copies these symlinks verbatim into the
stage0-sysroot, where the relative paths no longer resolve. Replace
them with hardlink copies (cp -al) in HOST_RUST_BIN_LIBSTD_EXTRACT.

Signed-off-by: Nicolas Serafini <nicolas.serafini@flyability.com>
---
 package/rust-bin/rust-bin.mk | 4 ++--
 package/rust/rust.mk         | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/rust-bin/rust-bin.mk b/package/rust-bin/rust-bin.mk
index aef132562c..0a1f3e5c56 100644
--- a/package/rust-bin/rust-bin.mk
+++ b/package/rust-bin/rust-bin.mk
@@ -28,8 +28,8 @@ define HOST_RUST_BIN_LIBSTD_EXTRACT
 			$(TAR) -C $(@D)/std $(TAR_OPTIONS) -
 	)
 	mkdir -p $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib
-	cd $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib; \
-		ln -sf ../../../../../$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUSTC_HOST_NAME)/lib/* .
+	cp -al $(@D)/$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUSTC_HOST_NAME)/lib/* \
+		$(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib/
 endef
 
 HOST_RUST_BIN_POST_EXTRACT_HOOKS += HOST_RUST_BIN_LIBSTD_EXTRACT
diff --git a/package/rust/rust.mk b/package/rust/rust.mk
index 27b3c49db3..8a643c4a58 100644
--- a/package/rust/rust.mk
+++ b/package/rust/rust.mk
@@ -40,6 +40,7 @@ define HOST_RUST_CONFIGURE_CMDS
 		echo 'compiler-docs = false'; \
 		echo 'docs = false'; \
 		echo 'verbose = $(HOST_RUST_VERBOSITY)'; \
+		echo 'local-rebuild = true'; \
 		echo '[install]'; \
 		echo 'prefix = "$(HOST_DIR)"'; \
 		echo 'sysconfdir = "$(HOST_DIR)/etc"'; \
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-04-10 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 22:42 [Buildroot] [PATCH 0/4] package/rust: bump to 1.94.1 and fix bootstrap Nicolas Serafini via buildroot
2026-04-10 22:42 ` [Buildroot] [PATCH 1/4] package/rust: bump version to 1.94.1 Nicolas Serafini via buildroot
2026-04-10 22:42 ` Nicolas Serafini via buildroot [this message]
2026-04-10 22:42 ` [Buildroot] [PATCH 3/4] package: update cargo suffix to -cargo5 and fix hashes Nicolas Serafini via buildroot
2026-04-10 22:42 ` [Buildroot] [PATCH 4/4] rust: add support for riscv64gc-unknown-linux-musl target Nicolas Serafini via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260410224221.1185631-3-nicolas.serafini@flyability.com \
    --to=buildroot@buildroot.org \
    --cc=alex.michel@wiedemann-group.com \
    --cc=bernd@kuhls.net \
    --cc=chakrabortyshubham66@gmail.com \
    --cc=david.pierret@smile.fr \
    --cc=eric.le.bihan.dev@free.fr \
    --cc=gsmecher@threespeedlogic.com \
    --cc=james.hilliard1@gmail.com \
    --cc=joseph.kogut@gmail.com \
    --cc=ju.o@free.fr \
    --cc=kazemi.ms@gmail.com \
    --cc=mail@dbrgn.ch \
    --cc=mail@t-voltmer.net \
    --cc=manuel.diener@oss.othermo.de \
    --cc=mika.westerberg@linux.intel.com \
    --cc=nicolas.serafini@flyability.com \
    --cc=sam.voss@gmail.com \
    --cc=shirokovalexs@gmail.com \
    --cc=simon@sinic.eu \
    --cc=ycliang@andestech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox