diff options
| author | Ross Burton <ross.burton@arm.com> | 2025-01-10 13:13:39 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-01-24 07:49:28 -0800 |
| commit | 966aead7e857386206e69b37487e9ace6ee31eba (patch) | |
| tree | aaf33865aebb72ee0fb1ee5a9c112ebc0254326d | |
| parent | 83dfb365a81248aa3453bd62e24d870aae862f0b (diff) | |
| download | poky-966aead7e857386206e69b37487e9ace6ee31eba.tar.gz | |
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 ]
(From OE-Core rev: 077aab43f2c928eb8da71934405c62327010f552)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/classes/qemu.bbclass | 8 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-testsuite.inc | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass index 7493ac34d4..1b888f4699 100644 --- a/meta/classes/qemu.bbclass +++ b/meta/classes/qemu.bbclass | |||
| @@ -54,8 +54,8 @@ def qemu_run_binary(data, rootfs_path, binary): | |||
| 54 | # this dance). For others (e.g. arm) a -cpu option is not necessary, since the | 54 | # this dance). For others (e.g. arm) a -cpu option is not necessary, since the |
| 55 | # qemu-arm default CPU supports all required architecture levels. | 55 | # qemu-arm default CPU supports all required architecture levels. |
| 56 | 56 | ||
| 57 | QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}" | 57 | QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) or ""}" |
| 58 | QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}" | 58 | QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}" |
| 59 | 59 | ||
| 60 | QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2" | 60 | QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2" |
| 61 | QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc" | 61 | QEMU_EXTRAOPTIONS_ppce500mc = " -cpu e500mc" |
| @@ -65,7 +65,3 @@ QEMU_EXTRAOPTIONS_ppce6500 = " -cpu e500mc" | |||
| 65 | QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" | 65 | QEMU_EXTRAOPTIONS_ppc64e6500 = " -cpu e500mc" |
| 66 | QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400" | 66 | QEMU_EXTRAOPTIONS_ppc7400 = " -cpu 7400" |
| 67 | QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9" | 67 | QEMU_EXTRAOPTIONS_powerpc64le = " -cpu POWER9" |
| 68 | # Some packages e.g. fwupd sets PACKAGE_ARCH = MACHINE_ARCH and uses meson which | ||
| 69 | # needs right options to usermode qemu | ||
| 70 | QEMU_EXTRAOPTIONS_qemuppc = " -cpu 7400" | ||
| 71 | QEMU_EXTRAOPTIONS_qemuppc64 = " -cpu POWER9" | ||
diff --git a/meta/recipes-devtools/gcc/gcc-testsuite.inc b/meta/recipes-devtools/gcc/gcc-testsuite.inc index 64f60c730f..eaac98f9ba 100644 --- a/meta/recipes-devtools/gcc/gcc-testsuite.inc +++ b/meta/recipes-devtools/gcc/gcc-testsuite.inc | |||
| @@ -53,8 +53,10 @@ python check_prepare() { | |||
| 53 | # - valid for x86*, powerpc, arm, arm64 | 53 | # - valid for x86*, powerpc, arm, arm64 |
| 54 | if qemu_binary.lstrip("qemu-") in ["x86_64", "i386", "arm", "aarch64"]: | 54 | if qemu_binary.lstrip("qemu-") in ["x86_64", "i386", "arm", "aarch64"]: |
| 55 | args += ["-cpu", "max"] | 55 | args += ["-cpu", "max"] |
| 56 | elif qemu_binary.lstrip("qemu-") in ["ppc"]: | 56 | else: |
| 57 | args += d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')).split() | 57 | extra = d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('TUNE_PKGARCH')) |
| 58 | if extra: | ||
| 59 | args += extra.split() | ||
| 58 | sysroot = d.getVar("RECIPE_SYSROOT") | 60 | sysroot = d.getVar("RECIPE_SYSROOT") |
| 59 | args += ["-L", sysroot] | 61 | args += ["-L", sysroot] |
| 60 | # lib paths are static here instead of using $libdir since this is used by a -cross recipe | 62 | # lib paths are static here instead of using $libdir since this is used by a -cross recipe |
