From f694084dbc48b49c9d9ebdc0f5b6d13b29176708 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 24 Aug 2023 16:41:20 +0100 Subject: qemu: Upgrade 8.0.4 -> 8.1.0 This upgrade isn't straighforward as upstream made changes. A pyenv is now needed containing meson. This doesn't work for us for reasons as yet unclear however it does mean we need python3native inherited for that to stand a chance of working as otherwise host system dependencies may be missing. For now, allow meson to work from our sysroot via a patch. Our meson is always deterministic anyway so we don't need their help for that. The submodules approach used previously has changed, switch the options for new ones to disable downloads and docs. Some of the images binaries shipped for s390 show QA warnings for relocations in code sections. Drop those binaries to avoid the QA warnings since we don't need them anyway. Drop a backported patch and refresh another. (From OE-Core rev: a7176c3b2a7e2041b9be5dabb6b0f1e62f235f76) Signed-off-by: Richard Purdie --- meta/recipes-devtools/qemu/qemu-native_8.0.4.bb | 9 --- meta/recipes-devtools/qemu/qemu-native_8.1.0.bb | 9 +++ .../qemu/qemu-system-native_8.0.4.bb | 33 --------- .../qemu/qemu-system-native_8.1.0.bb | 33 +++++++++ meta/recipes-devtools/qemu/qemu.inc | 18 +++-- ...se-relative-paths-for-line-preprocessor-d.patch | 84 ---------------------- ...ure-Add-pkg-config-handling-for-libgcrypt.patch | 12 ++-- meta/recipes-devtools/qemu/qemu/fixedmeson.patch | 20 ++++++ meta/recipes-devtools/qemu/qemu_8.0.4.bb | 27 ------- meta/recipes-devtools/qemu/qemu_8.1.0.bb | 27 +++++++ 10 files changed, 106 insertions(+), 166 deletions(-) delete mode 100644 meta/recipes-devtools/qemu/qemu-native_8.0.4.bb create mode 100644 meta/recipes-devtools/qemu/qemu-native_8.1.0.bb delete mode 100644 meta/recipes-devtools/qemu/qemu-system-native_8.0.4.bb create mode 100644 meta/recipes-devtools/qemu/qemu-system-native_8.1.0.bb delete mode 100644 meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch create mode 100644 meta/recipes-devtools/qemu/qemu/fixedmeson.patch delete mode 100644 meta/recipes-devtools/qemu/qemu_8.0.4.bb create mode 100644 meta/recipes-devtools/qemu/qemu_8.1.0.bb (limited to 'meta/recipes-devtools/qemu') diff --git a/meta/recipes-devtools/qemu/qemu-native_8.0.4.bb b/meta/recipes-devtools/qemu/qemu-native_8.0.4.bb deleted file mode 100644 index 73a0f63f2b..0000000000 --- a/meta/recipes-devtools/qemu/qemu-native_8.0.4.bb +++ /dev/null @@ -1,9 +0,0 @@ -BPN = "qemu" - -DEPENDS = "glib-2.0-native zlib-native ninja-native meson-native" - -require qemu-native.inc - -EXTRA_OECONF:append = " --target-list=${@get_qemu_usermode_target_list(d)} --disable-tools --disable-install-blobs --disable-guest-agent" - -PACKAGECONFIG ??= "pie" diff --git a/meta/recipes-devtools/qemu/qemu-native_8.1.0.bb b/meta/recipes-devtools/qemu/qemu-native_8.1.0.bb new file mode 100644 index 0000000000..73a0f63f2b --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu-native_8.1.0.bb @@ -0,0 +1,9 @@ +BPN = "qemu" + +DEPENDS = "glib-2.0-native zlib-native ninja-native meson-native" + +require qemu-native.inc + +EXTRA_OECONF:append = " --target-list=${@get_qemu_usermode_target_list(d)} --disable-tools --disable-install-blobs --disable-guest-agent" + +PACKAGECONFIG ??= "pie" diff --git a/meta/recipes-devtools/qemu/qemu-system-native_8.0.4.bb b/meta/recipes-devtools/qemu/qemu-system-native_8.0.4.bb deleted file mode 100644 index 04c7c2a6ac..0000000000 --- a/meta/recipes-devtools/qemu/qemu-system-native_8.0.4.bb +++ /dev/null @@ -1,33 +0,0 @@ -BPN = "qemu" - -inherit python3-dir - -require qemu-native.inc - -# As some of the files installed by qemu-native and qemu-system-native -# are the same, we depend on qemu-native to get the full installation set -# and avoid file clashes -DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native bison-native meson-native ninja-native" - -EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}" - -PACKAGECONFIG ??= "fdt alsa kvm pie slirp \ - ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \ -" - -# Handle distros such as CentOS 5 32-bit that do not have kvm support -PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}" - -do_install:append() { - install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu - - # The following is also installed by qemu-native - rm -f ${D}${datadir}/qemu/trace-events-all - rm -rf ${D}${datadir}/qemu/keymaps - rm -rf ${D}${datadir}/icons/ - rm -rf ${D}${includedir}/qemu-plugin.h - - # Install qmp.py to be used with testimage - install -d ${D}${libdir}/qemu-python/qmp/ - install -D ${S}/python/qemu/qmp/* ${D}${libdir}/qemu-python/qmp/ -} diff --git a/meta/recipes-devtools/qemu/qemu-system-native_8.1.0.bb b/meta/recipes-devtools/qemu/qemu-system-native_8.1.0.bb new file mode 100644 index 0000000000..04c7c2a6ac --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu-system-native_8.1.0.bb @@ -0,0 +1,33 @@ +BPN = "qemu" + +inherit python3-dir + +require qemu-native.inc + +# As some of the files installed by qemu-native and qemu-system-native +# are the same, we depend on qemu-native to get the full installation set +# and avoid file clashes +DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native bison-native meson-native ninja-native" + +EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}" + +PACKAGECONFIG ??= "fdt alsa kvm pie slirp \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \ +" + +# Handle distros such as CentOS 5 32-bit that do not have kvm support +PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}" + +do_install:append() { + install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu + + # The following is also installed by qemu-native + rm -f ${D}${datadir}/qemu/trace-events-all + rm -rf ${D}${datadir}/qemu/keymaps + rm -rf ${D}${datadir}/icons/ + rm -rf ${D}${includedir}/qemu-plugin.h + + # Install qmp.py to be used with testimage + install -d ${D}${libdir}/qemu-python/qmp/ + install -D ${S}/python/qemu/qmp/* ${D}${libdir}/qemu-python/qmp/ +} diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index b98169c243..131162dd62 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc @@ -9,7 +9,9 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only" RDEPENDS:${PN}-ptest = "bash" require qemu-targets.inc -inherit pkgconfig ptest update-rc.d systemd +# https://gitlab.com/qemu-project/qemu/-/commit/81e2b198a8cb4ee5fdf108bd438f44b193ee3a36 means +# we need a full python3-native setup +inherit pkgconfig ptest update-rc.d systemd python3native LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" @@ -27,14 +29,13 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ file://0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \ file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \ file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \ - file://0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch \ - file://0001-CVE-2023-40360-hw-nvme-fix-null-pointer-access-in-di.patch \ + file://fixedmeson.patch \ file://qemu-guest-agent.init \ file://qemu-guest-agent.udev \ " UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar" -SRC_URI[sha256sum] = "81c817dda38af958be5bef1a6cf55b658bb2d3fb87c1e6a571de6b7b2c44516c" +SRC_URI[sha256sum] = "710c101198e334d4762eef65f649bc43fa8a5dd75303554b8acfec3eb25f0e55" SRC_URI:append:class-target = " file://cross.patch" SRC_URI:append:class-nativesdk = " file://cross.patch" @@ -105,9 +106,8 @@ EXTRA_OECONF = " \ --disable-werror \ --extra-cflags='${CFLAGS}' \ --extra-ldflags='${LDFLAGS}' \ - --with-git=/bin/false \ - --with-git-submodules=ignore \ - --meson=meson \ + --disable-download \ + --disable-docs \ ${PACKAGECONFIG_CONFARGS} \ " @@ -145,6 +145,10 @@ do_install () { install -m 0644 ${S}/contrib/systemd/qemu-guest-agent.service ${D}${systemd_unitdir}/system sed -i -e 's,-/usr/bin/,-${bindir}/,g' ${D}${systemd_unitdir}/system/qemu-guest-agent.service fi + # ELF binary /usr/share/qemu/s390-netboot.img has relocations in .text + rm ${D}${datadir}/qemu/s390-netboot.img -f + # ELF binary /usr/share/qemu/s390-ccw.img has relocations in .text [textrel] + rm ${D}${datadir}/qemu/s390-ccw.img -f } # The following fragment will create a wrapper for qemu-mips user emulation diff --git a/meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch b/meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch deleted file mode 100644 index 049b9a5105..0000000000 --- a/meta/recipes-devtools/qemu/qemu/0001-tracetool-use-relative-paths-for-line-preprocessor-d.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 348ea441db84a211d4fca7ef5544b5cd06a8a872 Mon Sep 17 00:00:00 2001 -From: Thomas De Schampheleire -Date: Tue, 4 Apr 2023 15:26:07 +0200 -Subject: [PATCH] tracetool: use relative paths for '#line' preprocessor - directives - -The event filename is an absolute path. Convert it to a relative path when -writing '#line' directives, to preserve reproducibility of the generated -output when different base paths are used. - -Upstream-Status: Accepted [https://gitlab.com/qemu-project/qemu/-/commit/9d672e290475001fcecdcc9dc79ad088ff89d17f] - ---- - scripts/tracetool/backend/ftrace.py | 4 +++- - scripts/tracetool/backend/log.py | 4 +++- - scripts/tracetool/backend/syslog.py | 4 +++- - 3 files changed, 9 insertions(+), 3 deletions(-) - -Index: qemu-8.0.0/scripts/tracetool/backend/ftrace.py -=================================================================== ---- qemu-8.0.0.orig/scripts/tracetool/backend/ftrace.py -+++ qemu-8.0.0/scripts/tracetool/backend/ftrace.py -@@ -12,6 +12,8 @@ __maintainer__ = "Stefan Hajnoczi" - __email__ = "stefanha@redhat.com" - - -+import os.path -+ - from tracetool import out - - -@@ -45,7 +47,7 @@ def generate_h(event, group): - args=event.args, - event_id="TRACE_" + event.name.upper(), - event_lineno=event.lineno, -- event_filename=event.filename, -+ event_filename=os.path.relpath(event.filename), - fmt=event.fmt.rstrip("\n"), - argnames=argnames) - -Index: qemu-8.0.0/scripts/tracetool/backend/log.py -=================================================================== ---- qemu-8.0.0.orig/scripts/tracetool/backend/log.py -+++ qemu-8.0.0/scripts/tracetool/backend/log.py -@@ -12,6 +12,8 @@ __maintainer__ = "Stefan Hajnoczi" - __email__ = "stefanha@redhat.com" - - -+import os.path -+ - from tracetool import out - - -@@ -53,7 +55,7 @@ def generate_h(event, group): - ' }', - cond=cond, - event_lineno=event.lineno, -- event_filename=event.filename, -+ event_filename=os.path.relpath(event.filename), - name=event.name, - fmt=event.fmt.rstrip("\n"), - argnames=argnames) -Index: qemu-8.0.0/scripts/tracetool/backend/syslog.py -=================================================================== ---- qemu-8.0.0.orig/scripts/tracetool/backend/syslog.py -+++ qemu-8.0.0/scripts/tracetool/backend/syslog.py -@@ -12,6 +12,8 @@ __maintainer__ = "Stefan Hajnoczi" - __email__ = "stefanha@redhat.com" - - -+import os.path -+ - from tracetool import out - - -@@ -41,7 +43,7 @@ def generate_h(event, group): - ' }', - cond=cond, - event_lineno=event.lineno, -- event_filename=event.filename, -+ event_filename=os.path.relpath(event.filename), - name=event.name, - fmt=event.fmt.rstrip("\n"), - argnames=argnames) diff --git a/meta/recipes-devtools/qemu/qemu/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta/recipes-devtools/qemu/qemu/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch index 02f22143c1..f981a64a54 100644 --- a/meta/recipes-devtools/qemu/qemu/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch +++ b/meta/recipes-devtools/qemu/qemu/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch @@ -14,16 +14,16 @@ Signed-off-by: He Zhe meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -Index: qemu-8.0.0/meson.build +Index: qemu-8.1.0/meson.build =================================================================== ---- qemu-8.0.0.orig/meson.build -+++ qemu-8.0.0/meson.build -@@ -1213,7 +1213,7 @@ endif +--- qemu-8.1.0.orig/meson.build ++++ qemu-8.1.0/meson.build +@@ -1481,7 +1481,7 @@ endif if not gnutls_crypto.found() if (not get_option('gcrypt').auto() or have_system) and not get_option('nettle').enabled() gcrypt = dependency('libgcrypt', version: '>=1.8', - method: 'config-tool', + method: 'pkg-config', - required: get_option('gcrypt'), - kwargs: static_kwargs) + required: get_option('gcrypt')) # Debian has removed -lgpg-error from libgcrypt-config + # as it "spreads unnecessary dependencies" which in diff --git a/meta/recipes-devtools/qemu/qemu/fixedmeson.patch b/meta/recipes-devtools/qemu/qemu/fixedmeson.patch new file mode 100644 index 0000000000..0cbaea07ca --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/fixedmeson.patch @@ -0,0 +1,20 @@ +Upstream-Status: Inappropriate [workaround, would need a real fix for upstream] + +Index: qemu-8.1.0/configure +=================================================================== +--- qemu-8.1.0.orig/configure ++++ qemu-8.1.0/configure +@@ -1032,12 +1032,7 @@ then + exit 1 + fi + +-# At this point, we expect Meson to be installed and available. +-# We expect mkvenv or pip to have created pyvenv/bin/meson for us. +-# We ignore PATH completely here: we want to use the venv's Meson +-# *exclusively*. +- +-meson="$(cd pyvenv/bin; pwd)/meson" ++meson=`which meson` + + # Conditionally ensure Sphinx is installed. + diff --git a/meta/recipes-devtools/qemu/qemu_8.0.4.bb b/meta/recipes-devtools/qemu/qemu_8.0.4.bb deleted file mode 100644 index 84ee0bcc49..0000000000 --- a/meta/recipes-devtools/qemu/qemu_8.0.4.bb +++ /dev/null @@ -1,27 +0,0 @@ -BBCLASSEXTEND = "nativesdk" - -require qemu.inc - -DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native" - -DEPENDS:append:libc-musl = " libucontext" - -CFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}" - -RDEPENDS:${PN}-common:class-target += "bash" - -EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}" -EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}" -EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}" - -PACKAGECONFIG ??= " \ - fdt sdl kvm pie slirp \ - ${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio xen', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)} \ -" -PACKAGECONFIG:class-nativesdk ??= "fdt sdl kvm pie slirp \ - ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \ -" -# ppc32 hosts are no longer supported in qemu -COMPATIBLE_HOST:powerpc = "null" diff --git a/meta/recipes-devtools/qemu/qemu_8.1.0.bb b/meta/recipes-devtools/qemu/qemu_8.1.0.bb new file mode 100644 index 0000000000..84ee0bcc49 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu_8.1.0.bb @@ -0,0 +1,27 @@ +BBCLASSEXTEND = "nativesdk" + +require qemu.inc + +DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native" + +DEPENDS:append:libc-musl = " libucontext" + +CFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}" + +RDEPENDS:${PN}-common:class-target += "bash" + +EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}" +EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}" +EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}" + +PACKAGECONFIG ??= " \ + fdt sdl kvm pie slirp \ + ${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio xen', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)} \ +" +PACKAGECONFIG:class-nativesdk ??= "fdt sdl kvm pie slirp \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \ +" +# ppc32 hosts are no longer supported in qemu +COMPATIBLE_HOST:powerpc = "null" -- cgit v1.2.3-54-g00ecf