]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
gcc-testsuite: Fix qemu binary filtering code logic error
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 13 Aug 2023 09:13:03 +0000 (10:13 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 Aug 2023 07:14:32 +0000 (08:14 +0100)
This code doesn't do what it first might appear to, it would for example remove
'm' characters from the left side of qemu-mips leaving 'ips'. Fix it to stop
anyone else being confused by the subtle logic error.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/gcc/gcc-testsuite.inc

index 64f60c730fe302a59a0c0b9346429d4d22844819..a8299fa7aebff1f792ed9a10a122cfa995aa3627 100644 (file)
@@ -51,9 +51,9 @@ python check_prepare() {
         # enable all valid instructions, since the test suite itself does not
         # limit itself to the target cpu options.
         #   - valid for x86*, powerpc, arm, arm64
-        if qemu_binary.lstrip("qemu-") in ["x86_64", "i386", "arm", "aarch64"]:
+        if qemu_binary.endswith(("x86_64", "i386", "arm", "aarch64")):
             args += ["-cpu", "max"]
-        elif qemu_binary.lstrip("qemu-") in ["ppc"]:
+        elif qemu_binary.endswith(("ppc")):
             args += d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')).split()
         sysroot = d.getVar("RECIPE_SYSROOT")
         args += ["-L", sysroot]