1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Fast CPU emulator and virtualizer for x86 platform
8 HOMEPAGE= https://www.qemu.org/
12 SITES[main]= https://download.qemu.org/
13 DISTFILE[1]= qemu-6.2.0.tar.xz:main
15 SPKGS[standard]= complete
20 OPTIONS_AVAILABLE= none
21 OPTIONS_STANDARD= none
23 BUILD_DEPENDS= texi2html:primary:standard
24 BUILDRUN_DEPENDS= nettle:primary:standard
25 fontconfig:primary:standard
26 freetype:primary:standard
27 gnutls:primary:standard
28 cyrus-sasl:primary:standard
31 libepoxy:single:standard
32 snappy:single:standard
34 USES= cpe gmake pkgconfig bison perl:build python:build
35 jpeg png mesa gettext-runtime gettext-tools ncurses
36 makeinfo ninja zstd lzo
37 GNOME_COMPONENTS= gdkpixbuf gtk2 vte
38 SDL_COMPONENTS= sdl2 image2
39 XORG_COMPONENTS= x11 xext
41 LICENSE= GPLv2:primary
42 LICENSE_TERMS= primary:{{WRKSRC}}/LICENSE
43 LICENSE_FILE= GPLv2:{{WRKSRC}}/COPYING
46 FPC_EQUIVALENT= emulators/qemu
49 CONFIGURE_ARGS= --disable-usb-redir
50 --disable-stack-protector
59 --python={{PYTHON_CMD}}
62 BUILD_WRKSRC= {{WRKSRC}}/build
63 MAKE_ENV= BSD_MAKE="{{MAKE}}"
66 INSTALL_WRKSRC= {{WRKSRC}}/build
67 PLIST_SUB= JQUERY=3.5.1
71 CFLAGS= -I{{NCURSESBASE}}/include/ncursesw
72 VAR_OPSYS[freebsd]= CONFIGURE_ARGS=--enable-netmap
73 CONFIGURE_ARGS=--disable-linux-user
74 CONFIGURE_ARGS=--disable-linux-aio
75 VAR_OPSYS[linux]= CONFIGURE_ARGS=--disable-netmap
76 VAR_OPSYS[dragonfly]= CONFIGURE_ARGS=--disable-netmap
77 CONFIGURE_ARGS=--disable-linux-user
78 CONFIGURE_ARGS=--disable-linux-aio
81 # silence some include warnings
82 ${MKDIR} ${WRKSRC}/bsd-user/dragonfly
85 # for some reason file is considered out-of-date
86 ${TOUCH} ${WRKSRC}/config-host.mak
89 ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample \
90 ${STAGEDIR}${PREFIX}/etc
91 ${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample \
92 ${STAGEDIR}${PREFIX}/etc
93 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/qemu-*
94 (cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${STD_DOCDIR}/)
95 # remove sphinx leftovers
96 ${RM} -r ${STAGEDIR}${STD_DOCDIR}/docs/sphinx
97 # remove empty directories
98 ${RM} -r ${STAGEDIR}/var
100 pre-configure-dragonfly:
101 # On dragonfly, userland programs can't include <sys/disk.h>
102 ${REINPLACE_CMD} -e 's|sys/disk\.h|sys/skipdisk.h|' \
103 ${WRKSRC}/meson.build
105 [FILE:782:descriptions/desc.primary]
106 QEMU is a fast processor emulator using dynamic translation to achieve
107 good emulation speed. QEMU has two operating modes:
109 * Full system emulation. In this mode, QEMU emulates a full system (for
110 example a PC), including a processor and various peripherials. It can
111 be used to launch different Operating Systems without rebooting the PC
112 or to debug system code.
113 * User mode emulation (Linux host only). In this mode, QEMU can launch
114 Linux processes compiled for one CPU on another CPU. It can be used to
115 launch the Wine Windows API emulator or to ease cross-compilation and
118 As QEMU requires no host kernel patches to run, it is safe and easy to use.
120 See also the preconfigured system images on http://oszoo.org/
121 Many live cd isos also work.
125 68e15d8e45ac56326e0b9a4afa8b49a3dfe8aba3488221d098c84698bca65b45 115667324 qemu-6.2.0.tar.xz
128 [FILE:3543:manifests/plist.primary]
129 @sample etc/qemu-ifdown.sample
130 @sample etc/qemu-ifup.sample
131 %%MAN%%share/man/man1/
133 qemu-storage-daemon.1.gz
135 %%MAN%%share/man/man7/
136 qemu-block-drivers.7.gz
140 qemu-storage-daemon-qmp-ref.7.gz
141 %%MAN%%share/man/man8/
177 %%ONLY-LINUX%%libexec/qemu-bridge-helper
194 qemu-system-microblaze
195 qemu-system-microblazeel
216 include/qemu-plugin.h
217 share/applications/qemu.desktop
218 share/icons/hicolor/128x128/apps/qemu.png
219 share/icons/hicolor/16x16/apps/qemu.png
220 share/icons/hicolor/24x24/apps/qemu.png
221 share/icons/hicolor/256x256/apps/qemu.png
222 share/icons/hicolor/32x32/apps/
225 share/icons/hicolor/48x48/apps/qemu.png
226 share/icons/hicolor/512x512/apps/qemu.png
227 share/icons/hicolor/64x64/apps/qemu.png
228 share/icons/hicolor/scalable/apps/qemu.svg
241 edk2-i386-secure-code.fd
245 edk2-x86_64-secure-code.fd
264 opensbi-riscv32-generic-fw_dynamic.bin
265 opensbi-riscv32-generic-fw_dynamic.elf
266 opensbi-riscv64-generic-fw_dynamic.bin
267 opensbi-riscv64-generic-fw_dynamic.elf
270 petalogix-s3adsp1800.dtb
287 u-boot-sam460-20100605.bin
290 vgabios-bochs-display.bin
299 50-edk2-i386-secure.json
300 50-edk2-x86_64-secure.json
342 [FILE:5064:manifests/plist.docs]
345 amd-memory-encryption.txt
346 block-replication.txt
352 confidential-guest-support.txt
360 multi-thread-compression.txt
364 pci_expander_bridge.txt
370 qemu-option-trace.rst.inc
378 virtio-balloon-stats.txt
380 xen-save-devices-state.txt
381 share/doc/qemu/docs/_templates/footer.html
382 share/doc/qemu/docs/about/
388 share/doc/qemu/docs/config/
390 mach-virt-graphical.cfg
393 q35-virtio-graphical.cfg
394 q35-virtio-serial.cfg
395 share/doc/qemu/docs/devel/
400 block-coroutine-wrapper.rst
402 ci-definitions.rst.inc
408 conflict-resolution.rst
409 control-flow-integrity.rst
422 multiple-iothreads.txt
431 secure-coding-practices.rst
434 submitting-a-patch.rst
435 submitting-a-pull-request.rst
445 writing-monitor-commands.rst
446 share/doc/qemu/docs/interop/
453 live-block-operations.rst
463 qemu-storage-daemon-qmp-ref.rst
470 vnc-ledstate-Pseudo-encoding.txt
471 share/doc/qemu/docs/specs/
474 acpi_hw_reduced_hotplug.rst
486 ppc-spapr-hotplug.txt
488 ppc-spapr-uv-hcalls.txt
499 share/doc/qemu/docs/sphinx-static/
502 share/doc/qemu/docs/spin/
504 aio_notify_accept.promela
505 aio_notify_bug.promela
506 tcg-exclusive.promela
507 win32-qemu-event.promela
508 share/doc/qemu/docs/system/
513 cpu-models-mips.rst.inc
514 cpu-models-x86-abi.csv
515 cpu-models-x86.rst.inc
517 device-url-syntax.rst.inc
533 qemu-block-drivers.rst
534 qemu-block-drivers.rst.inc
542 target-i386-desc.rst.inc
555 virtio-net-failover.rst
557 share/doc/qemu/docs/system/arm/
591 share/doc/qemu/docs/system/devices/
599 share/doc/qemu/docs/system/i386/
605 share/doc/qemu/docs/system/ppc/
612 share/doc/qemu/docs/system/riscv/
613 microchip-icicle-kit.rst
617 share/doc/qemu/docs/system/s390x/
624 share/doc/qemu/docs/tools/
629 qemu-storage-daemon.rst
631 virtfs-proxy-helper.rst
633 share/doc/qemu/docs/user/
638 [FILE:297:manifests/plist.nls]
639 share/locale/bg/LC_MESSAGES/qemu.mo
640 share/locale/de_DE/LC_MESSAGES/qemu.mo
641 share/locale/fr_FR/LC_MESSAGES/qemu.mo
642 share/locale/hu/LC_MESSAGES/qemu.mo
643 share/locale/it/LC_MESSAGES/qemu.mo
644 share/locale/sv/LC_MESSAGES/qemu.mo
645 share/locale/tr/LC_MESSAGES/qemu.mo
646 share/locale/zh_CN/LC_MESSAGES/qemu.mo
649 [FILE:365:patches/patch-disas_libvixl_vixl_a64_disasm-a64.cc]
650 --- disas/libvixl/vixl/a64/disasm-a64.cc.orig 2021-12-14 20:42:01 UTC
651 +++ disas/libvixl/vixl/a64/disasm-a64.cc
652 @@ -2693,7 +2693,7 @@ void Disassembler::AppendPCRelativeOffse
654 abs_offset = -abs_offset;
656 - AppendToOutput("#%c0x%" PRIx64, sign, abs_offset);
657 + AppendToOutput("#%c0x%" PRIx64, sign, offset < 0 ? -offset : offset);
663 [FILE:1232:patches/patch-meson.build]
664 --- meson.build.orig 2021-12-14 20:42:02 UTC
666 @@ -722,15 +722,16 @@ if have_system and not get_option('curse
667 has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
670 - curses_libname_list = (targetos == 'windows' ? ['pdcurses'] : ['ncursesw', 'cursesw'])
671 + libtinfo = cc.find_library('tinfow', required: false, static: enable_static)
672 + curses_libname_list = (targetos == 'windows' ? ['pdcurses'] : ['ncursesw'])
673 foreach curses_libname : curses_libname_list
674 libcurses = cc.find_library(curses_libname,
676 kwargs: static_kwargs)
678 - if cc.links(curses_test, args: curses_compile_args, dependencies: libcurses)
679 + if cc.links(curses_test, args: curses_compile_args, dependencies: [libcurses,libtinfo])
680 curses = declare_dependency(compile_args: curses_compile_args,
681 - dependencies: [libcurses])
682 + dependencies: [libcurses, libtinfo])
685 msg = 'curses library not usable'
688 [FILE:454:patches/patch-net_tap-bsd.c]
689 --- net/tap-bsd.c.orig 2021-12-14 20:42:02 UTC
693 #if defined(__NetBSD__) || defined(__FreeBSD__)
694 #include <sys/ioctl.h>
695 +#include <sys/socket.h>
697 #include <net/if_tap.h>
699 +#if defined(__DragonFly)
700 +#include <sys/ioctl.h>
701 +#include <sys/socket.h>
703 +#include <net/tap/if_tap.h>
707 int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
710 [FILE:314:patches/patch-util_getauxval.c]
711 --- util/getauxval.c.orig 2021-12-14 20:42:01 UTC
713 @@ -98,7 +98,7 @@ unsigned long qemu_getauxval(unsigned lo
717 -#elif defined(__FreeBSD__)
718 +#elif defined(__FreeBSD__) && __FreeBSD_version__ > 1200001
719 #include <sys/auxv.h>
721 unsigned long qemu_getauxval(unsigned long type)
724 [FILE:7685:files/pkg-message-single]
728 - Needs to set net.link.tap.user_open sysctl in order to use /dev/tap*
729 networking as non-root. Don't forget to adjust device node permissions in
732 - slirp (usermode networking) is fixed now in cvs, on FreeSBIE 1.0 guests you
733 still have to manually do: echo nameserver 10.0.2.3 >/etc/resolv.conf but
734 i've been told that that's normal. (fixed on FreeSBIE 1.1.) And you have
735 to wait a bit for dhclient to do its thing; traffic to address 10.0.2.2 is
736 routed to 127.1 on the host.
738 - Expect timer problems when guest kernel HZ is > hosts, for example time
739 sleep 1 takes 49 seconds and booting sleeps for minutes at the acd0 probe
740 with a FreeSBIE 1.0 guest, thats because its kernel is built with HZ=5000,
741 and FreeBSD's default is 100... (no longer a problem with FreeSBIE 1.1.)
742 The linux 2.6 kernel uses 1000 by default btw. (changed to 250 later, and
743 recent linux kernels now no longer have a fixed HZ, aka `tickless
744 kernel'...) Enabling /dev/rtc doesn't seem to help either (not included
745 since it needs a patch to emulators/rtc.)
747 - Update: the above problem has gotten worse with FreeBSD guests
748 somewhere before 8.0, mainly since the kernel now usually wants
749 double or even quadruple number of timer irqs compared to HZ if
750 it detects an apic (and at least early versions of FreeBSD 8 had
751 a bug that essentially halved qemu's clock rate too); the only
752 reason you usually don't see symptoms of this with FreeBSD 8
753 guests is they automatically reduce their HZ to 100 when running
754 in a VM while the default for the host kernel is still HZ=1000.
755 Workaround: you can disable the apic clock in the guest by setting
757 hint.apic.0.clock="0"
759 in loader.conf(5) (or manually at the loader prompt), if that
760 doesn't work the only things you can do is either reduce the
761 guest's HZ to, say, 100 by setting e.g.
765 from the loader as above (which usually is a good idea in a VM
766 anyway and FreeBSD 8 now does by itself as mentioned), or otherwise
767 increase the host's HZ to 2000 or even 4000 from the loader in
770 - The -smb option (smb-export local dir to guest using the default
771 slirp networking) needs the samba port/package installed
772 in addition to qemu. (SAMBA knob.)
774 - If you want to use usb devices connected to the host in the guest
775 yot need either recent 10-current (not tested yet much) or you can
776 use usbredir over the network (see below); also unless you are
777 running qemu as root you then need to fix permissions for /dev/ugen*
778 device nodes: if you are on 5.x or later (devfs) put a rule in
779 /etc/devfs.rules, activate it in /etc/rc.conf and run /etc/rc.d/devfs
780 restart. Example devfs.rules:
783 add path 'ugen*' mode 660 group operator
785 corresponding rc.conf line:
787 devfs_system_ruleset="ugen_ruleset"
789 - If you want to test the new (in 0.15.0) usb network redirection (USBREDIR
790 option) see this thread by Hans de Goede <hdegoede <at> redhat.com>:
792 http://thread.gmane.org/gmane.comp.emulators.qemu/110176/focus=110183
798 1) Start usbredirserver for a usb device:
799 sudo usbredirserver 045e:0772
800 2) Start qemu with usb2 support + a chardev talking to usbredirserver +
801 a usb-redir device using this chardev:
803 -readconfig docs/ich9-ehci-uhci.cfg \
804 -chardev socket,id=usbredirchardev,host=localhost,port=4000 \
805 -device usb-redir,chardev=usbredirchardev,id=usbredirdev ...
807 [you would replace docs/ich9-ehci-uhci.cfg with e.g.
808 /raven/share/doc/qemu/docs/ich9-ehci-uhci.cfg, but turns out
809 ehci was broken for me here with FreeBSD guests and the previous
810 qemu version at least, I got:
812 FETCHENTRY: entry at 22C5484 is of type 2 which is not supported yet processing error - resetting ehci HC
813 Assertion failed: (0), function ehci_advance_state, file /data/ports/emulators/qemu-devel/work/qemu-0.15.0/hw/usb-ehci.c, line 2045.
815 The new qemu version works better tho.]
817 - Still usb: since the hub is no longer attached to the uchi controller and
818 the wakeup mechanism, resume interrupt is not implemented yet linux guests
819 will suspend the bus, i.e. they wont see devices usb_add'ed after its
820 (linux') uhci module got loaded. Workaround: either add devices before
821 linux loads the module or rmmod and modprobe it afterwards. [Not sure
822 if this still applies to the new libusb host code used on recent
825 - If you build qemu wihout SDL and then get crashes running it try passing it
826 -nographic. This should probably be default in that case...
828 - qemu's network boot roms (-boot n) have a bug when bootfiles sizes are a
829 multiple of blksize, if this affects you (like with FreeBSD's /boot/pxeboot)
832 cp /boot/pxeboot pxeboot-qemu && chmod +w pxeboot-qemu && echo >>pxeboot-qemu
834 and then use pxeboot-qemu. Actually you need recent btx code
835 (from after 7.0 was released) because of the real mode boot
836 problem, so use at least pxeboot from there. And I just did that
837 for the pxeboot extracted out of
839 ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200805/7.0-STABLE-200805-i386-bootonly.iso
843 http://people.freebsd.org/~nox/qemu/pxeboot-qemu
845 - If you use slirp (usernet, the default) and want to mount nfs into the guest
846 and you are not running qemu as root, then mountd(8) on the exporting box
847 needs to be run with -n in order to accept requests from ports >= 1024.
849 - (not FreeBSD-specific:) There have been reports of qcow2 corruption with (at
850 least) win2k guests on recent kvm (which uses similar qcow2 code than qemu
851 now, see this thread:
853 http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00713.html -
855 the consensus on that thread seems to be that qcow(2) code has always been
856 experimental and you should use raw images if you want reliability; raw is
857 also usually faster.) You should be able to migrate existing images to raw
858 using qemu-img(1)'s convert function; raw doesn't support advanced features
859 like snapshots tho. [a few important qcow2 bugfixed have been committed in
860 the meantime so this _might_ be less of an issue now; and meanwhile there
861 also is the new qed format - I don't know how stable that one is.]
863 - (also not FreeBSD-specific:) It is recommended to pass raw images using the
864 new -drive syntax, specifying format=raw explicitly in order to avoid
865 malicious guests being able to exploit the format autodetection thats
866 otherwise getting used. (Not that you should run malicious guests anyway,
867 but this eleminates at least a known attack vector.)
869 - qemu now has improved physical cdrom support, but still there is at
870 least one known problem: you need to have the guest eject the disc if you
871 want to change it/take it out, or otherwise the guest may continue using
872 state (like size) of the old disc. (You can also do like `change ide1-cd0
873 /dev/acd0' in the monitor after taking out the disc if a guest cannot eject
876 - The default configuration location (qemu-ifup script etc.) has been changed
877 from /etc to PREFIX/etc (usually /raven/etc). Move your files accordingly.
879 - The pcap code (-net nic... -net pcap,ifname=...) should work properly now,
880 with only one exception: Advanced features like TSO used on the host
881 interface can cause oversize packets which now do get truncated to avoid
882 confusing/panicing guests but of course still will cause retransmissions.
883 So if you see slow throughput and `pcap_send: packet size > ..., truncating'
884 messages on qemu's tty try disabling TSO etc on the host interface at least
888 [FILE:20:files/qemu-ifdown.sample]
893 [FILE:20:files/qemu-ifup.sample]
898 [FILE:436:dragonfly/patch-disas_libvixl_vixl_utils.h]
899 --- disas/libvixl/vixl/utils.h.orig 2021-12-14 20:42:02 UTC
900 +++ disas/libvixl/vixl/utils.h
901 @@ -42,6 +42,13 @@ namespace vixl {
902 #define PRINTF_CHECK(format_index, varargs_index)
906 +#define INT32_C(c) c
907 +#define INT64_C(c) (c ## LL)
908 +#define UINT32_C(c) (c ## U)
909 +#define UINT64_C(c) (c ## ULL)
912 // Check number width.
913 inline bool is_intn(unsigned n, int64_t x) {
914 VIXL_ASSERT((0 < n) && (n < 64));
917 [FILE:323:dragonfly/patch-hw-ppc_newworld.c]
918 --- hw/ppc/mac_newworld.c.orig 2021-12-14 20:42:02 UTC
919 +++ hw/ppc/mac_newworld.c
921 #include "hw/sysbus.h"
924 +/* FreeBSD headers define this */
929 #define MAX_IDE_BUS 2
930 #define CFG_ADDR 0xf0000510
931 #define TBFREQ (100UL * 1000UL * 1000UL)
934 [FILE:358:dragonfly/patch-hw_ppc_mac__oldworld.c]
935 --- hw/ppc/mac_oldworld.c.orig 2021-12-14 20:42:02 UTC
936 +++ hw/ppc/mac_oldworld.c
938 #define PROM_BASE 0xffc00000
939 #define PROM_SIZE (4 * MiB)
941 +/* FreeBSD headers define this */
946 static void fw_cfg_boot_set(void *opaque, const char *boot_device,
951 [FILE:906:dragonfly/patch-util_coroutine-ucontext.c]
952 --- util/coroutine-ucontext.c.orig 2021-12-14 20:42:01 UTC
953 +++ util/coroutine-ucontext.c
954 @@ -221,7 +221,15 @@ Coroutine *qemu_coroutine_new(void)
955 2, arg.i[0], arg.i[1]);
957 /* swapcontext() in, siglongjmp() back out */
958 - if (!sigsetjmp(old_env, 0)) {
959 + /* Save signal mask in this sigsetjmp, because makecontext on DragonFly
960 + * leaves all signals blocked when entering the new context with
962 + * Workaround this, by just having the signal mask restored by the
963 + * siglongjmp that brings us back from qemu_coroutine_new().
964 + * XXX Remove this workaround when the makecontext behaviour is fixed
967 + if (!sigsetjmp(old_env, 1)) {
968 start_switch_fiber_asan(COROUTINE_YIELD, &fake_stack_save, co->stack,
970 start_switch_fiber_tsan(&fake_stack_save,