Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Fast open source processor emulator" |
Brad Bishop | f3f93bb | 2019-10-16 14:33:32 -0400 | [diff] [blame] | 2 | DESCRIPTION = "QEMU is a hosted virtual machine monitor: it emulates the \ |
| 3 | machine's processor through dynamic binary translation and provides a set \ |
| 4 | of different hardware and device models for the machine, enabling it to run \ |
| 5 | a variety of guest operating systems" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | HOMEPAGE = "http://qemu.org" |
| 7 | LICENSE = "GPLv2 & LGPLv2.1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 8 | |
| 9 | RDEPENDS_${PN}-ptest = "bash make" |
| 10 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 11 | require qemu-targets.inc |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 12 | inherit pkgconfig ptest |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 13 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 15 | file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | |
| 17 | SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ |
| 18 | file://powerpc_rom.bin \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 19 | file://run-ptest \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 20 | file://0001-qemu-Add-missing-wacom-HID-descriptor.patch \ |
| 21 | file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \ |
| 22 | file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ |
| 23 | file://0004-qemu-disable-Valgrind.patch \ |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 24 | file://0005-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \ |
| 25 | file://0006-chardev-connect-socket-to-a-spawned-command.patch \ |
| 26 | file://0007-apic-fixup-fallthrough-to-PIC.patch \ |
| 27 | file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ |
| 28 | file://0009-Fix-webkitgtk-builds.patch \ |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 29 | file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | file://0011-hw-i386-pc-fix-regression-in-parsing-vga-cmdline-par.patch \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 31 | file://CVE-2019-15890.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | file://CVE-2020-1711.patch \ |
| 33 | file://CVE-2020-7039-1.patch \ |
| 34 | file://CVE-2020-7039-2.patch \ |
| 35 | file://CVE-2020-7039-3.patch \ |
| 36 | file://0001-Add-enable-disable-udev.patch \ |
| 37 | file://CVE-2020-7211.patch \ |
| 38 | file://0001-qemu-Do-not-include-file-if-not-exists.patch \ |
| 39 | file://CVE-2020-11102.patch \ |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame^] | 40 | file://CVE-2020-11869.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 41 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 42 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
| 43 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 44 | SRC_URI[md5sum] = "278eeb294e4b497e79af7a57e660cb9a" |
| 45 | SRC_URI[sha256sum] = "d3481d4108ce211a053ef15be69af1bdd9dde1510fda80d92be0f6c3e98768f0" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 46 | |
| 47 | COMPATIBLE_HOST_mipsarchn32 = "null" |
| 48 | COMPATIBLE_HOST_mipsarchn64 = "null" |
| 49 | |
| 50 | do_install_append() { |
| 51 | # Prevent QA warnings about installed ${localstatedir}/run |
| 52 | if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi |
| 53 | } |
| 54 | |
| 55 | do_compile_ptest() { |
| 56 | make buildtest-TESTS |
| 57 | } |
| 58 | |
| 59 | do_install_ptest() { |
| 60 | cp -rL ${B}/tests ${D}${PTEST_PATH} |
| 61 | find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {} |
| 62 | |
| 63 | cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests |
| 64 | # Don't check the file genreated by configure |
| 65 | sed -i -e '/wildcard config-host.mak/d' \ |
| 66 | -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 67 | sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \ |
| 68 | ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 69 | } |
| 70 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | # QEMU_TARGETS is overridable variable |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 72 | QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc ppc64 ppc64le riscv32 riscv64 sh4 x86_64" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 74 | EXTRA_OECONF = " \ |
| 75 | --prefix=${prefix} \ |
| 76 | --bindir=${bindir} \ |
| 77 | --includedir=${includedir} \ |
| 78 | --libdir=${libdir} \ |
| 79 | --mandir=${mandir} \ |
| 80 | --datadir=${datadir} \ |
| 81 | --docdir=${docdir}/${BPN} \ |
| 82 | --sysconfdir=${sysconfdir} \ |
| 83 | --libexecdir=${libexecdir} \ |
| 84 | --localstatedir=${localstatedir} \ |
| 85 | --with-confsuffix=/${BPN} \ |
| 86 | --disable-strip \ |
| 87 | --disable-werror \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 88 | --extra-cflags='${CFLAGS}' \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 89 | --with-git=/bin/false \ |
| 90 | --disable-git-update \ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 91 | ${PACKAGECONFIG_CONFARGS} \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | " |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 93 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 94 | export LIBTOOL="${HOST_SYS}-libtool" |
| 95 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 96 | B = "${WORKDIR}/build" |
| 97 | |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 98 | EXTRA_OECONF_append = " --python=${HOSTTOOLS_DIR}/python3" |
| 99 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 100 | do_configure_prepend_class-native() { |
| 101 | # Append build host pkg-config paths for native target since the host may provide sdl |
| 102 | BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") |
| 103 | if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then |
| 104 | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | fi |
| 106 | } |
| 107 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 108 | do_configure() { |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 109 | ${S}/configure ${EXTRA_OECONF} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 110 | } |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 111 | do_configure[cleandirs] += "${B}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 113 | do_install () { |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 114 | export STRIP="" |
| 115 | oe_runmake 'DESTDIR=${D}' install |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 116 | } |
| 117 | |
| 118 | # The following fragment will create a wrapper for qemu-mips user emulation |
| 119 | # binary in order to work around a segmentation fault issue. Basically, by |
| 120 | # default, the reserved virtual address space for 32-on-64 bit is set to 4GB. |
| 121 | # This will trigger a MMU access fault in the virtual CPU. With this change, |
| 122 | # the qemu-mips works fine. |
| 123 | # IMPORTANT: This piece needs to be removed once the root cause is fixed! |
| 124 | do_install_append() { |
| 125 | if [ -e "${D}/${bindir}/qemu-mips" ]; then |
| 126 | create_wrapper ${D}/${bindir}/qemu-mips \ |
| 127 | QEMU_RESERVED_VA=0x0 |
| 128 | fi |
| 129 | } |
| 130 | # END of qemu-mips workaround |
| 131 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 132 | make_qemu_wrapper() { |
| 133 | gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0` |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 134 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 135 | for tool in `ls ${D}${bindir}/qemu-system-*`; do |
| 136 | create_wrapper $tool \ |
| 137 | GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \ |
| 138 | FONTCONFIG_PATH=/etc/fonts \ |
| 139 | GTK_THEME=Adwaita |
| 140 | done |
| 141 | } |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 142 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 143 | # Disable kvm/virgl/mesa on targets that do not support it |
| 144 | PACKAGECONFIG_remove_darwin = "kvm virglrenderer glx gtk+" |
| 145 | PACKAGECONFIG_remove_mingw32 = "kvm virglrenderer glx gtk+" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 146 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 147 | PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 148 | PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr," |
| 149 | PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio," |
| 150 | PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 151 | PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 152 | PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl," |
| 153 | PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg," |
| 154 | PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng," |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 155 | PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 156 | PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss," |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 157 | PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 158 | PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native" |
| 159 | PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 160 | PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 161 | PACKAGECONFIG[ssh] = "--enable-libssh,--disable-libssh,libssh," |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 162 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 163 | PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 164 | PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" |
| 165 | PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 166 | PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 167 | PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" |
| 168 | PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo" |
| 169 | PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl" |
| 170 | PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 171 | PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 172 | PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,bluez5" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 173 | PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi" |
| 174 | PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 175 | PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer" |
| 176 | # spice will be in meta-networking layer |
| 177 | PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice" |
| 178 | # usbredir will be in meta-networking layer |
| 179 | PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 180 | PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 181 | PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs" |
| 182 | PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon" |
| 183 | PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,eudev" |
| 184 | PACKAGECONFIG[libxml2] = "--enable-libxml2,--disable-libxml2,libxml2" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 185 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 186 | INSANE_SKIP_${PN} = "arch" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 187 | |
| 188 | FILES_${PN} += "${datadir}/icons" |