diff mbox series

qemu: Fix build on riscv64

Message ID 20241124175936.3682310-1-raj.khem@gmail.com
State New
Headers show
Series qemu: Fix build on riscv64 | expand

Commit Message

Khem Raj Nov. 24, 2024, 5:59 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/qemu/qemu.inc           |  1 +
 ...o-riscv.c-fix-riscv64-build-on-musl-.patch | 41 +++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/0001-util-util-cpuinfo-riscv.c-fix-riscv64-build-on-musl-.patch

Comments

patchtest@automation.yoctoproject.org Nov. 24, 2024, 6:16 p.m. UTC | #1
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:

---
Testing patch /home/patchtest/share/mboxes/qemu-Fix-build-on-riscv64.patch

FAIL: test commit message presence: Please include a commit message on your patch explaining the change (test_mbox.TestMbox.test_commit_message_presence)

PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
diff mbox series

Patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 02cd7c8dc8f..041a24e711c 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -33,6 +33,7 @@  SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
            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-sched_attr-Do-not-define-for-glibc-2.41.patch \
+           file://0001-util-util-cpuinfo-riscv.c-fix-riscv64-build-on-musl-.patch \
            file://qemu-guest-agent.init \
            file://qemu-guest-agent.udev \
            "
diff --git a/meta/recipes-devtools/qemu/qemu/0001-util-util-cpuinfo-riscv.c-fix-riscv64-build-on-musl-.patch b/meta/recipes-devtools/qemu/qemu/0001-util-util-cpuinfo-riscv.c-fix-riscv64-build-on-musl-.patch
new file mode 100644
index 00000000000..16762e033eb
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0001-util-util-cpuinfo-riscv.c-fix-riscv64-build-on-musl-.patch
@@ -0,0 +1,41 @@ 
+From f60ea4ae2298f0f077a97648c138283357337370 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=2E=20Stani=C4=87?= <mps@arvanta.net>
+Date: Thu, 5 Sep 2024 16:17:50 +0200
+Subject: [PATCH] util/util/cpuinfo-riscv.c: fix riscv64 build on musl libc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+build fails on musl libc (alpine linux) with this error:
+
+../util/cpuinfo-riscv.c: In function 'cpuinfo_init':
+../util/cpuinfo-riscv.c:63:21: error: '__NR_riscv_hwprobe' undeclared (first use in this function); did you mean 'riscv_hwprobe'?
+   63 |         if (syscall(__NR_riscv_hwprobe, &pair, 1, 0, NULL, 0) == 0
+      |                     ^~~~~~~~~~~~~~~~~~
+      |                     riscv_hwprobe
+../util/cpuinfo-riscv.c:63:21: note: each undeclared identifier is reported only once for each function it appears in
+ninja: subcommand failed
+
+add '#include "asm/unistd.h"' to util/cpuinfo-riscv.c fixes build
+
+Upstream-Status: Backport [https://github.com/qemu/qemu/commit/c5757f808bd74db7ef1a90ee28334f3b5afb8179]
+Signed-off-by: Milan P. Stanić <mps@arvanta.net>
+---
+ util/cpuinfo-riscv.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/util/cpuinfo-riscv.c b/util/cpuinfo-riscv.c
+index 497ce12680..8cacc67645 100644
+--- a/util/cpuinfo-riscv.c
++++ b/util/cpuinfo-riscv.c
+@@ -9,6 +9,7 @@
+ #ifdef CONFIG_ASM_HWPROBE_H
+ #include <asm/hwprobe.h>
+ #include <sys/syscall.h>
++#include <asm/unistd.h>
+ #endif
+ 
+ unsigned cpuinfo;
+-- 
+2.46.0
+