From patchwork Mon Oct 27 10:28:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "P. Tatrai" X-Patchwork-Id: 73068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB512CCF9EE for ; Mon, 27 Oct 2025 10:29:23 +0000 (UTC) Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by mx.groups.io with SMTP id smtpd.web10.28824.1761560956196150408 for ; Mon, 27 Oct 2025 03:29:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.tatrai.ext@siemens.com header.s=fm2 header.b=g9Q8hC0T; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.226, mailfrom: fm-1328017-20251027102912348ae36ae200020742-5z_dq4@rts-flowmailer.siemens.com) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20251027102912348ae36ae200020742 for ; Mon, 27 Oct 2025 11:29:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=peter.tatrai.ext@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=2MdZWODoi/k5Ppb1PpuPbzxl4jFe14eo+7NFhzlCtLY=; b=g9Q8hC0T4puqpQfSEdszIHX8xQODF84b97Zh5GYvE4E1mwhs6C1EcOKz0OyxHA14iQsM4L bMAqh+kI8W1WUSQJz4xTEUYB8GnYVxsIGcJDz//mfshgDGOY7ZwR1XZl2yEtgagfc+a/NkCK TLpOkOlpTklvaSZ2ecsASPE7CifbtbCR/cNg1ZxYGVInVpSLxTF3ysTIGL+syfPzJv9vHkJF gud5LCmRIvVbxhdGH9b7UfZ3HQLX9nqZKDnTYAlJb6NUk7xZSAF8nm9W0duwUz87s/vrkEJ4 b8oYUDnI6mYiwEM65sPa+lCJUm0tDxsmYOMB2o6MCgq3p8/phJwy9AqA==; From: "P. Tatrai" To: openembedded-core@lists.openembedded.org Cc: Peter Tatrai Subject: [PATCH 1/3] rust: add missing zlib and zstd dependencies Date: Mon, 27 Oct 2025 11:28:58 +0100 Message-Id: <20251027102900.65173-2-peter.tatrai.ext@siemens.com> In-Reply-To: <20251027102900.65173-1-peter.tatrai.ext@siemens.com> References: <20251027102900.65173-1-peter.tatrai.ext@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328017:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 27 Oct 2025 10:29:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/225330 From: Peter Tatrai 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'. Signed-off-by: Peter Tatrai --- meta/classes-recipe/rust-common.bbclass | 2 +- meta/recipes-devtools/rust/rust_1.90.0.bb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass index 31331c7a26..d9f7a7a932 100644 --- a/meta/classes-recipe/rust-common.bbclass +++ b/meta/classes-recipe/rust-common.bbclass @@ -149,7 +149,7 @@ create_wrapper_rust () { binary = orig_binary.split()[0] args = orig_binary.split() + sys.argv[1:] if extras: - args.append(extras) + args.extend(extras.split()) os.execvp(binary, args) EOF chmod +x "${file}" diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb index 0319d73b93..8247e9a10a 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" From patchwork Mon Oct 27 10:28:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "P. Tatrai" X-Patchwork-Id: 73066 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD66CCCF9EA for ; Mon, 27 Oct 2025 10:29:23 +0000 (UTC) Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) by mx.groups.io with SMTP id smtpd.web10.28823.1761560955925740820 for ; Mon, 27 Oct 2025 03:29:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.tatrai.ext@siemens.com header.s=fm2 header.b=nIOP3sKq; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.227, mailfrom: fm-1328017-20251027102912013d05d76900020755-x2lc7h@rts-flowmailer.siemens.com) Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20251027102912013d05d76900020755 for ; Mon, 27 Oct 2025 11:29:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=peter.tatrai.ext@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=B4eTQ3j6NPOvMiDVO9GcNAf/r+0q7TGiLZcUWjpo5L8=; b=nIOP3sKqck/ZtCHsGq3sDull06jwfpazhmLaODz3d+ms6tgRQf2X2Q+jS9tnv7zPvmiCir eQo9otrY4jUO8JDcSiPWEZ5fNnaDChDgdlo+DP8Cn2FP6jgnKSgvLwPQgT24ABqA6e7DB0HW E/CeafXckMn00HUlWUJDzWUikmY7KNXmVF+ZsJIYvgb0GAeo+FDcFh0VAJOPsl/ig8whVLWx sHpQdZL/uu1rC8dek5VJ76TrboVSZ0rKLHEgFPfTdJG/UlHzTmAOdqG6OGq+LmJ9Znx2EQa+ tXk19TufVHpAeikuJM+e80LLCCk1VjUj7gVkb3TmirZThjfLDpmgK/8A==; From: "P. Tatrai" To: openembedded-core@lists.openembedded.org Cc: Peter Tatrai Subject: [PATCH 2/3] oeqa/selftest/rust: add zlib and libzstd runtime packages Date: Mon, 27 Oct 2025 11:28:59 +0100 Message-Id: <20251027102900.65173-3-peter.tatrai.ext@siemens.com> In-Reply-To: <20251027102900.65173-1-peter.tatrai.ext@siemens.com> References: <20251027102900.65173-1-peter.tatrai.ext@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328017:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 27 Oct 2025 10:29:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/225328 From: Peter Tatrai Add zlib and libzstd runtime packages to the QEMU test image so that Rust compiler binaries can find the required compression libraries at runtime. The Rust self-test compiles test binaries on the build host and uploads them to the minimal QEMU image for execution. These test binaries require zlib and libzstd at runtime because they use LLVM's compression functionality. Without these packages, the Rust self-tests would fail on PowerPC with errors about missing compression libraries. Signed-off-by: Peter Tatrai --- meta/lib/oeqa/selftest/cases/rust.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index 06acf53e9a..ab3094af87 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", "zlib", "libzstd"] features = [] features.append('IMAGE_FEATURES += "ssh-server-dropbear"') features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages))) From patchwork Mon Oct 27 10:29:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "P. Tatrai" X-Patchwork-Id: 73067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF1E7CCF9E0 for ; Mon, 27 Oct 2025 10:29:23 +0000 (UTC) Received: from mta-65-228.siemens.flowmailer.net (mta-65-228.siemens.flowmailer.net [185.136.65.228]) by mx.groups.io with SMTP id smtpd.web11.28579.1761560955937401090 for ; Mon, 27 Oct 2025 03:29:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=peter.tatrai.ext@siemens.com header.s=fm2 header.b=YTUDIpX6; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.65.228, mailfrom: fm-1328017-20251027102913e1674db07700020783-gffbsj@rts-flowmailer.siemens.com) Received: by mta-65-228.siemens.flowmailer.net with ESMTPSA id 20251027102913e1674db07700020783 for ; Mon, 27 Oct 2025 11:29:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=peter.tatrai.ext@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=aOm3Iw84z8pco1U4Nfvei+oK2MYoAP18JLJjkAXR33o=; b=YTUDIpX6uAxed3zYv32N0SGB/pDkCEjqQ7/fxDYZAlriYbFiyLigQxQRLUd5HP6B937ICq t6vT6QsKO/4TgzLYm/zlohb4xYY0VD9TT9YznKtAEI/h9PeLdKJ3QNRthFQIZLRgMi5XGtjh CZB3f21dRh3O7kfOh/WY3gL27pXjdQEh29aK733b11U5HQOgkC0JoTmdfALNByjFsZwbrBco 3a6XD5XMBGPbWmBosFiJYFPlBma0N53EbZayxgongTexP9oZp0JSC40I9l8ZlRJshTGeqdMm uXzTNZpgGWhlReIxK/z2rZQoFikEZ09KkAnHK6mKq0SFmX1QrBriJhTQ==; From: "P. Tatrai" To: openembedded-core@lists.openembedded.org Cc: Peter Tatrai Subject: [PATCH 3/3] oeqa/selftest/rust: strip debug symbols from test binaries Date: Mon, 27 Oct 2025 11:29:00 +0100 Message-Id: <20251027102900.65173-4-peter.tatrai.ext@siemens.com> In-Reply-To: <20251027102900.65173-1-peter.tatrai.ext@siemens.com> References: <20251027102900.65173-1-peter.tatrai.ext@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1328017:519-21489:flowmailer List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 27 Oct 2025 10:29:23 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/225327 From: Peter Tatrai Strip debug symbols from test binaries using RUSTFLAGS='-C strip=debuginfo' to reduce binary sizes from 300+ MB to ~140 MB. This is especially critical for PowerPC mac99 which has a hardcoded 768MB RAM limit in QEMU. Without stripping, test binaries uploaded to /tmp (tmpfs) cause 'No space left on device' errors during test execution. The size reduction also benefits all other architectures by reducing memory pressure and upload times during testing. Signed-off-by: Peter Tatrai --- meta/lib/oeqa/selftest/cases/rust.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index ab3094af87..2cc1284bca 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py @@ -122,6 +122,9 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): cmd = "export TARGET_VENDOR=\"-poky\";" cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/python3-native:%s/recipe-sysroot-native/usr/bin:%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, rustlibpath, rustlibpath, tcpath, tmpdir) 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';" # 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)