diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0001-Revert-target-arm-Revert-back-to-YIELD-for-WFI.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0001-Revert-target-arm-Revert-back-to-YIELD-for-WFI.patch deleted file mode 100644 index 157c8f61..00000000 --- a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0001-Revert-target-arm-Revert-back-to-YIELD-for-WFI.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ef1724e0a558a0f6bc93530114173955bf67cf30 Mon Sep 17 00:00:00 2001 -From: Stephanos Ioannidis -Date: Wed, 8 Jan 2020 17:47:05 +0900 -Subject: [PATCH 1/2] Revert "target/arm: Revert back to YIELD for WFI" - -This reverts commit 5f38ea92fb697b94ad43f01fe162f3ed6e6b0e16. - -The commit 5f38ea92fb697b94ad43f01fe162f3ed6e6b0e16 was probably -introduced in order to improve emulation performance, as well as to -address the stability issue when running co-simulations (refer to the -commit 708639f72be2a9425992ae9dc4b9a098dc804c94). - -This, unfortunately, breaks the WFI instruction; i.e. CPU is not halted -and keeps running regardless of whether an interrupt occurs, and this -is a problem for the Zephyr CI tests that expect the WFI instruction to -do its job (in particular, tests/kernel/context is broken because of -this change). - -Signed-off-by: Stephanos Ioannidis ---- - target/arm/op_helper.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c -index acef79251d..6ab3a75a76 100644 ---- a/target/arm/op_helper.c -+++ b/target/arm/op_helper.c -@@ -304,7 +304,7 @@ void HELPER(wfi)(CPUARMState *env, uint32_t insn_len) - } - - qemu_mutex_lock_iothread(); -- if (use_icount || 1) { -+ if (use_icount) { - cs->exception_index = EXCP_YIELD; - } else { - cs->halted = 1; --- -2.17.1 - diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0002-Enable-WFI-CPU-halting-in-icount-mode.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0002-Enable-WFI-CPU-halting-in-icount-mode.patch deleted file mode 100644 index 798765f8..00000000 --- a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0002-Enable-WFI-CPU-halting-in-icount-mode.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6d7ce4d6e5ab8d4222bb41b4e09e3437d534481a Mon Sep 17 00:00:00 2001 -From: Stephanos Ioannidis -Date: Wed, 26 Feb 2020 12:30:55 +0900 -Subject: [PATCH 2/2] Enable WFI CPU halting in icount mode - -This commit enables CPU halting via the WFI instruction in the -icount mode. - -The PetaLinux patch initially disabled WFI CPU halting, possibly for -performance reasons. - -Signed-off-by: Stephanos Ioannidis ---- - target/arm/op_helper.c | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c -index 6ab3a75a76..1199288fdd 100644 ---- a/target/arm/op_helper.c -+++ b/target/arm/op_helper.c -@@ -304,12 +304,9 @@ void HELPER(wfi)(CPUARMState *env, uint32_t insn_len) - } - - qemu_mutex_lock_iothread(); -- if (use_icount) { -- cs->exception_index = EXCP_YIELD; -- } else { -- cs->halted = 1; -- cs->exception_index = EXCP_HLT; -- } -+ -+ cs->halted = 1; -+ cs->exception_index = EXCP_HLT; - - /* Drive STANDBYWFI only if cpu reset-pin is inactive */ - if (cs->reset_pin == false) { --- -2.17.1 - diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch new file mode 100644 index 00000000..f981a64a --- /dev/null +++ b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch @@ -0,0 +1,29 @@ +From d8265abdce5dc2bf74b3fccdf2b7257b4f3894f0 Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Wed, 28 Aug 2019 19:56:28 +0800 +Subject: [PATCH 04/12] configure: Add pkg-config handling for libgcrypt + +libgcrypt may also be controlled by pkg-config, this patch adds pkg-config +handling for libgcrypt. + +Upstream-Status: Denied [https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg06333.html] + +Signed-off-by: He Zhe + +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: qemu-8.1.0/meson.build +=================================================================== +--- 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')) + # Debian has removed -lgpg-error from libgcrypt-config + # as it "spreads unnecessary dependencies" which in diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch new file mode 100644 index 00000000..a84364cc --- /dev/null +++ b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch @@ -0,0 +1,41 @@ +From 2bf9388b801d4389e2d57e95a7897bfc1c42786e Mon Sep 17 00:00:00 2001 +From: Changqing Li +Date: Thu, 14 Jan 2021 06:33:04 +0000 +Subject: [PATCH 08/12] tests/meson.build: use relative path to refer to files + +Fix error like: +Fatal error: can't create tests/ptimer-test.p/..._qemu-5.2.0_hw_core_ptimer.c.o: File name too long + +when build path is too long, use meson.source_root() will make this +filename too long. Fixed by using relative path to refer to files + +Upstream-Status: Submitted [send to qemu-devel] + +Signed-off-by: Changqing Li + +--- + tests/unit/meson.build | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: qemu-8.0.0/tests/unit/meson.build +=================================================================== +--- qemu-8.0.0.orig/tests/unit/meson.build ++++ qemu-8.0.0/tests/unit/meson.build +@@ -46,7 +46,7 @@ tests = { + 'test-keyval': [testqapi], + 'test-logging': [], + 'test-uuid': [], +- 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'], ++ 'ptimer-test': ['ptimer-test-stubs.c', '../../hw/core/ptimer.c'], + 'test-qapi-util': [], + 'test-interval-tree': [], + 'test-xs-node': [qom], +@@ -136,7 +136,7 @@ if have_system + 'test-util-sockets': ['socket-helpers.c'], + 'test-base64': [], + 'test-bufferiszero': [], +- 'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'], ++ 'test-smp-parse': [qom, '../../hw/core/machine-smp.c'], + 'test-vmstate': [migration, io], + 'test-yank': ['socket-helpers.c', qom, io, chardev] + } diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/cross.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/cross.patch new file mode 100644 index 00000000..71aa8d9c --- /dev/null +++ b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/cross.patch @@ -0,0 +1,38 @@ +From 76c3fc4c87231bed32974ebbbdb5079cff45a6b7 Mon Sep 17 00:00:00 2001 +From: Richard Purdie +Date: Tue, 5 Jan 2021 23:00:14 +0000 +Subject: [PATCH 12/12] qemu: Upgrade 5.1.0->5.2.0 + +We need to be able to trigger configure's cross code but we don't want +to set cross_prefix as it does other things we don't want. Patch things +so we can do what we need in the target config case. + +Upstream-Status: Inappropriate [may be rewritten in a way upstream may accept?] +Signed-off-by: Richard Purdie + +--- + configure | 4 ---- + 1 file changed, 4 deletions(-) + +Index: qemu-8.0.0/configure +=================================================================== +--- qemu-8.0.0.orig/configure ++++ qemu-8.0.0/configure +@@ -2590,7 +2590,6 @@ if test "$skip_meson" = no; then + echo "widl = [$(meson_quote $widl)]" >> $cross + echo "windres = [$(meson_quote $windres)]" >> $cross + echo "windmc = [$(meson_quote $windmc)]" >> $cross +- if test "$cross_compile" = "yes"; then + cross_arg="--cross-file config-meson.cross" + echo "[host_machine]" >> $cross + echo "system = '$targetos'" >> $cross +@@ -2608,9 +2607,6 @@ if test "$skip_meson" = no; then + else + echo "endian = 'little'" >> $cross + fi +- else +- cross_arg="--native-file config-meson.cross" +- fi + mv $cross config-meson.cross + + rm -rf meson-private meson-info meson-logs diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/fixedmeson.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/fixedmeson.patch new file mode 100644 index 00000000..d86c229b --- /dev/null +++ b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/fixedmeson.patch @@ -0,0 +1,19 @@ +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-zephyr-sdk/recipes-devtools/qemu_xilinx/files/no-pip.patch b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/no-pip.patch new file mode 100644 index 00000000..71956140 --- /dev/null +++ b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/files/no-pip.patch @@ -0,0 +1,45 @@ +qemu: Ensure pip and the python venv aren't used for meson + +Qemu wants to use a supported python version and a specific meson version +to "help" users and uses pip and creates a venv to do this. This is a nightmare +for us. Our versions stay up to date and should be supported so we don't +really need/want this wrapping. Tweak things to disable it. + +There was breakage from the wrapper shown by: + +bitbake qemu-system-native + +bitbake qemu-system-native -c configure + +which would crash. The issue is the change in configuration removes pieces +from the sysroot but pyc files remainm as do pieces of pip which causes +problems. + +Ideally we'd convince upstream to allow some way to disable the venv on +the understanding that if/when it breaks, we keep the pieces. The patch +as it stands is a workaround. + +Upstream-Status: Inappropriate [oe specific] +Signed-off-by: Richard Purdie + +Index: qemu-8.1.2/configure +=================================================================== +--- qemu-8.1.2.orig/configure ++++ qemu-8.1.2/configure +@@ -1009,7 +1009,7 @@ python="$(command -v "$python")" + echo "python determined to be '$python'" + echo "python version: $($python --version)" + +-python="$($python -B "${source_path}/python/scripts/mkvenv.py" create pyvenv)" ++python=python3 + if test "$?" -ne 0 ; then + error_exit "python venv creation failed" + fi +@@ -1017,6 +1017,7 @@ fi + # Suppress writing compiled files + python="$python -B" + mkvenv="$python ${source_path}/python/scripts/mkvenv.py" ++mkvenv=true + + mkvenv_flags="" + if test "$download" = "enabled" ; then diff --git a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/qemu-xilinx_git.bb b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/qemu-xilinx_git.bb index cdcbcb4a..d71876e0 100644 --- a/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/qemu-xilinx_git.bb +++ b/meta-zephyr-sdk/recipes-devtools/qemu_xilinx/qemu-xilinx_git.bb @@ -1,231 +1,108 @@ +DEPENDS = "glib-2.0 zlib dtc pixman bison-native meson-native ninja-native libgcrypt" +LICENSE = "GPL-2.0-only & LGPL-2.1-only" + +RDEPENDS:${PN}-common:class-target += "bash" -DEPENDS = "glib-2.0 zlib pixman gnutls dtc" -LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" -SRCREV = "e40b634b24b37fe521bb2857c5e93ee1d30c2e37" -SRC_URI = "gitsm://github.com/Xilinx/qemu.git;protocol=https;nobranch=1 \ - file://0001-Revert-target-arm-Revert-back-to-YIELD-for-WFI.patch \ - file://0002-Enable-WFI-CPU-halting-in-icount-mode.patch \ +SRCREV_qemu = "01482fa113dcbfa785feb7d513df50d15ec4c5df" +SRCREV_FORMAT = "qemu" + +SRC_URI += "gitsm://github.com/Xilinx/qemu.git;protocol=https;nobranch=1;name=qemu \ + file://cross.patch \ + file://0004-configure-Add-pkg-config-handling-for-libgcrypt.patch \ + file://0008-tests-meson.build-use-relative-path-to-refer-to-file.patch \ + file://fixedmeson.patch \ + file://no-pip.patch \ " -BBCLASSEXTEND = "native nativesdk" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INHIBIT_PACKAGE_STRIP = "1" +# Deal with the broken --disable-download +SRCREV_berkeley-softfloat-3 = "b64af41c3276f97f0e181920400ee056b9c88037" +SRCREV_berkeley-testfloat-3 = "40619cbb3bf32872df8c53cc457039229428a263" +SRCREV_keycodemapdb = "f5772a62ec52591ff6870b7e8ef32482371f22c6" +SRC_URI += "\ + gitsm://gitlab.com/qemu-project/berkeley-softfloat-3;protocol=https;nobranch=1;destsuffix=git/subprojects/berkeley-softfloat-3;name=berkeley-softfloat-3 \ + gitsm://gitlab.com/qemu-project/berkeley-testfloat-3;protocol=https;nobranch=1;destsuffix=git/subprojects/berkeley-testfloat-3;name=berkeley-testfloat-3 \ + gitsm://gitlab.com/qemu-project/keycodemapdb.git;protocol=https;nobranch=1;destsuffix=git/subprojects/keycodemapdb;name=keycodemapdb \ +" -S = "${WORKDIR}/git" +# https://gitlab.com/qemu-project/qemu/-/commit/81e2b198a8cb4ee5fdf108bd438f44b193ee3a36 means +# we need a full python3-native setup +inherit autotools pkgconfig systemd python3native + +BBCLASSEXTEND = "nativesdk" -xilinx_qemu_prefix = "${base_prefix}/usr/xilinx" - -inherit autotools pkgconfig - -# Standard options: -# --prefix=PREFIX install in PREFIX [$prefix] -# --interp-prefix=PREFIX where to find shared libraries, etc. -# use %M for cpu name [$interp_prefix] -# --target-list=LIST set target list (default: build everything) -# $(echo Available targets: $default_target_list | \ -# fold -s -w 53 | sed -e 's/^/ /') -# -# Advanced options (experts only): -# --source-path=PATH path of source code [$source_path] -# --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix] -# --cc=CC use C compiler CC [$cc] -# --iasl=IASL use ACPI compiler IASL [$iasl] -# --host-cc=CC use C compiler CC [$host_cc] for code run at -# build time -# --cxx=CXX use C++ compiler CXX [$cxx] -# --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] -# --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS -# --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS -# --make=MAKE use specified make [$make] -# --install=INSTALL use specified install [$install] -# --python=PYTHON use specified python [$python] -# --smbd=SMBD use specified smbd [$smbd] -# --static enable static build [$static] -# --mandir=PATH install man pages in PATH -# --datadir=PATH install firmware in PATH$confsuffix -# --docdir=PATH install documentation in PATH$confsuffix -# --bindir=PATH install binaries in PATH -# --libdir=PATH install libraries in PATH -# --sysconfdir=PATH install config in PATH$confsuffix -# --localstatedir=PATH install local state in PATH (set at runtime on win32) -# --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix] -# --enable-modules enable modules support -# --enable-debug-tcg enable TCG debugging -# --disable-debug-tcg disable TCG debugging (default) -# --enable-debug-info enable debugging information (default) -# --disable-debug-info disable debugging information -# --enable-debug enable common debug build options -# --enable-sparse enable sparse checker -# --disable-sparse disable sparse checker (default) -# --disable-strip disable stripping binaries -# --disable-werror disable compilation abort on warning -# --disable-stack-protector disable compiler-provided stack protection -# --disable-sdl disable SDL -# --enable-sdl enable SDL -# --with-sdlabi select preferred SDL ABI 1.2 or 2.0 -# --disable-gtk disable gtk UI -# --enable-gtk enable gtk UI -# --with-gtkabi select preferred GTK ABI 2.0 or 3.0 -# --disable-virtfs disable VirtFS -# --enable-virtfs enable VirtFS -# --disable-vnc disable VNC -# --enable-vnc enable VNC -# --disable-cocoa disable Cocoa (Mac OS X only) -# --enable-cocoa enable Cocoa (default on Mac OS X) -# --audio-drv-list=LIST set audio drivers list: -# Available drivers: $audio_possible_drivers -# --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L -# --block-drv-rw-whitelist=L -# set block driver read-write whitelist -# (affects only QEMU, not qemu-img) -# --block-drv-ro-whitelist=L -# set block driver read-only whitelist -# (affects only QEMU, not qemu-img) -# --disable-xen disable xen backend driver support -# --enable-xen enable xen backend driver support -# --disable-xen-pci-passthrough -# --enable-xen-pci-passthrough -# --disable-brlapi disable BrlAPI -# --enable-brlapi enable BrlAPI -# --disable-vnc-tls disable TLS encryption for VNC server -# --enable-vnc-tls enable TLS encryption for VNC server -# --disable-vnc-sasl disable SASL encryption for VNC server -# --enable-vnc-sasl enable SASL encryption for VNC server -# --disable-vnc-jpeg disable JPEG lossy compression for VNC server -# --enable-vnc-jpeg enable JPEG lossy compression for VNC server -# --disable-vnc-png disable PNG compression for VNC server (default) -# --enable-vnc-png enable PNG compression for VNC server -# --disable-vnc-ws disable Websockets support for VNC server -# --enable-vnc-ws enable Websockets support for VNC server -# --disable-curses disable curses output -# --enable-curses enable curses output -# --disable-curl disable curl connectivity -# --enable-curl enable curl connectivity -# --disable-fdt disable fdt device tree -# --enable-fdt enable fdt device tree -# --disable-bluez disable bluez stack connectivity -# --enable-bluez enable bluez stack connectivity -# --disable-slirp disable SLIRP userspace network connectivity -# --disable-kvm disable KVM acceleration support -# --enable-kvm enable KVM acceleration support -# --disable-rdma disable RDMA-based migration support -# --enable-rdma enable RDMA-based migration support -# --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI) -# --enable-system enable all system emulation targets -# --disable-system disable all system emulation targets -# --enable-user enable supported user emulation targets -# --disable-user disable all user emulation targets -# --enable-linux-user enable all linux usermode emulation targets -# --disable-linux-user disable all linux usermode emulation targets -# --enable-bsd-user enable all BSD usermode emulation targets -# --disable-bsd-user disable all BSD usermode emulation targets -# --enable-guest-base enable GUEST_BASE support for usermode -# emulation targets -# --disable-guest-base disable GUEST_BASE support -# --enable-pie build Position Independent Executables -# --disable-pie do not build Position Independent Executables -# --fmod-lib path to FMOD library -# --fmod-inc path to FMOD includes -# --oss-lib path to OSS library -# --cpu=CPU Build for host CPU [$cpu] -# --enable-uuid enable uuid support -# --disable-vde disable support for vde network -# --enable-vde enable support for vde network -# --disable-netmap disable support for netmap network -# --enable-netmap enable support for netmap network -# --disable-linux-aio disable Linux AIO support -# --enable-linux-aio enable Linux AIO support -# --disable-cap-ng disable libcap-ng support -# --enable-cap-ng enable libcap-ng support -# --disable-attr disables attr and xattr support -# --enable-attr enable attr and xattr support -# --disable-blobs disable installing provided firmware blobs -# --enable-docs enable documentation build -# --disable-docs disable documentation build -# --disable-vhost-net disable vhost-net acceleration support -# --enable-vhost-net enable vhost-net acceleration support -# --enable-trace-backends=B Set trace backend -# Available backends: $($python $source_path/scripts/tracetool.py --list-backends) -# --with-trace-file=NAME Full PATH,NAME of file to store traces -# Default:trace- -# --disable-spice disable spice -# --enable-spice enable spice -# --enable-rbd enable building the rados block device (rbd) -# --disable-libiscsi disable iscsi support -# --enable-libiscsi enable iscsi support -# --disable-libnfs disable nfs support -# --enable-libnfs enable nfs support -# --disable-smartcard-nss disable smartcard nss support -# --enable-smartcard-nss enable smartcard nss support -# --disable-libusb disable libusb (for usb passthrough) -# --enable-libusb enable libusb (for usb passthrough) -# --disable-usb-redir disable usb network redirection support -# --enable-usb-redir enable usb network redirection support -# --enable-lzo enable the support of lzo compression library -# --enable-snappy enable the support of snappy compression library -# --disable-guest-agent disable building of the QEMU Guest Agent -# --enable-guest-agent enable building of the QEMU Guest Agent -# --with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent -# --with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb) -# --disable-seccomp disable seccomp support -# --enable-seccomp enables seccomp support -# --with-coroutine=BACKEND coroutine backend. Supported options: -# gthread, ucontext, sigaltstack, windows -# --disable-coroutine-pool disable coroutine freelist (worse performance) -# --enable-coroutine-pool enable coroutine freelist (better performance) -# --enable-glusterfs enable GlusterFS backend -# --disable-glusterfs disable GlusterFS backend -# --enable-gcov enable test coverage analysis with gcov -# --gcov=GCOV use specified gcov [$gcov_tool] -# --disable-tpm disable TPM support -# --enable-tpm enable TPM support -# --disable-libssh2 disable ssh block device support -# --enable-libssh2 enable ssh block device support -# --disable-vhdx disables support for the Microsoft VHDX image format -# --enable-vhdx enable support for the Microsoft VHDX image format -# --disable-quorum disable quorum block filter support -# --enable-quorum enable quorum block filter support -# --disable-numa disable libnuma support -# --enable-numa enable libnuma support - -#--disable-fdt: Cannot use if supporting arm-generic-fdt machine type - -QEMUS_BUILT = "aarch64-softmmu microblazeel-softmmu" -QEMU_FLAGS = "--disable-docs --disable-sdl --disable-debug-info --disable-cap-ng \ - --disable-libnfs --disable-libusb --disable-libiscsi --disable-usb-redir --disable-linux-aio \ - --disable-guest-agent --disable-libssh --disable-vnc-png --disable-seccomp \ - --disable-tpm --disable-numa --disable-glusterfs --disable-blobs \ - --disable-virtfs --disable-xen --disable-curl --disable-attr --disable-curses --disable-iconv \ - --disable-kvm --disable-sheepdog --disable-parallels --disable-replication \ +DISABLE_STATIC = "" + +# Per https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html +# upstream states qemu doesn't work without optimization +DEBUG_BUILD = "0" + +xilinx_qemu_prefix = "${prefix}/xilinx" + +EXTRA_OECONF = " \ + --prefix=${xilinx_qemu_prefix} \ + --with-suffix=${BPN} \ + --extra-cflags='${CFLAGS}' \ + --extra-ldflags='${LDFLAGS}' \ + --host-cc='${BUILD_CC}' \ + --disable-strip --disable-libvduse --disable-vhost-user --disable-vnc \ + --enable-gcrypt --enable-plugins --disable-capstone --skip-meson \ + --disable-docs --disable-sdl --disable-debug-info --disable-cap-ng \ + --disable-capstone --skip-meson --disable-download --disable-libnfs \ + --disable-libusb --disable-libiscsi --disable-usb-redir --disable-linux-aio \ + --disable-guest-agent --disable-libssh --disable-seccomp --disable-tpm \ + --disable-numa --disable-glusterfs --disable-virtfs --disable-xen \ + --disable-curl --disable-attr --disable-curses --disable-iconv \ + --disable-kvm --disable-parallels --disable-replication \ --disable-live-block-migration --disable-dmg --disable-werror \ " -# NOTE: Once --prefix is set, QEMU configure script automatically figures out adequate sysconfdir, -# libexecdir and localstatedir based on the prefix directory; therefore, it is not necessary -# to manually specify these directories. Using the global directory variables to specify -# these directories will lead to shared file conflict with the upstream QEMU that resides in -# /usr. +QEMU_TARGETS = "aarch64-softmmu riscv32-softmmu riscv64-softmmu microblazeel-softmmu" + +EXTRA_OECONF:append:class-target = " --cross-prefix=${HOST_PREFIX}" +EXTRA_OECONF:append:class-nativesdk = " --cross-prefix=${HOST_PREFIX}" + +S = "${WORKDIR}/git" +B = "${WORKDIR}/build" + +do_configure:prepend:class-native() { + # Append build host pkg-config paths for native target since the host may provide sdl + BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") + if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then + export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH + fi +} + +# Configure meson for disable-download +do_configure:prepend() { + cp ${S}/subprojects/packagefiles/berkeley-softfloat-3/* ${S}/subprojects/berkeley-softfloat-3/. + cp ${S}/subprojects/packagefiles/berkeley-testfloat-3/* ${S}/subprojects/berkeley-testfloat-3/. +} do_configure() { - unset libdir - unset libexecdir - unset includedir - unset bindir - unset mandir - unset datadir - unset docdir - unset sysconfdir - unset local_statedir - unset firmwarepath - unset localedir - ${S}/configure ${QEMU_FLAGS} --target-list="${QEMUS_BUILT}" --prefix=${xilinx_qemu_prefix} + export PKG_CONFIG=pkg-config + unset libdir + unset libexecdir + unset includedir + unset bindir + unset mandir + unset datadir + unset docdir + unset sysconfdir + unset local_statedir + unset firmwarepath + unset localedir + ${S}/configure ${EXTRA_OECONF} --target-list="${QEMU_TARGETS}" +} +do_configure[cleandirs] += "${B}" + +do_install () { + export STRIP="" + oe_runmake 'DESTDIR=${D}' install } FILES:${PN} = " \ ${xilinx_qemu_prefix} \ " - -INSANE_SKIP_${PN} = "already-stripped"