blob: de21d30732fd3d321476b5b645d32f7cd3760eb6 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Fast open source processor emulator"
2HOMEPAGE = "http://qemu.org"
3LICENSE = "GPLv2 & LGPLv2.1"
Brad Bishop19323692019-04-05 15:28:33 -04004
5RDEPENDS_${PN}-ptest = "bash make"
6
Brad Bishop15ae2502019-06-18 21:44:24 -04007require qemu-targets.inc
Brad Bishop96ff1982019-08-19 13:50:42 -04008inherit pkgconfig ptest
Brad Bishop15ae2502019-06-18 21:44:24 -04009
Brad Bishop19323692019-04-05 15:28:33 -040010LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
Brad Bishopc342db32019-05-15 21:57:59 -040011 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
Brad Bishop19323692019-04-05 15:28:33 -040012
13SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
14 file://powerpc_rom.bin \
Brad Bishop19323692019-04-05 15:28:33 -040015 file://run-ptest \
Brad Bishopc342db32019-05-15 21:57:59 -040016 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 \
Brad Bishopc68388fc2019-08-26 01:33:31 -040020 file://0005-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \
21 file://0006-chardev-connect-socket-to-a-spawned-command.patch \
22 file://0007-apic-fixup-fallthrough-to-PIC.patch \
23 file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
24 file://0009-Fix-webkitgtk-builds.patch \
Brad Bishop79641f22019-09-10 07:20:22 -040025 file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \
Brad Bishopa34c0302019-09-23 22:34:48 -040026 file://CVE-2019-15890.patch \
Brad Bishop19323692019-04-05 15:28:33 -040027 "
28UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
29
Brad Bishopc68388fc2019-08-26 01:33:31 -040030SRC_URI[md5sum] = "cdf2b5ca52b9abac9bacb5842fa420f8"
31SRC_URI[sha256sum] = "656e60218689bdeec69903087fd7582d5d3e72238d02f4481d8dc6d79fd909c6"
Brad Bishop19323692019-04-05 15:28:33 -040032
33COMPATIBLE_HOST_mipsarchn32 = "null"
34COMPATIBLE_HOST_mipsarchn64 = "null"
35
36do_install_append() {
37 # Prevent QA warnings about installed ${localstatedir}/run
38 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
39}
40
41do_compile_ptest() {
42 make buildtest-TESTS
43}
44
45do_install_ptest() {
46 cp -rL ${B}/tests ${D}${PTEST_PATH}
47 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
48
49 cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
50 # Don't check the file genreated by configure
51 sed -i -e '/wildcard config-host.mak/d' \
52 -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
53}
54
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055# QEMU_TARGETS is overridable variable
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080056QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc riscv32 riscv64 sh4 x86_64"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050057
Brad Bishop6e60e8b2018-02-01 10:27:11 -050058EXTRA_OECONF = " \
59 --prefix=${prefix} \
60 --bindir=${bindir} \
61 --includedir=${includedir} \
62 --libdir=${libdir} \
63 --mandir=${mandir} \
64 --datadir=${datadir} \
65 --docdir=${docdir}/${BPN} \
66 --sysconfdir=${sysconfdir} \
67 --libexecdir=${libexecdir} \
68 --localstatedir=${localstatedir} \
69 --with-confsuffix=/${BPN} \
70 --disable-strip \
71 --disable-werror \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050072 --extra-cflags='${CFLAGS}' \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080073 ${PACKAGECONFIG_CONFARGS} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074 "
Patrick Williamsc0f7c042017-02-23 20:41:17 -060075
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076export LIBTOOL="${HOST_SYS}-libtool"
77
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080078B = "${WORKDIR}/build"
79
Brad Bishop96ff1982019-08-19 13:50:42 -040080EXTRA_OECONF_append = " --python=${HOSTTOOLS_DIR}/python3"
81
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082do_configure_prepend_class-native() {
83 # Append build host pkg-config paths for native target since the host may provide sdl
84 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
85 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
86 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 fi
88}
89
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090do_configure() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050091 ${S}/configure ${EXTRA_OECONF}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092}
93
Patrick Williamsc124f4f2015-09-15 14:41:29 -050094do_install () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080095 export STRIP=""
96 oe_runmake 'DESTDIR=${D}' install
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097}
98
99# The following fragment will create a wrapper for qemu-mips user emulation
100# binary in order to work around a segmentation fault issue. Basically, by
101# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
102# This will trigger a MMU access fault in the virtual CPU. With this change,
103# the qemu-mips works fine.
104# IMPORTANT: This piece needs to be removed once the root cause is fixed!
105do_install_append() {
106 if [ -e "${D}/${bindir}/qemu-mips" ]; then
107 create_wrapper ${D}/${bindir}/qemu-mips \
108 QEMU_RESERVED_VA=0x0
109 fi
110}
111# END of qemu-mips workaround
112
Brad Bishop19323692019-04-05 15:28:33 -0400113make_qemu_wrapper() {
114 gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0`
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500115
Brad Bishop19323692019-04-05 15:28:33 -0400116 for tool in `ls ${D}${bindir}/qemu-system-*`; do
117 create_wrapper $tool \
118 GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \
119 FONTCONFIG_PATH=/etc/fonts \
120 GTK_THEME=Adwaita
121 done
122}
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500123
Brad Bishop19323692019-04-05 15:28:33 -0400124# Disable kvm/virgl/mesa on targets that do not support it
125PACKAGECONFIG_remove_darwin = "kvm virglrenderer glx gtk+"
126PACKAGECONFIG_remove_mingw32 = "kvm virglrenderer glx gtk+"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600127
Brad Bishopc342db32019-05-15 21:57:59 -0400128PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
130PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
131PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
132PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500133PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
134PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
135PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
Brad Bishop79641f22019-09-10 07:20:22 -0400136PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500137PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500138PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
Brad Bishopc342db32019-05-15 21:57:59 -0400139PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native"
140PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500141PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
Brad Bishopc68388fc2019-08-26 01:33:31 -0400142PACKAGECONFIG[ssh] = "--enable-libssh,--disable-libssh,libssh,"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500143PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500144PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500145PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
146PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500147PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500148PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
149PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
150PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
151PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600152PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
Brad Bishop96ff1982019-08-19 13:50:42 -0400153PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,bluez5"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500154PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
155PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800156PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer"
157# spice will be in meta-networking layer
158PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice"
159# usbredir will be in meta-networking layer
160PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir"
Brad Bishopc342db32019-05-15 21:57:59 -0400161PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500162
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500163INSANE_SKIP_${PN} = "arch"
Brad Bishopc342db32019-05-15 21:57:59 -0400164
165FILES_${PN} += "${datadir}/icons"