From patchwork Sat May 10 08:43:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 62737 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 D194CC3ABCE for ; Sat, 10 May 2025 08:44:26 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.6627.1746866657379870180 for ; Sat, 10 May 2025 01:44:17 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 123C9153B for ; Sat, 10 May 2025 01:44:06 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AAED73F5A1 for ; Sat, 10 May 2025 01:44:16 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 19/23] toolchain-scripts: Export meson settings for SDK builds Date: Sat, 10 May 2025 09:43:52 +0100 Message-ID: <20250510084400.269726-19-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250510084400.269726-1-ross.burton@arm.com> References: <20250510084400.269726-1-ross.burton@arm.com> MIME-Version: 1.0 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 ; Sat, 10 May 2025 08:44:26 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/216267 From: Tom Hochstein Create a new set of exports for the Meson `host_machine` cross settings. This allows the target cross file to be created correctly from meson.cross.template and aligns with meson.bbclass. Note, one might think that HOST_OS and HOST_ARCH would be appropriate as inputs here, aligning nicely with the Meson naming. That turns out to be incorrect since the script is generated in a native/nativesdk build with HOST_OS and HOST_ARCH set for the "build machine", not the "host machine", using the Meson terminology. See https://mesonbuild.com/Cross-compilation.html. Fixes: [YOCTO #15485] (From OE-Core rev: 9e742a0a9078f4a19a5edbfa51f22f7b71992188) Signed-off-by: Tom Hochstein Signed-off-by: Richard Purdie --- meta/classes-recipe/toolchain-scripts.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 9e4320f8762..3053cd0f1fa 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -inherit toolchain-scripts-base siteinfo kernel-arch +inherit toolchain-scripts-base siteinfo kernel-arch meson-routines # We want to be able to change the value of MULTIMACH_TARGET_SYS, because it # doesn't always match our expectations... but we default to the stock value @@ -72,6 +72,10 @@ toolchain_create_sdk_env_script () { echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script + echo 'export OECORE_MESON_HOST_SYSTEM="${@meson_operating_system('TARGET_OS', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU_FAMILY="${@meson_cpu_family('TARGET_ARCH', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU="${TARGET_ARCH}"' >>$script + echo 'export OECORE_MESON_HOST_ENDIAN="${@meson_endian('TARGET', d)}"' >>$script echo 'unset command_not_found_handle' >> $script @@ -101,6 +105,10 @@ toolchain_create_tree_env_script () { echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script echo 'export OECORE_TARGET_BITS="${@siteinfo_with_prefix(d, 'bit-')}"' >>$script echo 'export OECORE_TARGET_ENDIAN="${@siteinfo_with_prefix(d, 'endian-')}"' >>$script + echo 'export OECORE_MESON_HOST_SYSTEM="${@meson_operating_system('TARGET_OS', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU_FAMILY="${@meson_cpu_family('TARGET_ARCH', d)}"' >>$script + echo 'export OECORE_MESON_HOST_CPU="${TARGET_ARCH}"' >>$script + echo 'export OECORE_MESON_HOST_ENDIAN="${@meson_endian('TARGET', d)}"' >>$script toolchain_shared_env_script