From: Qi.Chen@windriver.com
To: openembedded-core@lists.openembedded.org
Subject: [OE-core][PATCH] qemu: fix regression for ppc64
Date: Mon, 2 Feb 2026 14:47:34 +0800 [thread overview]
Message-ID: <20260202064734.3870731-1-Qi.Chen@windriver.com> (raw)
From: Chen Qi <Qi.Chen@windriver.com>
The qemu upstream commit, fcac98d0 (linux-user: Remove ELF_HWCAP2),
accidently introduced a regression. It used get_elf_hwcap where
get_elf_hwcap2 should be used.
With recent qemu upgrade in Yocto (10.1.3 -> 10.2.0), qemuppc64 build
is basically broken. There are a lot of do_configure failures with error
message like below:
Fatal glibc error: CPU lacks ISA 3.00 support (POWER9 or later required)
Backport a patch to fix this issue.
Note that although the problem was only revealed for qemuppc64, some arm
and arm64 machines will also likely get the same issue, as in qemu source
we have:
linux-user/aarch64/target_elf.h:#define HAVE_ELF_HWCAP2 1
linux-user/arm/target_elf.h:#define HAVE_ELF_HWCAP2 1
linux-user/ppc/target_elf.h:#define HAVE_ELF_HWCAP2 1
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-devtools/qemu/qemu.inc | 1 +
...load.c-Correction-to-HWCAP2-accessor.patch | 42 +++++++++++++++++++
2 files changed, 43 insertions(+)
create mode 100644 meta/recipes-devtools/qemu/qemu/0001-linux-user-elfload.c-Correction-to-HWCAP2-accessor.patch
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index d320b13ba7..7aa593bc5d 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -32,6 +32,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://0008-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \
file://0010-configure-lookup-meson-exutable-from-PATH.patch \
file://0011-qemu-Ensure-pip-and-the-python-venv-aren-t-used-for-.patch \
+ file://0001-linux-user-elfload.c-Correction-to-HWCAP2-accessor.patch \
file://qemu-guest-agent.init \
file://qemu-guest-agent.udev \
"
diff --git a/meta/recipes-devtools/qemu/qemu/0001-linux-user-elfload.c-Correction-to-HWCAP2-accessor.patch b/meta/recipes-devtools/qemu/qemu/0001-linux-user-elfload.c-Correction-to-HWCAP2-accessor.patch
new file mode 100644
index 0000000000..47d6f41385
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0001-linux-user-elfload.c-Correction-to-HWCAP2-accessor.patch
@@ -0,0 +1,42 @@
+From c333f9c4ee212297f3b9a8a6ef62396a63c48e61 Mon Sep 17 00:00:00 2001
+From: Jim MacArthur <jim.macarthur@linaro.org>
+Date: Tue, 6 Jan 2026 15:40:48 +0000
+Subject: [PATCH] linux-user/elfload.c: Correction to HWCAP2 accessor
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+get_elf_hwcap was used when get_elf_hwcap2 should have been.
+
+Cc: qemu-stable@nongnu.org
+Fixes: fcac98d0ba8b ("linux-user: Remove ELF_HWCAP2")
+Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3259
+Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
+Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
+Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
+Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
+Message-ID: <20260106-fix-hwcap2-sve2-v1-1-1d70dff63370@linaro.org>
+
+Upstream-Status: Backport [https://gitlab.com/qemu-project/qemu/-/commit/c333f9c4ee212297f3b9a8a6ef62396a63c48e61]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ linux-user/elfload.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/linux-user/elfload.c b/linux-user/elfload.c
+index 0002d5be2f..35471c0c9a 100644
+--- a/linux-user/elfload.c
++++ b/linux-user/elfload.c
+@@ -708,7 +708,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
+ NEW_AUX_ENT(AT_EXECFN, info->file_string);
+
+ if (HAVE_ELF_HWCAP2) {
+- NEW_AUX_ENT(AT_HWCAP2, get_elf_hwcap(thread_cpu));
++ NEW_AUX_ENT(AT_HWCAP2, get_elf_hwcap2(thread_cpu));
+ }
+ if (u_base_platform) {
+ NEW_AUX_ENT(AT_BASE_PLATFORM, u_base_platform);
+--
+2.34.1
+
--
2.34.1
reply other threads:[~2026-02-02 6:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260202064734.3870731-1-Qi.Chen@windriver.com \
--to=qi.chen@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox