From patchwork Thu Dec 21 17:01:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 36815 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 1E2EDC35274 for ; Thu, 21 Dec 2023 17:02:11 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.56202.1703178122038057753 for ; Thu, 21 Dec 2023 09:02:02 -0800 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 1E9502F4 for ; Thu, 21 Dec 2023 09:02:46 -0800 (PST) Received: from oss-tx204.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 C445E3F5A1 for ; Thu, 21 Dec 2023 09:02:00 -0800 (PST) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Subject: [PATCH 1/3] nativesdk: ensure features don't get backfilled Date: Thu, 21 Dec 2023 17:01:57 +0000 Message-Id: <20231221170159.1995650-1-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 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 ; Thu, 21 Dec 2023 17:02:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192840 From: Ross Burton nativesdk aims to run in a slightly different environment than the target build, so it resets MACHINE_FEATURES and filters DISTRO_FEATURES with DISTRO_FEATURES_NATIVESDK. However, feature backfill happens _after_ these operations: $ bitbake-getvar -r nativesdk-glib-2.0 MACHINE_FEATURES # # $MACHINE_FEATURES [5 operations] # set /home/ross/Yocto/poky/meta/conf/machine/include/qemu.inc:14 # "alsa bluetooth usbgadget screen vfat" # set /home/ross/Yocto/poky/meta/conf/documentation.conf:284 # [doc] "Specifies the list of hardware features the MACHINE supports." # set? /home/ross/Yocto/poky/meta/conf/bitbake.conf:893 # "" # set /home/ross/Yocto/poky/meta/classes-recipe/nativesdk.bbclass:18 # "" # append utils.py:132 [features_backfill] # " rtc qemu-usermode" # pre-expansion value: # " rtc qemu-usermode" MACHINE_FEATURES=" rtc qemu-usermode" This is not intentional nor desired as the target machine features are unrelated to the nativesdk environment. Signed-off-by: Ross Burton --- meta/classes-recipe/nativesdk.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass index 08288fdb733..ccaf411f0d7 100644 --- a/meta/classes-recipe/nativesdk.bbclass +++ b/meta/classes-recipe/nativesdk.bbclass @@ -15,7 +15,10 @@ NATIVESDKLIBC ?= "libc-glibc" LIBCOVERRIDE = ":${NATIVESDKLIBC}" CLASSOVERRIDE = "class-nativesdk" MACHINEOVERRIDES = "" + MACHINE_FEATURES = "" +DISTRO_FEATURES_BACKFILL = "" +MACHINE_FEATURES_BACKFILL = "" MULTILIBS = "" From patchwork Thu Dec 21 17:01:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 36814 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 1F947C46CCD for ; Thu, 21 Dec 2023 17:02:11 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.56203.1703178122171559600 for ; Thu, 21 Dec 2023 09:02:02 -0800 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 A0D6F1042 for ; Thu, 21 Dec 2023 09:02:46 -0800 (PST) Received: from oss-tx204.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 534E23F5A1 for ; Thu, 21 Dec 2023 09:02:01 -0800 (PST) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/3] nativesdk: don't unset MACHINE_FEATURES, let machine-sdk/ set it Date: Thu, 21 Dec 2023 17:01:58 +0000 Message-Id: <20231221170159.1995650-2-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221170159.1995650-1-ross.burton@arm.com> References: <20231221170159.1995650-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 ; Thu, 21 Dec 2023 17:02:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192841 From: Ross Burton There is actually a use for nativesdk MACHINE_FEATURES; for example qemu-usermode being supported, as this is needed to build profile-guided optimised code. We shouldn't use the target MACHINE_FEATURES for this because the target and the SDK can be entirely different, so instead set the MACHINE_FEATURES in nativesdk.bbclass to SDK_MACHINE_FEATURES (which defaults to "") and let the conf/machine-sdk/*.conf files set that as appropriate. Signed-off-by: Ross Burton --- meta/classes-recipe/nativesdk.bbclass | 2 +- meta/conf/bitbake.conf | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meta/classes-recipe/nativesdk.bbclass b/meta/classes-recipe/nativesdk.bbclass index ccaf411f0d7..de6debda93c 100644 --- a/meta/classes-recipe/nativesdk.bbclass +++ b/meta/classes-recipe/nativesdk.bbclass @@ -16,7 +16,7 @@ LIBCOVERRIDE = ":${NATIVESDKLIBC}" CLASSOVERRIDE = "class-nativesdk" MACHINEOVERRIDES = "" -MACHINE_FEATURES = "" +MACHINE_FEATURES = "${SDK_MACHINE_FEATURES}" DISTRO_FEATURES_BACKFILL = "" MACHINE_FEATURES_BACKFILL = "" diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 83b12cbc158..ebfd297430a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -892,6 +892,8 @@ OES_BITBAKE_CONF = "1" ################################################################## MACHINE_FEATURES ?= "" +SDK_MACHINE_FEATURES ?= "" + DISTRO_FEATURES ?= "" DISTRO_EXTRA_RDEPENDS ?= "" From patchwork Thu Dec 21 17:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 36816 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 28AD1C46CD8 for ; Thu, 21 Dec 2023 17:02:11 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.56205.1703178122530857788 for ; Thu, 21 Dec 2023 09:02:02 -0800 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 2F1B21063 for ; Thu, 21 Dec 2023 09:02:47 -0800 (PST) Received: from oss-tx204.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 D627B3F5A1 for ; Thu, 21 Dec 2023 09:02:01 -0800 (PST) From: ross.burton@arm.com To: openembedded-core@lists.openembedded.org Subject: [PATCH 3/3] conf/machine-sdk: declare qemu-usermode SDK_MACHINE_FEATURE Date: Thu, 21 Dec 2023 17:01:59 +0000 Message-Id: <20231221170159.1995650-3-ross.burton@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231221170159.1995650-1-ross.burton@arm.com> References: <20231221170159.1995650-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 ; Thu, 21 Dec 2023 17:02:11 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192842 From: Ross Burton All of our defined SDK machines (which are assumed to be Linux) support qemu-user, so state this explicitly. Signed-off-by: Ross Burton --- meta/conf/machine-sdk/aarch64.conf | 2 ++ meta/conf/machine-sdk/i586.conf | 1 + meta/conf/machine-sdk/i686.conf | 2 ++ meta/conf/machine-sdk/loongarch64.conf | 2 ++ meta/conf/machine-sdk/ppc64.conf | 2 ++ meta/conf/machine-sdk/ppc64le.conf | 2 ++ meta/conf/machine-sdk/riscv64.conf | 2 ++ meta/conf/machine-sdk/x86_64.conf | 2 ++ 8 files changed, 15 insertions(+) diff --git a/meta/conf/machine-sdk/aarch64.conf b/meta/conf/machine-sdk/aarch64.conf index 4a285cf6cb6..d2023e21744 100644 --- a/meta/conf/machine-sdk/aarch64.conf +++ b/meta/conf/machine-sdk/aarch64.conf @@ -1,2 +1,4 @@ SDK_ARCH = "aarch64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/i586.conf b/meta/conf/machine-sdk/i586.conf index 05e826965ea..ccee3a4881b 100644 --- a/meta/conf/machine-sdk/i586.conf +++ b/meta/conf/machine-sdk/i586.conf @@ -2,3 +2,4 @@ SDK_ARCH = "i586" SDK_CC_ARCH = "-march=i586" ABIEXTENSION:class-nativesdk = "" +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/i686.conf b/meta/conf/machine-sdk/i686.conf index 22f580e70f0..abb7a4bc1af 100644 --- a/meta/conf/machine-sdk/i686.conf +++ b/meta/conf/machine-sdk/i686.conf @@ -1,3 +1,5 @@ SDK_ARCH = "i686" SDK_CC_ARCH = "-march=i686" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/loongarch64.conf b/meta/conf/machine-sdk/loongarch64.conf index 40bf0039ea5..6bb4c7a4ea1 100644 --- a/meta/conf/machine-sdk/loongarch64.conf +++ b/meta/conf/machine-sdk/loongarch64.conf @@ -1,2 +1,4 @@ SDK_ARCH = "loongarch64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/ppc64.conf b/meta/conf/machine-sdk/ppc64.conf index b41325dfe78..8ba3fccc677 100644 --- a/meta/conf/machine-sdk/ppc64.conf +++ b/meta/conf/machine-sdk/ppc64.conf @@ -1,2 +1,4 @@ SDK_ARCH = "ppc64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/ppc64le.conf b/meta/conf/machine-sdk/ppc64le.conf index db1f863496e..3ee12faf572 100644 --- a/meta/conf/machine-sdk/ppc64le.conf +++ b/meta/conf/machine-sdk/ppc64le.conf @@ -1,2 +1,4 @@ SDK_ARCH = "ppc64le" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/riscv64.conf b/meta/conf/machine-sdk/riscv64.conf index 3f4a5af0af7..a43fe433fe6 100644 --- a/meta/conf/machine-sdk/riscv64.conf +++ b/meta/conf/machine-sdk/riscv64.conf @@ -1,2 +1,4 @@ SDK_ARCH = "riscv64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode" diff --git a/meta/conf/machine-sdk/x86_64.conf b/meta/conf/machine-sdk/x86_64.conf index 3396f95d69d..357dab0b882 100644 --- a/meta/conf/machine-sdk/x86_64.conf +++ b/meta/conf/machine-sdk/x86_64.conf @@ -2,3 +2,5 @@ SDK_ARCH = "x86_64" SDK_CC_ARCH = "-march=x86-64" ABIEXTENSION:class-crosssdk = "" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"