classes/nativesdk: also override TUNE_PKGARCH
PATCH v2 1/4 classes/nativesdk: also override TUNE_PKGARCH
The nativesdk class overrides PACKAGE_ARCH and unsets TUNE_FEATURES, but as recipes might want to look at TUNE_PKGARCH too (for example, when setting QEMU_EXTRAOPTIONS) we should also override that variable.
Otherwise, a nativesdk recipe will have the TUNE_PKGARCH of the target, which leads to errors (eg passing mips arguments to an arm qemu).
--- meta/classes-recipe/nativesdk.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes-recipe/nativesdk.bbclass +1 -0
@@ -32,6 +32,7 @@ RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot" # PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" +TUNE_PKGARCH = "${SDK_ARCH}" # # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
Signature · 1 line
2.43.0
PATCH v2 2/4 classes/qemu: use tune to select QEMU_EXTRAOPTIONS, not package architecture
Using the package architecture to select the right qemu options to pass to qemu-user is incorrect, and fails for recipes that set PACKAGE_ARCH to MACHINE_ARCH (as the qemuppc workarounds suggest) because there are not typically any options set for the machine name.
Solve this by using TUNE_PKGARCH instead: for the majority of recipes this is the same value, but for machine-specific recipes it remains the same instead of changing to the machine name.
This means we can remove the qemuppc workarounds, as they're obsolete.
Also update the gcc-testsuite recipe which uses the same pattern to use TUNE_PKGARCH, and generalise the else codepath to avoid needing to update the list of architectures.
[ YOCTO #15647 ]
--- meta/classes-recipe/qemu.bbclass | 8 ++------ meta/recipes-devtools/gcc/gcc-testsuite.inc | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-)
meta/classes-recipe/qemu.bbclass +2 -6
@@ -60,8 +60,8 @@ def qemu_run_binary(data, rootfs_path, binary): # this dance). For others (e.g. arm) a -cpu option is not necessary, since the # qemu-arm default CPU supports all required architecture levels. -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}" -QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}" +QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) or ""}" +QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}" QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2" QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc"
@@ -71,7 +71,3 @@ QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc" QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400" QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9" -# Some packages e.g. fwupd sets PACKAGE_ARCH = MACHINE_ARCH and uses meson which -# needs right options to usermode qemu -QEMU_EXTRAOPTIONS_qemuppc = " -cpu 7400" -QEMU_EXTRAOPTIONS_qemuppc64 = " -cpu POWER9"
meta/recipes-devtools/gcc/gcc-testsuite.inc +2 -2
@@ -53,8 +53,8 @@ python check_prepare() { # - valid for x86*, powerpc, arm, arm64 if qemu_binary.endswith(("x86_64", "i386", "arm", "aarch64")): args += ["-cpu", "max"] - elif qemu_binary.endswith(("ppc", "mips", "mips64")): - extra = d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) + else: + extra = d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) if extra: args += extra.split() # For mips64 we could set a maximal CPU (e.g. Loongson-3A4000) however they either have MSA
Signature · 1 line
2.43.0
PATCH v2 3/4 classes/qemu: move QEMU_EXTRAOPTIONS for PPC to the relevant tunes
In reply to Ross BurtonEvery other architecture has the QEMU_EXTRAOPTIONS assignments in the tune files, so move the PPC ones too.
--- meta/classes-recipe/qemu.bbclass | 9 --------- meta/conf/machine/include/powerpc/arch-powerpc64.inc | 1 + meta/conf/machine/include/powerpc/tune-ppc7400.inc | 1 + meta/conf/machine/include/powerpc/tune-ppce500mc.inc | 1 + meta/conf/machine/include/powerpc/tune-ppce500v2.inc | 1 + meta/conf/machine/include/powerpc/tune-ppce5500.inc | 2 ++ meta/conf/machine/include/powerpc/tune-ppce6500.inc | 2 ++ 7 files changed, 8 insertions(+), 9 deletions(-)
meta/classes-recipe/qemu.bbclass +0 -9
@@ -62,12 +62,3 @@ def qemu_run_binary(data, rootfs_path, binary): QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) or ""}" QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}" - -QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2" -QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc" -QEMU_EXTRAOPTIONS_ppce5500 = " -cpu e500mc" -QEMU_EXTRAOPTIONS_ppc64e5500 = " -cpu e500mc" -QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc" -QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" -QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400" -QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9"
meta/conf/machine/include/powerpc/arch-powerpc64.inc +1 -0
@@ -21,3 +21,4 @@ TUNE_FEATURES:tune-powerpc64le = "m64 fpu-hard" BASE_LIB:tune-powerpc64le = "lib64" TUNE_PKGARCH:tune-powerpc64le = "powerpc64le" PACKAGE_EXTRA_ARCHS:tune-powerpc64le = "powerpc64le" +QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9"
meta/conf/machine/include/powerpc/tune-ppc7400.inc +1 -0
@@ -9,3 +9,4 @@ AVAILTUNES += "ppc7400" TUNE_FEATURES:tune-ppc7400 = "m32 fpu-hard ppc7400 altivec bigendian" TUNE_PKGARCH:tune-ppc7400 = "ppc7400" PACKAGE_EXTRA_ARCHS:tune-ppc7400 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppc7400" +QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400"
meta/conf/machine/include/powerpc/tune-ppce500mc.inc +1 -0
@@ -9,6 +9,7 @@ AVAILTUNES += "ppce500mc" TUNE_FEATURES:tune-ppce500mc = "m32 fpu-hard ppce500mc bigendian" TUNE_PKGARCH:tune-ppce500mc = "ppce500mc" PACKAGE_EXTRA_ARCHS:tune-ppce500mc = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppce500mc" +QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc" # pass -mcpu=e500mc for ppce500mc kernel cross compile TARGET_CC_KERNEL_ARCH = "-mcpu=e500mc"
meta/conf/machine/include/powerpc/tune-ppce500v2.inc +1 -0
@@ -18,3 +18,4 @@ AVAILTUNES += "ppce500v2" TUNE_FEATURES:tune-ppce500v2 = "m32 ppce500v2 bigendian" TUNE_PKGARCH:tune-ppce500v2 = "ppce500v2" PACKAGE_EXTRA_ARCHS:tune-ppce500v2 = "ppce500v2" +QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
meta/conf/machine/include/powerpc/tune-ppce5500.inc +2 -0
@@ -10,11 +10,13 @@ TUNE_FEATURES:tune-ppce5500 = "m32 fpu-hard e5500 bigendian" BASE_LIB:tune-ppce5500 = "lib" TUNE_PKGARCH:tune-ppce5500 = "ppce5500" PACKAGE_EXTRA_ARCHS:tune-ppce5500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppce5500" +QEMU_EXTRAOPTIONS_ppce5500 = " -cpu e500mc" TUNE_FEATURES:tune-ppc64e5500 = "m64 fpu-hard e5500 bigendian" BASE_LIB:tune-ppc64e5500 = "lib64" TUNE_PKGARCH:tune-ppc64e5500 = "ppc64e5500" PACKAGE_EXTRA_ARCHS:tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc64} ppc64e5500" +QEMU_EXTRAOPTIONS_ppc64e5500 = " -cpu e500mc" # QEMU usermode fails with invalid instruction error (YOCTO: #10304) MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}"
meta/conf/machine/include/powerpc/tune-ppce6500.inc +2 -0
@@ -10,11 +10,13 @@ TUNE_FEATURES:tune-ppce6500 = "m32 fpu-hard e6500 altivec bigendian" BASE_LIB:tune-ppce6500 = "lib" TUNE_PKGARCH:tune-ppce6500 = "ppce6500" PACKAGE_EXTRA_ARCHS:tune-ppce6500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppce6500" +QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc" TUNE_FEATURES:tune-ppc64e6500 = "m64 fpu-hard e6500 altivec bigendian" BASE_LIB:tune-ppc64e6500 = "lib64" TUNE_PKGARCH:tune-ppc64e6500 = "ppc64e6500" PACKAGE_EXTRA_ARCHS:tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc64} ppc64e6500" +QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" # QEMU usermode fails with invalid instruction error (YOCTO: #10304) MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}"
Signature · 1 line
2.43.0
PATCH v2 4/4 qemu/machine: rename QEMU_EXTRAOPTIONS for consistency
In reply to Ross BurtonThe per-tune qemu options variable is QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}, but this doesn't follow the pattern of all of the other tune-specific variables in the machine configuration which is VARIABLE:tune-[name].
Rename QEMU_EXTRAOPTIONS_${TUNE_PKGARCH} to QEMU_EXTRAOPTIONS:tune-${TUNE_PKGARCH} for consistency.
Note that this will mean that BSPs need to update any assignments of this variable.
--- meta/classes-recipe/qemu.bbclass | 4 ++-- .../machine/include/mips/tune-mips-24k.inc | 12 +++++----- .../machine/include/mips/tune-mips-74k.inc | 8 +++---- .../machine/include/mips/tune-mips64r2.inc | 24 +++++++++---------- .../include/powerpc/arch-powerpc64.inc | 2 +- .../machine/include/powerpc/tune-ppc7400.inc | 2 +- .../include/powerpc/tune-ppce500mc.inc | 2 +- .../include/powerpc/tune-ppce500v2.inc | 2 +- .../machine/include/powerpc/tune-ppce5500.inc | 4 ++-- .../machine/include/powerpc/tune-ppce6500.inc | 4 ++-- meta/conf/machine/include/x86/tune-core2.inc | 6 ++--- meta/conf/machine/include/x86/tune-corei7.inc | 6 ++--- .../machine/include/x86/tune-x86-64-v3.inc | 4 ++-- meta/recipes-devtools/gcc/gcc-testsuite.inc | 2 +- 14 files changed, 41 insertions(+), 41 deletions(-)
meta/classes-recipe/qemu.bbclass +2 -2
@@ -60,5 +60,5 @@ def qemu_run_binary(data, rootfs_path, binary): # this dance). For others (e.g. arm) a -cpu option is not necessary, since the # qemu-arm default CPU supports all required architecture levels. -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) or ""}" -QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}" +QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS:tune-%s" % d.getVar('TUNE_PKGARCH')) or ""}" +QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS:tune-${TUNE_PKGARCH}"
meta/conf/machine/include/mips/tune-mips-24k.inc +6 -6
@@ -22,15 +22,15 @@ TUNE_FEATURES:tune-mips32r2-24kec-m16 = "${TUNE_FEATURES:tune-mips32r2-24kec} mi MIPSPKGSFX_VARIANT:tune-mips32r2-24kc = "mips32r2-24kc" PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kc = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-nf} mips32r2-24kc-nf" -QEMU_EXTRAOPTIONS_mips32r2-24kc-nf = " -cpu 24Kc" +QEMU_EXTRAOPTIONS:tune-mips32r2-24kc-nf = " -cpu 24Kc" MIPSPKGSFX_VARIANT:tune-mips32r2-24kec = "mips32r2-24kec" PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kc} mips32r2-24kec-nf" -QEMU_EXTRAOPTIONS_mips32r2-24kec-nf = " -cpu 24KEc" +QEMU_EXTRAOPTIONS:tune-mips32r2-24kec-nf = " -cpu 24KEc" MIPSPKGSFX_VARIANT:tune-mips32r2-24kec-m16 = "mips32r2-24kec${MIPSPKGSFX_MIPS16E}" PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec-m16 = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-24kec} mips32r2-24kec-m16-nf" -QEMU_EXTRAOPTIONS_mips32r2-24kec-m16-nf = " -cpu 24KEc" +QEMU_EXTRAOPTIONS:tune-mips32r2-24kec-m16-nf = " -cpu 24KEc" # little endian: kc, kc+dsp=kec, kc+dsp+mips16e=kec-m16
@@ -40,12 +40,12 @@ TUNE_FEATURES:tune-mips32r2el-24kec-m16 = "${TUNE_FEATURES:tune-mips32r2el-24kec MIPSPKGSFX_VARIANT:tune-mips32r2el-24kc = "mips32r2el-24kc" PACKAGE_EXTRA_ARCHS:tune-mips32r2el-24kc = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2el-nf} mips32r2el-24kc-nf" -QEMU_EXTRAOPTIONS_mips32r2el-24kc-nf = " -cpu 24Kc" +QEMU_EXTRAOPTIONS:tune-mips32r2el-24kc-nf = " -cpu 24Kc" MIPSPKGSFX_VARIANT:tune-mips32r2el-24kec = "mips32r2el-24kec" PACKAGE_EXTRA_ARCHS:tune-mips32r2el-24kec = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2el-24kc} mips32r2el-24kec-nf" -QEMU_EXTRAOPTIONS_mips32r2el-24kec-nf = " -cpu 24KEc" +QEMU_EXTRAOPTIONS:tune-mips32r2el-24kec-nf = " -cpu 24KEc" MIPSPKGSFX_VARIANT:tune-mips32r2el-24kec-m16 = "mips32r2el-24kec${MIPSPKGSFX_MIPS16E}" PACKAGE_EXTRA_ARCHS:tune-mips32r2el-24kec-m16 = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2el-24kec} mips32r2el-24kec-m16-nf" -QEMU_EXTRAOPTIONS_mips32r2el-24kec-m16-nf = " -cpu 24KEc" +QEMU_EXTRAOPTIONS:tune-mips32r2el-24kec-m16-nf = " -cpu 24KEc"
meta/conf/machine/include/mips/tune-mips-74k.inc +4 -4
@@ -18,11 +18,11 @@ TUNE_FEATURES:tune-mips32r2-74kc-m16 = "${TUNE_FEATURES:tune-mips32r2-74kc} mips MIPSPKGSFX_VARIANT:tune-mips32r2-74kc = "mips32r2-74kc" PACKAGE_EXTRA_ARCHS:tune-mips32r2-74kc = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-nf} mips32r2-74kc-nf" -QEMU_EXTRAOPTIONS_mips32r2-74kc-nf = " -cpu 24Kc" +QEMU_EXTRAOPTIONS:tune-mips32r2-74kc-nf = " -cpu 24Kc" MIPSPKGSFX_VARIANT:tune-mips32r2-74kc-m16 = "mips32r2-74kc${MIPSPKGSFX_MIPS16E}" PACKAGE_EXTRA_ARCHS:tune-mips32r2-74kc-m16 = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2-74kc} mips32r2-74kc-m16-nf" -QEMU_EXTRAOPTIONS_mips32r2-74kc-m16-nf = " -cpu 24KEc" +QEMU_EXTRAOPTIONS:tune-mips32r2-74kc-m16-nf = " -cpu 24KEc" # little endian: kc+dsp2=kc, kc+dsp2+mips16e=kc-m16 TUNE_FEATURES:tune-mips32r2el-74kc = "${TUNE_FEATURES:tune-mips32r2el-nf} 74kc"
@@ -30,8 +30,8 @@ TUNE_FEATURES:tune-mips32r2el-74kc-m16 = "${TUNE_FEATURES:tune-mips32r2el-74kc} MIPSPKGSFX_VARIANT:tune-mips32r2el-74kc = "mips32r2el-74kc" PACKAGE_EXTRA_ARCHS:tune-mips32r2el-74kc = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2el-nf} mips32r2el-74kc-nf" -QEMU_EXTRAOPTIONS_mips32r2el-74kc-nf = " -cpu 24Kc" +QEMU_EXTRAOPTIONS:tune-mips32r2el-74kc-nf = " -cpu 24Kc" MIPSPKGSFX_VARIANT:tune-mips32r2el-74kc-m16 = "mips32r2el-74kc${MIPSPKGSFX_MIPS16E}" PACKAGE_EXTRA_ARCHS:tune-mips32r2el-74kc-m16 = "${PACKAGE_EXTRA_ARCHS:tune-mips32r2el-74kc} mips32r2el-74kc-m16-nf" -QEMU_EXTRAOPTIONS_mips32r2el-74kc-m16-nf = " -cpu 24KEc" +QEMU_EXTRAOPTIONS:tune-mips32r2el-74kc-m16-nf = " -cpu 24KEc"
meta/conf/machine/include/mips/tune-mips64r2.inc +12 -12
@@ -12,13 +12,13 @@ TUNE_FEATURES:tune-mips64r2 = "${TUNE_FEATURES:tune-mips64} mips64r2" BASE_LIB:tune-mips64r2 = "lib64" MIPSPKGSFX_VARIANT:tune-mips64r2 = "mips64r2" PACKAGE_EXTRA_ARCHS:tune-mips64r2 = "mips64 mips64r2" -QEMU_EXTRAOPTIONS_mips64r2 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2 = " -cpu MIPS64R2-generic" TUNE_FEATURES:tune-mips64r2el = "${TUNE_FEATURES:tune-mips64el} mips64r2" BASE_LIB:tune-mips64r2el = "lib64" MIPSPKGSFX_VARIANT:tune-mips64r2el = "mips64r2el" PACKAGE_EXTRA_ARCHS:tune-mips64r2el = "mips64el mips64r2el" -QEMU_EXTRAOPTIONS_mips64r2el = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2el = " -cpu MIPS64R2-generic" # MIPS 64r2 Soft Float AVAILTUNES += "mips64r2-nf mips64r2el-nf"
@@ -27,13 +27,13 @@ TUNE_FEATURES:tune-mips64r2-nf = "${TUNE_FEATURES:tune-mips64-nf} mips64r2" BASE_LIB:tune-mips64r2-nf = "lib64" MIPSPKGSFX_VARIANT:tune-mips64r2-nf = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2-nf = "mips64-nf mips64r2-nf" -QEMU_EXTRAOPTIONS_mips64r2-nf = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2-nf = " -cpu MIPS64R2-generic" TUNE_FEATURES:tune-mips64r2el-nf = "${TUNE_FEATURES:tune-mips64el-nf} mips64r2" BASE_LIB:tune-mips64r2el-nf = "lib64" MIPSPKGSFX_VARIANT:tune-mips64r2el-nf = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2el-nf = "mips64el-nf mips64r2el-nf" -QEMU_EXTRAOPTIONS_mips64r2el-nf = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2el-nf = " -cpu MIPS64R2-generic" # MIPS 64r2 n32 AVAILTUNES += "mips64r2-n32 mips64r2el-n32"
@@ -42,13 +42,13 @@ TUNE_FEATURES:tune-mips64r2-n32 = "${TUNE_FEATURES:tune-mips64-n32} mips64r2" BASE_LIB:tune-mips64r2-n32 = "lib32" MIPSPKGSFX_VARIANT:tune-mips64r2-n32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2-n32 = "mips64-n32 mips64r2-n32" -QEMU_EXTRAOPTIONS_mips64r2-n32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2-n32 = " -cpu MIPS64R2-generic" TUNE_FEATURES:tune-mips64r2el-n32 = "${TUNE_FEATURES:tune-mips64el-n32} mips64r2" BASE_LIB:tune-mips64r2el-n32 = "lib32" MIPSPKGSFX_VARIANT:tune-mips64r2el-n32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2el-n32 = "mips64el-n32 mips64r2el-n32" -QEMU_EXTRAOPTIONS_mips64r2el-n32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2el-n32 = " -cpu MIPS64R2-generic" # MIPS 64r2 n32 and Soft Float AVAILTUNES += "mips64r2-nf-n32 mips64r2el-nf-n32"
@@ -57,13 +57,13 @@ TUNE_FEATURES:tune-mips64r2-nf-n32 = "${TUNE_FEATURES:tune-mips64-nf-n32} mips64 BASE_LIB:tune-mips64r2-nf-n32 = "lib32" MIPSPKGSFX_VARIANT:tune-mips64r2-nf-n32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2-nf-n32 = "mips64-nf-n32 mips64r2-nf-n32" -QEMU_EXTRAOPTIONS_mips64r2-nf-n32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2-nf-n32 = " -cpu MIPS64R2-generic" TUNE_FEATURES:tune-mips64r2el-nf-n32 = "${TUNE_FEATURES:tune-mips64el-nf-n32} mips64r2" BASE_LIB:tune-mips64r2el-nf-n32 = "lib32" MIPSPKGSFX_VARIANT:tune-mips64r2el-nf-n32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2el-nf-n32 = "mips64el-nf-n32 mips64r2el-nf-n32" -QEMU_EXTRAOPTIONS_mips64r2el-nf-32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2el-nf-32 = " -cpu MIPS64R2-generic" # MIPS 64r2 o32 AVAILTUNES += "mips64r2-o32 mips64r2el-o32"
@@ -72,13 +72,13 @@ TUNE_FEATURES:tune-mips64r2-o32 = "${TUNE_FEATURES:tune-mips64-o32} mips64r2" BASE_LIB:tune-mips64r2-o32 = "lib" MIPSPKGSFX_VARIANT:tune-mips64r2-o32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2-o32 = "mips mips64-o32 mips64r2-o32" -QEMU_EXTRAOPTIONS_mips64r2-o32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2-o32 = " -cpu MIPS64R2-generic" TUNE_FEATURES:tune-mips64r2el-o32 = "${TUNE_FEATURES:tune-mips64el-o32} mips64r2" BASE_LIB:tune-mips64r2el-o32 = "lib" MIPSPKGSFX_VARIANT:tune-mips64r2el-o32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2el-o32 = "mipsel mips64el-o32 mips64r2el-o32" -QEMU_EXTRAOPTIONS_mips64r2el-o32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2el-o32 = " -cpu MIPS64R2-generic" # MIPS 64r2 o32 and Soft Float AVAILTUNES += "mips64r2-nf-o32 mips64r2el-nf-o32"
@@ -87,10 +87,10 @@ TUNE_FEATURES:tune-mips64r2-nf-o32 = "${TUNE_FEATURES:tune-mips64-nf-o32} mips64 BASE_LIB:tune-mips64r2-nf-o32 = "lib" MIPSPKGSFX_VARIANT:tune-mips64r2-nf-o32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2-nf-o32 = "mips-nf mips64r2-nf-o32" -QEMU_EXTRAOPTIONS_mips64r2-nf-o32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2-nf-o32 = " -cpu MIPS64R2-generic" TUNE_FEATURES:tune-mips64r2el-nf-o32 = "${TUNE_FEATURES:tune-mips64el-nf-o32} mips64r2" BASE_LIB:tune-mips64r2el-nf-o32 = "lib" MIPSPKGSFX_VARIANT:tune-mips64r2el-nf-o32 = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS:tune-mips64r2el-nf-o32 = "mipsel-nf mips64r2el-nf-o32" -QEMU_EXTRAOPTIONS_mips64r2el-nf-o32 = " -cpu MIPS64R2-generic" +QEMU_EXTRAOPTIONS:tune-mips64r2el-nf-o32 = " -cpu MIPS64R2-generic"
meta/conf/machine/include/powerpc/arch-powerpc64.inc +1 -1
@@ -21,4 +21,4 @@ TUNE_FEATURES:tune-powerpc64le = "m64 fpu-hard" BASE_LIB:tune-powerpc64le = "lib64" TUNE_PKGARCH:tune-powerpc64le = "powerpc64le" PACKAGE_EXTRA_ARCHS:tune-powerpc64le = "powerpc64le" -QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9" +QEMU_EXTRAOPTIONS:tune-powerpc64le = " -cpu POWER9"
meta/conf/machine/include/powerpc/tune-ppc7400.inc +1 -1
@@ -9,4 +9,4 @@ AVAILTUNES += "ppc7400" TUNE_FEATURES:tune-ppc7400 = "m32 fpu-hard ppc7400 altivec bigendian" TUNE_PKGARCH:tune-ppc7400 = "ppc7400" PACKAGE_EXTRA_ARCHS:tune-ppc7400 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppc7400" -QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400" +QEMU_EXTRAOPTIONS:tune-ppc7400 = " -cpu 7400"
meta/conf/machine/include/powerpc/tune-ppce500mc.inc +1 -1
@@ -9,7 +9,7 @@ AVAILTUNES += "ppce500mc" TUNE_FEATURES:tune-ppce500mc = "m32 fpu-hard ppce500mc bigendian" TUNE_PKGARCH:tune-ppce500mc = "ppce500mc" PACKAGE_EXTRA_ARCHS:tune-ppce500mc = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppce500mc" -QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc" +QEMU_EXTRAOPTIONS:tune-ppce500mc = " -cpu e500mc" # pass -mcpu=e500mc for ppce500mc kernel cross compile TARGET_CC_KERNEL_ARCH = "-mcpu=e500mc"
meta/conf/machine/include/powerpc/tune-ppce500v2.inc +1 -1
@@ -18,4 +18,4 @@ AVAILTUNES += "ppce500v2" TUNE_FEATURES:tune-ppce500v2 = "m32 ppce500v2 bigendian" TUNE_PKGARCH:tune-ppce500v2 = "ppce500v2" PACKAGE_EXTRA_ARCHS:tune-ppce500v2 = "ppce500v2" -QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2" +QEMU_EXTRAOPTIONS:tune-ppce500v2 = " -cpu e500v2"
meta/conf/machine/include/powerpc/tune-ppce5500.inc +2 -2
@@ -10,13 +10,13 @@ TUNE_FEATURES:tune-ppce5500 = "m32 fpu-hard e5500 bigendian" BASE_LIB:tune-ppce5500 = "lib" TUNE_PKGARCH:tune-ppce5500 = "ppce5500" PACKAGE_EXTRA_ARCHS:tune-ppce5500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppce5500" -QEMU_EXTRAOPTIONS_ppce5500 = " -cpu e500mc" +QEMU_EXTRAOPTIONS:tune-ppce5500 = " -cpu e500mc" TUNE_FEATURES:tune-ppc64e5500 = "m64 fpu-hard e5500 bigendian" BASE_LIB:tune-ppc64e5500 = "lib64" TUNE_PKGARCH:tune-ppc64e5500 = "ppc64e5500" PACKAGE_EXTRA_ARCHS:tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc64} ppc64e5500" -QEMU_EXTRAOPTIONS_ppc64e5500 = " -cpu e500mc" +QEMU_EXTRAOPTIONS:tune-ppc64e5500 = " -cpu e500mc" # QEMU usermode fails with invalid instruction error (YOCTO: #10304) MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}"
meta/conf/machine/include/powerpc/tune-ppce6500.inc +2 -2
@@ -10,13 +10,13 @@ TUNE_FEATURES:tune-ppce6500 = "m32 fpu-hard e6500 altivec bigendian" BASE_LIB:tune-ppce6500 = "lib" TUNE_PKGARCH:tune-ppce6500 = "ppce6500" PACKAGE_EXTRA_ARCHS:tune-ppce6500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc} ppce6500" -QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc" +QEMU_EXTRAOPTIONS:tune-ppce6500 = " -cpu e500mc" TUNE_FEATURES:tune-ppc64e6500 = "m64 fpu-hard e6500 altivec bigendian" BASE_LIB:tune-ppc64e6500 = "lib64" TUNE_PKGARCH:tune-ppc64e6500 = "ppc64e6500" PACKAGE_EXTRA_ARCHS:tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS:tune-powerpc64} ppc64e6500" -QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" +QEMU_EXTRAOPTIONS:tune-ppc64e6500 = " -cpu e500mc" # QEMU usermode fails with invalid instruction error (YOCTO: #10304) MACHINE_FEATURES_BACKFILL_CONSIDERED:append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}"
meta/conf/machine/include/x86/tune-core2.inc +3 -3
@@ -21,18 +21,18 @@ TUNE_FEATURES:tune-core2-32 = "${TUNE_FEATURES:tune-x86} core2" BASE_LIB:tune-core2-32 = "lib" TUNE_PKGARCH:tune-core2-32 = "core2-32" PACKAGE_EXTRA_ARCHS:tune-core2-32 = "${PACKAGE_EXTRA_ARCHS:tune-i686} core2-32" -QEMU_EXTRAOPTIONS_core2-32 = " -cpu Nehalem,check=false" +QEMU_EXTRAOPTIONS:tune-core2-32 = " -cpu Nehalem,check=false" AVAILTUNES += "core2-64" TUNE_FEATURES:tune-core2-64 = "${TUNE_FEATURES:tune-x86-64} core2" BASE_LIB:tune-core2-64 = "lib64" TUNE_PKGARCH:tune-core2-64 = "core2-64" PACKAGE_EXTRA_ARCHS:tune-core2-64 = "${PACKAGE_EXTRA_ARCHS:tune-x86-64} core2-64" -QEMU_EXTRAOPTIONS_core2-64 = " -cpu Nehalem,check=false" +QEMU_EXTRAOPTIONS:tune-core2-64 = " -cpu Nehalem,check=false" AVAILTUNES += "core2-64-x32" TUNE_FEATURES:tune-core2-64-x32 = "${TUNE_FEATURES:tune-x86-64-x32} core2" BASE_LIB:tune-core2-64-x32 = "libx32" TUNE_PKGARCH:tune-core2-64-x32 = "core2-64-x32" PACKAGE_EXTRA_ARCHS:tune-core2-64-x32 = "${PACKAGE_EXTRA_ARCHS:tune-x86-64-x32} core2-64-x32" -QEMU_EXTRAOPTIONS_core2-64-x32 = " -cpu Nehalem,check=false" +QEMU_EXTRAOPTIONS:tune-core2-64-x32 = " -cpu Nehalem,check=false"
meta/conf/machine/include/x86/tune-corei7.inc +3 -3
@@ -21,18 +21,18 @@ TUNE_FEATURES:tune-corei7-32 = "${TUNE_FEATURES:tune-x86} corei7" BASE_LIB:tune-corei7-32 = "lib" TUNE_PKGARCH:tune-corei7-32 = "corei7-32" PACKAGE_EXTRA_ARCHS:tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS:tune-core2-32} corei7-32" -QEMU_EXTRAOPTIONS_corei7-32 = " -cpu Nehalem,check=false" +QEMU_EXTRAOPTIONS:tune-corei7-32 = " -cpu Nehalem,check=false" AVAILTUNES += "corei7-64" TUNE_FEATURES:tune-corei7-64 = "${TUNE_FEATURES:tune-x86-64} corei7" BASE_LIB:tune-corei7-64 = "lib64" TUNE_PKGARCH:tune-corei7-64 = "corei7-64" PACKAGE_EXTRA_ARCHS:tune-corei7-64 = "${PACKAGE_EXTRA_ARCHS:tune-core2-64} corei7-64" -QEMU_EXTRAOPTIONS_corei7-64 = " -cpu Nehalem,check=false" +QEMU_EXTRAOPTIONS:tune-corei7-64 = " -cpu Nehalem,check=false" AVAILTUNES += "corei7-64-x32" TUNE_FEATURES:tune-corei7-64-x32 = "${TUNE_FEATURES:tune-x86-64-x32} corei7" BASE_LIB:tune-corei7-64-x32 = "libx32" TUNE_PKGARCH:tune-corei7-64-x32 = "corei7-64-x32" PACKAGE_EXTRA_ARCHS:tune-corei7-64-x32 = "${PACKAGE_EXTRA_ARCHS:tune-core2-64-x32} corei7-64-x32" -QEMU_EXTRAOPTIONS_corei7-64-x32 = " -cpu Nehalem,check=false" +QEMU_EXTRAOPTIONS:tune-corei7-64-x32 = " -cpu Nehalem,check=false"
meta/conf/machine/include/x86/tune-x86-64-v3.inc +2 -2
@@ -21,11 +21,11 @@ TUNE_FEATURES:tune-x86-64-v3 = "${TUNE_FEATURES:tune-x86-64} x86-64-v3" BASE_LIB:tune-x86-64-v3 = "lib64" TUNE_PKGARCH:tune-x86-64-v3 = "x86-64-v3" PACKAGE_EXTRA_ARCHS:tune-x86-64-v3 = "${PACKAGE_EXTRA_ARCHS:tune-corei7-64} x86-64-v3" -QEMU_EXTRAOPTIONS_x86-64-v3 = " -cpu Skylake-Client,check=false" +QEMU_EXTRAOPTIONS:tune-x86-64-v3 = " -cpu Skylake-Client,check=false" AVAILTUNES += "x86-64-v3-x32" TUNE_FEATURES:tune-x86-64-v3-x32 = "${TUNE_FEATURES:tune-x86-64-x32} x86-64-v3" BASE_LIB:tune-x86-64-v3-x32 = "libx32" TUNE_PKGARCH:tune-x86-64-v3-x32 = "x86-64-v3-x32" PACKAGE_EXTRA_ARCHS:tune-x86-64-v3-x32 = "${PACKAGE_EXTRA_ARCHS:tune-corei7-64-x32} x86-64-v3-x32" -QEMU_EXTRAOPTIONS_x86-64-v3-x32 = " -cpu Skylake-Client,check=false" +QEMU_EXTRAOPTIONS:tune-x86-64-v3-x32 = " -cpu Skylake-Client,check=false"
meta/recipes-devtools/gcc/gcc-testsuite.inc +1 -1
@@ -54,7 +54,7 @@ python check_prepare() { if qemu_binary.endswith(("x86_64", "i386", "arm", "aarch64")): args += ["-cpu", "max"] else: - extra = d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) + extra = d.getVar("QEMU_EXTRAOPTIONS:tune-%s" % d.getVar('TUNE_PKGARCH')) if extra: args += extra.split() # For mips64 we could set a maximal CPU (e.g. Loongson-3A4000) however they either have MSA
Signature · 1 line
2.43.0
Hi,
I was using TUNE_PKGARCH to retrieve the architecture of the final embedded target, in a nativesdk recipe which only creates a cmake file pointing to the right sysroot path (cmake toolchain file). This obviously stopped working with this patch, however I'm not sure what the clean way to fix this is.
Do I understand correctly that any recipe which needs to be aware of the actual target architecture should inherit cross-canadian.bbclass instead of nativesdk.bbclass? Or should I add something like "TARGET_ACTUAL_PKGARCH" to nativesdk.bbclass?
Thanks,
Étienne
Quoted 42 lines · Ross Burton via lists.openembedded.org
The nativesdk class overrides
PACKAGE_ARCHand unsetsTUNE_FEATURES, but as recipes might want to look atTUNE_PKGARCHtoo (for example, when settingQEMU_EXTRAOPTIONS) we should also override that variable.Otherwise, a nativesdk recipe will have the
TUNE_PKGARCHof the target, which leads to errors (eg passing mips arguments to an arm qemu).Signed-off-by Ross Burton <[email protected]>--- meta/classes-recipe/nativesdk.bbclass | 1 + 1 file changed, 1 insertion(+)meta/classes-recipe/nativesdk.bbclass +1
-1@@ -32,6 +32,7 @@ RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot" # PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" +TUNE_PKGARCH = "${SDK_ARCH}" # # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit --2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#209660):
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_message_209660&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=WUka6gPzHbL9TE5ZAoD4BQvCgcMYKkOu1IrPrjksrmUBAk0vuk3BpV1t8oaEwTyf&s=TPtFgHj79RNEq6iL3Uxa01OjFr0K74vmPh3nxxZZQZY&e=
Mute This Topic:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_mt_110539749_7048771&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=WUka6gPzHbL9TE5ZAoD4BQvCgcMYKkOu1IrPrjksrmUBAk0vuk3BpV1t8oaEwTyf&s=mifiNwos_7bKHeewrpcqyuofX-FvX7RPlxDhY5ySxfE&e=
Group Owner: [email protected] Unsubscribe:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_unsub&d=DwIFaQ&c=ncDTmphkJTvjIDPh0hpF_4vCHvabgGkICC2epckfdiw&r=AhkbNonVuMIGRfPx_Qj9TsRih1DULJTKUkSGa66m67E&m=WUka6gPzHbL9TE5ZAoD4BQvCgcMYKkOu1IrPrjksrmUBAk0vuk3BpV1t8oaEwTyf&s=UJRePpE8mfPKpZE3UsDr_Y1qxcxp6nZVq7rHvR5YqXc&e=
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Yes, I believe switching to cross-canadian is the correct thing to do. We also had a nativesdk recipe that relied on ${TUNE_PKGARCH} being set to the target architecture, and I had to rewrite it to use cross-canadian due to the change below.
//Peter
From: [email protected] <[email protected]> On Behalf Of Etienne Cordonnier via lists.openembedded.org
Sent: den 20 maj 2025 18:29
To: [email protected]
Cc: [email protected]
Subject: Re: [OE-core] [PATCH v2 1/4] classes/nativesdk: also override TUNE_PKGARCH
Hi,
I was using TUNE_PKGARCH to retrieve the architecture of the final embedded target, in a nativesdk recipe which only creates a cmake file pointing to the right sysroot path (cmake toolchain file). This obviously stopped working with this patch, however I'm not sure what the clean way to fix this is.
Do I understand correctly that any recipe which needs to be aware of the actual target architecture should inherit cross-canadian.bbclass instead of nativesdk.bbclass? Or should I add something like "TARGET_ACTUAL_PKGARCH" to nativesdk.bbclass?
Thanks,
Étienne
On Fri, Jan 10, 2025 at 7:06 PM Ross Burton via lists.openembedded.org<http://lists.openembedded.org> <[email protected]<mailto:[email protected]>> wrote:
The nativesdk class overrides PACKAGE_ARCH and unsets TUNE_FEATURES, but
as recipes might want to look at TUNE_PKGARCH too (for example, when
setting QEMU_EXTRAOPTIONS) we should also override that variable.
Otherwise, a nativesdk recipe will have the TUNE_PKGARCH of the target, which leads to errors (eg passing mips arguments to an arm qemu).
--- meta/classes-recipe/nativesdk.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes-recipe/nativesdk.bbclass +1 -0
@@ -32,6 +32,7 @@ RECIPE_SYSROOT = "${WORKDIR}/recipe-sysroot" # PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}" +TUNE_PKGARCH = "${SDK_ARCH}" # # We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
--
2.43.0