From 9fc1cfb987778f858da3d0f3b4eedb57c0799c2b Mon Sep 17 00:00:00 2001 From: Peter Tatrai Date: Mon, 27 Oct 2025 11:28:58 +0100 Subject: rust: add missing zlib and zstd dependencies Use WRAPPER_TARGET_EXTRALD to pass '-lz -lzstd' to the target linker wrapper, Rust's internal LLVM requires zlib and zstd compression libraries when building rustc_codegen_llvm and other compiler components. Without these dependencies, building Rust for PowerPC target fails with linker errors: error: linking with `target-rust-ccld` failed: exit status: 1 = note: undefined reference to `compress2' = note: undefined reference to `uncompress' = note: undefined reference to `ZSTD_decompress' = note: undefined reference to `ZSTD_isError' = note: undefined reference to `ZSTD_compress2' = note: undefined reference to `crc32' This manifested in oe-selftest failure on qemuppc: oe-selftest -r rust.RustSelfTestSystemEmulated.test_rust Fix rust-common.bbclass wrapper generation to properly split EXTRALD flags into separate arguments (extend instead of append), making the wrapper mechanism work correctly for multi-flag values like '-lz -lzstd'. (From OE-Core rev: 5aa995eec5e1399a536686683405ce35d6ab991e) Signed-off-by: Peter Tatrai Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust_1.90.0.bb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb index e7f3985332..50b19267fe 100644 --- a/meta/recipes-devtools/rust/rust_1.90.0.bb +++ b/meta/recipes-devtools/rust/rust_1.90.0.bb @@ -69,6 +69,11 @@ do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" do_rust_setup_snapshot[depends] += "patchelf-native:do_populate_sysroot" +# Pass zlib/zstd link flags to the target linker wrapper via WRAPPER_TARGET_EXTRALD. +# This ensures LLVM-using components (like rustc_codegen_llvm) can find compression libraries. +# The wrapper will split this into separate arguments automatically. +WRAPPER_TARGET_EXTRALD:append:class-target = " -lz -lzstd" + RUSTC_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/rustc" CARGO_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/cargo" RUSTC_BOOTSTRAP:class-native = "${WORKDIR}/rust-snapshot/bin/rustc" -- cgit v1.2.3-54-g00ecf