From: Peter Tatrai Date: Thu, 11 Dec 2025 14:08:13 +0000 (-0800) Subject: oeqa/selftest/rust: add missing zlib and zstd dependencies X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4015826a12556bf17c9fd52c5b0148f073a55518;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git oeqa/selftest/rust: add missing zlib and zstd dependencies LLVM requires zlib and zstd support for compression routines used by rustc_codegen_llvm and related components. Recipe-level RUSTFLAGS are not propagated in qemu image, causing bootstrap test linkage failures. When these libraries are absent in the selftest execution environment, bootstrap test binaries fail to link and cause following failure: 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' Explicitly pass `-lz` and `-lzstd` in the image and ensure the corresponding runtime libraries are present in the image. It was initially reported on qemuppc and later seen across all tested architectures (arm32/64, riscv64, x86_32/64). https://lists.openembedded.org/g/openembedded-core/message/225636 Signed-off-by: Peter Tatrai Signed-off-by: Yash Shinde Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index 31222e24568..01a98339a67 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py @@ -47,7 +47,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): bitbake("{} -c test_compile".format(recipe)) builddir = get_bb_var("RUSTSRC", "rust") # build core-image-minimal with required packages - default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"] + default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd"] features = [] features.append('IMAGE_FEATURES += "ssh-server-dropbear"') features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages))) @@ -124,7 +124,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath # Strip debug symbols from test binaries to reduce size (300+ MB -> ~140 MB) # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes - cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo';" + cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';" # Trigger testing. cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)