qemu.inc 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. SUMMARY = "Fast open source processor emulator"
  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"
  6. HOMEPAGE = "http://qemu.org"
  7. LICENSE = "GPLv2 & LGPLv2.1"
  8. RDEPENDS_${PN}-ptest = "bash make"
  9. require qemu-targets.inc
  10. inherit pkgconfig ptest
  11. LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
  12. file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
  13. SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
  14. file://powerpc_rom.bin \
  15. file://run-ptest \
  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-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 \
  25. file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \
  26. file://0011-hw-i386-pc-fix-regression-in-parsing-vga-cmdline-par.patch \
  27. file://CVE-2019-15890.patch \
  28. file://CVE-2020-1711.patch \
  29. file://CVE-2020-7039-1.patch \
  30. file://CVE-2020-7039-2.patch \
  31. file://CVE-2020-7039-3.patch \
  32. file://0001-Add-enable-disable-udev.patch \
  33. file://CVE-2020-7211.patch \
  34. file://0001-qemu-Do-not-include-file-if-not-exists.patch \
  35. file://CVE-2020-11102.patch \
  36. file://CVE-2020-11869.patch \
  37. file://CVE-2020-13361.patch \
  38. file://CVE-2020-10761.patch \
  39. file://CVE-2020-10702.patch \
  40. file://CVE-2020-13659.patch \
  41. file://CVE-2020-13800.patch \
  42. file://CVE-2020-13362.patch \
  43. file://CVE-2020-15863.patch \
  44. file://CVE-2020-14364.patch \
  45. file://CVE-2020-14415.patch \
  46. file://CVE-2020-16092.patch \
  47. file://0001-target-mips-Increase-number-of-TLB-entries-on-the-34.patch \
  48. "
  49. UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
  50. SRC_URI[md5sum] = "278eeb294e4b497e79af7a57e660cb9a"
  51. SRC_URI[sha256sum] = "d3481d4108ce211a053ef15be69af1bdd9dde1510fda80d92be0f6c3e98768f0"
  52. COMPATIBLE_HOST_mipsarchn32 = "null"
  53. COMPATIBLE_HOST_mipsarchn64 = "null"
  54. do_install_append() {
  55. # Prevent QA warnings about installed ${localstatedir}/run
  56. if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
  57. }
  58. do_compile_ptest() {
  59. make buildtest-TESTS
  60. }
  61. do_install_ptest() {
  62. cp -rL ${B}/tests ${D}${PTEST_PATH}
  63. find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
  64. cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests
  65. # Don't check the file genreated by configure
  66. sed -i -e '/wildcard config-host.mak/d' \
  67. -e '$ {/endif/d}' ${D}${PTEST_PATH}/tests/Makefile.include
  68. sed -i -e 's,${HOSTTOOLS_DIR}/python3,${bindir}/python3,' \
  69. ${D}/${PTEST_PATH}/tests/qemu-iotests/common.env
  70. }
  71. # QEMU_TARGETS is overridable variable
  72. QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc ppc64 ppc64le riscv32 riscv64 sh4 x86_64"
  73. EXTRA_OECONF = " \
  74. --prefix=${prefix} \
  75. --bindir=${bindir} \
  76. --includedir=${includedir} \
  77. --libdir=${libdir} \
  78. --mandir=${mandir} \
  79. --datadir=${datadir} \
  80. --docdir=${docdir}/${BPN} \
  81. --sysconfdir=${sysconfdir} \
  82. --libexecdir=${libexecdir} \
  83. --localstatedir=${localstatedir} \
  84. --with-confsuffix=/${BPN} \
  85. --disable-strip \
  86. --disable-werror \
  87. --extra-cflags='${CFLAGS}' \
  88. --with-git=/bin/false \
  89. --disable-git-update \
  90. ${PACKAGECONFIG_CONFARGS} \
  91. "
  92. export LIBTOOL="${HOST_SYS}-libtool"
  93. B = "${WORKDIR}/build"
  94. EXTRA_OECONF_append = " --python=${HOSTTOOLS_DIR}/python3"
  95. do_configure_prepend_class-native() {
  96. # Append build host pkg-config paths for native target since the host may provide sdl
  97. BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
  98. if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
  99. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
  100. fi
  101. }
  102. do_configure() {
  103. ${S}/configure ${EXTRA_OECONF}
  104. }
  105. do_configure[cleandirs] += "${B}"
  106. do_install () {
  107. export STRIP=""
  108. oe_runmake 'DESTDIR=${D}' install
  109. }
  110. # The following fragment will create a wrapper for qemu-mips user emulation
  111. # binary in order to work around a segmentation fault issue. Basically, by
  112. # default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
  113. # This will trigger a MMU access fault in the virtual CPU. With this change,
  114. # the qemu-mips works fine.
  115. # IMPORTANT: This piece needs to be removed once the root cause is fixed!
  116. do_install_append() {
  117. if [ -e "${D}/${bindir}/qemu-mips" ]; then
  118. create_wrapper ${D}/${bindir}/qemu-mips \
  119. QEMU_RESERVED_VA=0x0
  120. fi
  121. }
  122. # END of qemu-mips workaround
  123. make_qemu_wrapper() {
  124. gdk_pixbuf_module_file=`pkg-config --variable=gdk_pixbuf_cache_file gdk-pixbuf-2.0`
  125. for tool in `ls ${D}${bindir}/qemu-system-*`; do
  126. create_wrapper $tool \
  127. GDK_PIXBUF_MODULE_FILE=$gdk_pixbuf_module_file \
  128. FONTCONFIG_PATH=/etc/fonts \
  129. GTK_THEME=Adwaita
  130. done
  131. }
  132. # Disable kvm/virgl/mesa on targets that do not support it
  133. PACKAGECONFIG_remove_darwin = "kvm virglrenderer glx gtk+"
  134. PACKAGECONFIG_remove_mingw32 = "kvm virglrenderer glx gtk+"
  135. PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2"
  136. PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
  137. PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
  138. PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
  139. PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest"
  140. PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
  141. PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
  142. PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
  143. PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl,"
  144. PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
  145. PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
  146. PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native"
  147. PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native"
  148. PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
  149. PACKAGECONFIG[ssh] = "--enable-libssh,--disable-libssh,libssh,"
  150. PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
  151. PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
  152. PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
  153. PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
  154. PACKAGECONFIG[alsa] = "--audio-drv-list='oss alsa',,alsa-lib"
  155. PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
  156. PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
  157. PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
  158. PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
  159. PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
  160. PACKAGECONFIG[bluez] = "--enable-bluez,--disable-bluez,bluez5"
  161. PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
  162. PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
  163. PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer"
  164. # spice will be in meta-networking layer
  165. PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice"
  166. # usbredir will be in meta-networking layer
  167. PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir"
  168. PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy"
  169. PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs"
  170. PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
  171. PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,eudev"
  172. PACKAGECONFIG[libxml2] = "--enable-libxml2,--disable-libxml2,libxml2"
  173. INSANE_SKIP_${PN} = "arch"
  174. FILES_${PN} += "${datadir}/icons"