nativesdk: ensure features don't get backfilled
PATCH 1/3 nativesdk: ensure features don't get backfilled
From: Ross Burton <[email protected]>
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.
--- meta/classes-recipe/nativesdk.bbclass | 3 +++ 1 file changed, 3 insertions(+)
meta/classes-recipe/nativesdk.bbclass +3 -0
@@ -15,7 +15,10 @@ NATIVESDKLIBC ?= "libc-glibc" LIBCOVERRIDE = ":${NATIVESDKLIBC}" CLASSOVERRIDE = "class-nativesdk" MACHINEOVERRIDES = "" + MACHINE_FEATURES = "" +DISTRO_FEATURES_BACKFILL = "" +MACHINE_FEATURES_BACKFILL = "" MULTILIBS = ""
Signature · 1 line
2.34.1
PATCH 2/3 nativesdk: don't unset MACHINE_FEATURES, let machine-sdk/ set it
From: Ross Burton <[email protected]>
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.
--- meta/classes-recipe/nativesdk.bbclass | 2 +- meta/conf/bitbake.conf | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
meta/classes-recipe/nativesdk.bbclass +1 -1
@@ -16,7 +16,7 @@ LIBCOVERRIDE = ":${NATIVESDKLIBC}" CLASSOVERRIDE = "class-nativesdk" MACHINEOVERRIDES = "" -MACHINE_FEATURES = "" +MACHINE_FEATURES = "${SDK_MACHINE_FEATURES}" DISTRO_FEATURES_BACKFILL = "" MACHINE_FEATURES_BACKFILL = ""
meta/conf/bitbake.conf +2 -0
@@ -892,6 +892,8 @@ OES_BITBAKE_CONF = "1" ################################################################## MACHINE_FEATURES ?= "" +SDK_MACHINE_FEATURES ?= "" + DISTRO_FEATURES ?= "" DISTRO_EXTRA_RDEPENDS ?= ""
Signature · 1 line
2.34.1
PATCH 3/3 conf/machine-sdk: declare qemu-usermode SDK_MACHINE_FEATURE
In reply to [email protected]From: Ross Burton <[email protected]>
All of our defined SDK machines (which are assumed to be Linux) support qemu-user, so state this explicitly.
--- 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(+)
meta/conf/machine-sdk/aarch64.conf +2 -0
@@ -1,2 +1,4 @@ SDK_ARCH = "aarch64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/i586.conf +1 -0
@@ -2,3 +2,4 @@ SDK_ARCH = "i586" SDK_CC_ARCH = "-march=i586" ABIEXTENSION:class-nativesdk = "" +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/i686.conf +2 -0
@@ -1,3 +1,5 @@ SDK_ARCH = "i686" SDK_CC_ARCH = "-march=i686" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/loongarch64.conf +2 -0
@@ -1,2 +1,4 @@ SDK_ARCH = "loongarch64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/ppc64.conf +2 -0
@@ -1,2 +1,4 @@ SDK_ARCH = "ppc64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/ppc64le.conf +2 -0
@@ -1,2 +1,4 @@ SDK_ARCH = "ppc64le" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/riscv64.conf +2 -0
@@ -1,2 +1,4 @@ SDK_ARCH = "riscv64" ABIEXTENSION:class-nativesdk = "" + +SDK_MACHINE_FEATURES = "qemu-usermode"
meta/conf/machine-sdk/x86_64.conf +2 -0
@@ -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"
Signature · 1 line
2.34.1