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