[Buildroot] [PATCH 1/4] package/rust: fix bootstrap with Rust≥1.83

Fiona Klute fiona.klute at gmx.de
Mon Apr 14 15:08:15 UTC 2025


Am 03.04.25 um 16:15 schrieb El Mehdi YOUNES via buildroot:
> Rust includes an option `download-ci-llvm` in config.toml that enables
> downloading prebuilt LLVM binaries from Rust's CI infrastructure instead
> of building LLVM from source. This option helps speed up the bootstrap
> process and is enabled by default starting from Rust 1.83.
>
> However, starting from commit [1] the bootstrap process performs
> a strict check via the function
> check_incompatible_options_for_ci_llvm().
>
> This validation, implemented in the function
> check_incompatible_options_for_ci_llvm(), checks for any incompatible
> custom options such as `llvm.ldflags`, `llvm.cflags`, `targets`, etc.
>
> If any of these are set locally and differ from the values used to build
> the CI-provided LLVM, the build fails immediately with the error:
>
>    ERROR: Setting `llvm.ldflags` is incompatible with
>           `llvm.download-ci-llvm`.
>
> Buildroot explicitly sets `llvm.ldflags` in rust.mk to ensure proper
> host linking during the build of host-rust. Removing this setting may
> introduce portability or reliability issues across toolchains.
>
> To address the issue without compromising the build environment, this
> patch disables the use of CI-provided LLVM by setting:
>
>    [llvm]
>    download-ci-llvm = false
>
> This follows the recommendation from the Rust bootstrap script itself.
>
> Note: this is a temporary workaround to restore compatibility with Rust
> ≥1.83. Other solutions will be investigated to avoid disabling the use
> of prebuilt LLVM in the future, while preserving Buildroot’s reproducible
> build setup.
>
> [1] https://github.com/rust-lang/rust/commit/9df7680ecf698bf7087616b595774ee1023d3c7b
>
> Signed-off-by: El Mehdi YOUNES <elmehdi.younes at smile.fr>

Tested with aarch64/musl build. Patch 3 ("package: update all hashes
after cargo3 switch") doesn't apply cleanly on current master because
package/python-maturin and package/kmon have been updated since this
series was sent, I fixed that locally. With that caveat

Tested-by: Fiona Klute <fiona.klute at gmx.de>

for the series.

Thanks,
Fiona

> ---
>   package/rust/rust.mk | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/package/rust/rust.mk b/package/rust/rust.mk
> index 29c03594d2..6481e40561 100644
> --- a/package/rust/rust.mk
> +++ b/package/rust/rust.mk
> @@ -48,6 +48,7 @@ define HOST_RUST_CONFIGURE_CMDS
>   		echo '[target.$(RUSTC_TARGET_NAME)]'; \
>   		echo 'cc = "$(TARGET_CROSS)gcc"'; \
>   		echo '[llvm]'; \
> +		echo 'download-ci-llvm = false'; \
>   		echo 'ninja = false'; \
>   		echo 'ldflags = "$(HOST_LDFLAGS)"'; \
>   	) > $(@D)/config.toml



More information about the buildroot mailing list