pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/qemu-haxm: import qemu-3.0.0nb5



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Feb 14 19:51:34 2019 +0100
Changeset:	2c5d9c07ce8b312facff84f9b683f33056f13bfc

Added Files:
	qemu-haxm/DESCR
	qemu-haxm/Makefile
	qemu-haxm/PLIST
	qemu-haxm/PLIST.Linux
	qemu-haxm/distinfo
	qemu-haxm/files/Makefile.multinode-NetBSD
	qemu-haxm/options.mk
	qemu-haxm/patches/patch-Makefile
	qemu-haxm/patches/patch-audio_audio.c
	qemu-haxm/patches/patch-block.c
	qemu-haxm/patches/patch-configure
	qemu-haxm/patches/patch-contrib_ivshmem-client_ivshmem-client.c
	qemu-haxm/patches/patch-contrib_ivshmem-server_ivshmem-server.c
	qemu-haxm/patches/patch-hw_arm_boot.c
	qemu-haxm/patches/patch-hw_core_loader.c
	qemu-haxm/patches/patch-hw_core_uboot__image.h
	qemu-haxm/patches/patch-hw_display_omap__dss.c
	qemu-haxm/patches/patch-hw_net_etraxfs__eth.c
	qemu-haxm/patches/patch-hw_net_xilinx__axienet.c
	qemu-haxm/patches/patch-hw_usb_dev-mtp.c
	qemu-haxm/patches/patch-target_i386_hax-i386.h
	qemu-haxm/patches/patch-target_i386_kvm-stub.c
	qemu-haxm/patches/patch-tests_Makefile.include

Log Message:
wip/qemu-haxm: import qemu-3.0.0nb5

QEMU is a FAST! processor emulator using dynamic translation to achieve
good emulation speed, QEMU has two operating modes:

    * Full system emulation. In this mode, QEMU emulates a full system
      (for example a PC), including a processor and various peripherals.
      It can be used to launch different Operating Systems without rebooting
      the PC or to debug system code.
    * User mode emulation (Linux host only). In this mode, QEMU can launch
      Linux processes compiled for one CPU on another CPU. It can be used
      to launch the Wine Windows API emulator or to ease cross-compilation
      and cross-debugging.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=2c5d9c07ce8b312facff84f9b683f33056f13bfc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 qemu-haxm/DESCR                                    |  11 ++
 qemu-haxm/Makefile                                 | 138 +++++++++++++++++
 qemu-haxm/PLIST                                    | 169 +++++++++++++++++++++
 qemu-haxm/PLIST.Linux                              |   8 +
 qemu-haxm/distinfo                                 |  24 +++
 qemu-haxm/files/Makefile.multinode-NetBSD          |  59 +++++++
 qemu-haxm/options.mk                               |  29 ++++
 qemu-haxm/patches/patch-Makefile                   |  12 ++
 qemu-haxm/patches/patch-audio_audio.c              |  16 ++
 qemu-haxm/patches/patch-block.c                    |  42 +++++
 qemu-haxm/patches/patch-configure                  |  14 ++
 .../patch-contrib_ivshmem-client_ivshmem-client.c  |  37 +++++
 .../patch-contrib_ivshmem-server_ivshmem-server.c  |  36 +++++
 qemu-haxm/patches/patch-hw_arm_boot.c              |  26 ++++
 qemu-haxm/patches/patch-hw_core_loader.c           |  27 ++++
 qemu-haxm/patches/patch-hw_core_uboot__image.h     |  20 +++
 qemu-haxm/patches/patch-hw_display_omap__dss.c     |  30 ++++
 qemu-haxm/patches/patch-hw_net_etraxfs__eth.c      |  25 +++
 qemu-haxm/patches/patch-hw_net_xilinx__axienet.c   |  16 ++
 qemu-haxm/patches/patch-hw_usb_dev-mtp.c           |  17 +++
 qemu-haxm/patches/patch-target_i386_hax-i386.h     |  26 ++++
 qemu-haxm/patches/patch-target_i386_kvm-stub.c     |  23 +++
 qemu-haxm/patches/patch-tests_Makefile.include     |  17 +++
 23 files changed, 822 insertions(+)

diffs:
diff --git a/qemu-haxm/DESCR b/qemu-haxm/DESCR
new file mode 100644
index 0000000000..d939711a26
--- /dev/null
+++ b/qemu-haxm/DESCR
@@ -0,0 +1,11 @@
+QEMU is a FAST! processor emulator using dynamic translation to achieve
+good emulation speed, QEMU has two operating modes:
+
+    * Full system emulation. In this mode, QEMU emulates a full system
+      (for example a PC), including a processor and various peripherals.
+      It can be used to launch different Operating Systems without rebooting
+      the PC or to debug system code.
+    * User mode emulation (Linux host only). In this mode, QEMU can launch
+      Linux processes compiled for one CPU on another CPU. It can be used
+      to launch the Wine Windows API emulator or to ease cross-compilation
+      and cross-debugging.
diff --git a/qemu-haxm/Makefile b/qemu-haxm/Makefile
new file mode 100644
index 0000000000..8103771b28
--- /dev/null
+++ b/qemu-haxm/Makefile
@@ -0,0 +1,138 @@
+# $NetBSD: Makefile,v 1.194 2018/11/14 22:21:26 kleink Exp $
+
+DISTNAME=	qemu-3.0.0
+PKGREVISION=	5
+CATEGORIES=	emulators
+MASTER_SITES=	https://download.qemu.org/
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://www.qemu-project.org/
+COMMENT=	CPU emulator using dynamic translation
+LICENSE=	gnu-gpl-v2 AND gnu-lgpl-v2.1 AND mit AND modified-bsd
+
+USE_CURSES=		resize_term wide
+USE_LANGUAGES+=		c c++
+USE_TOOLS+=		bison flex gmake makeinfo perl:build pkg-config
+FAKE_NCURSES=		yes
+UNLIMIT_RESOURCES=	datasize
+HAS_CONFIGURE=		yes
+
+BUILD_DEPENDS+=		texi2html-[0-9]*:../../textproc/texi2html
+
+SUBST_CLASSES+=			prefix
+SUBST_STAGE.prefix=		pre-configure
+SUBST_MESSAGE.prefix=		Setting PREFIX
+SUBST_FILES.prefix+=		configure
+SUBST_VARS.prefix+=		PREFIX
+
+.include "options.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+CONFIGURE_ARGS+=	--prefix=${PREFIX}
+CONFIGURE_ARGS+=	--interp-prefix=${PREFIX}/share/qemu
+CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+=	--python=${PYTHONBIN}
+CONFIGURE_ARGS+=	--smbd=${PREFIX}/sbin/smbd
+CONFIGURE_ARGS+=	--mandir=${PREFIX}/${PKGMANDIR}
+CONFIGURE_ARGS+=	--enable-curses
+CONFIGURE_ARGS+=	--enable-jemalloc
+CONFIGURE_ARGS+=	--disable-opengl
+CONFIGURE_ENV+=		mansuffix=/${PKGMANDIR}
+
+.if defined(PKGSRC_USE_SSP)
+# do not add flags to everything
+PKGSRC_USE_SSP=		no
+CONFIGURE_ARGS+=	--enable-stack-protector
+.endif
+
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-aarch64
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-alpha
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-arm
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-cris
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-i386
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-lm32
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-m68k
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-microblaze
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-microblazeel
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-mips
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-mips64
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-mips64el
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-mipsel
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-moxie
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-or1k
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-ppc
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-ppc64
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-ppcemb
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-s390x
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-sh4
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-sh4eb
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-sparc
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-sparc64
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-tricore
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-unicore32
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-x86_64
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-xtensa
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-xtensaeb
+
+PKG_SYSCONFSUBDIR=	qemu
+
+REPLACE_PERL+=		scripts/texi2pod.pl
+
+PYTHON_VERSIONS_INCOMPATIBLE=	34 35 36 37 # not yet ported yet as of 2.10.0
+
+INSTALLATION_DIRS=	${PKGMANDIR}/man1 share/doc/qemu
+
+UE_ARCHS+=		alpha arm armeb cris i386 m68k microblaze mips mipsel
+UE_ARCHS+=		or1k ppc ppc64 ppc64abi32 sh4 sh4eb sparc sparc32plus
+UE_ARCHS+=		sparc64 x86_64 microblazeel s390x unicore32
+
+.if ${OPSYS} == "NetBSD"
+USER_EMUL=		i386 x86_64 sparc sparc64
+PLIST.nbd=		YES
+.elif !empty(OPSYS:M*BSD) || ${OPSYS} == "DragonFly"
+USER_EMUL=		i386 x86_64 sparc sparc64
+PLIST.nbd=		YES
+.elif ${OPSYS} == "Darwin"
+USER_EMUL=
+CONFIGURE_ARGS+=	--disable-bsd-user
+PLIST.nbd=		YES
+.elif ${OPSYS} == "Linux"
+USER_EMUL=		${UE_ARCHS}
+PLIST.nbd=		YES
+PLIST.ivshmem=		YES
+.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-*)
+PLIST.nbd=		YES
+CONFIGURE_ARGS+=	--disable-coroutine-pool
+.endif
+
+PLIST_VARS+=		${UE_ARCHS} nbd ivshmem
+.for pvar in ${USER_EMUL}
+PLIST.${pvar}=		YES
+.endfor
+
+TEST_TARGET=		check
+
+post-install:
+	${INSTALL_DATA} ${FILESDIR}/Makefile.multinode-NetBSD \
+		${DESTDIR}${PREFIX}/share/doc/qemu/
+
+# On Darwin, qemu uses Cocoa and CoreAudio
+.if ${OPSYS} != "Darwin"
+.include "../../mk/oss.buildlink3.mk"
+.endif
+.include "../../archivers/lzo/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/jemalloc/buildlink3.mk"
+.include "../../devel/snappy/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../lang/python/extension.mk"
+.include "../../security/libgcrypt/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../x11/pixman/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/qemu-haxm/PLIST b/qemu-haxm/PLIST
new file mode 100644
index 0000000000..8f37dde390
--- /dev/null
+++ b/qemu-haxm/PLIST
@@ -0,0 +1,169 @@
+@comment $NetBSD: PLIST,v 1.54 2018/04/25 07:56:05 adam Exp $
+${PLIST.ivshmem}bin/ivshmem-client
+${PLIST.ivshmem}bin/ivshmem-server
+${PLIST.alpha}bin/qemu-alpha
+${PLIST.arm}bin/qemu-arm
+${PLIST.armeb}bin/qemu-armeb
+${PLIST.cris}bin/qemu-cris
+bin/qemu-ga
+${PLIST.i386}bin/qemu-i386
+bin/qemu-img
+bin/qemu-io
+${PLIST.m68k}bin/qemu-m68k
+${PLIST.microblaze}bin/qemu-microblaze
+${PLIST.microblazeel}bin/qemu-microblazeel
+${PLIST.mips}bin/qemu-mips
+${PLIST.mipsel}bin/qemu-mipsel
+${PLIST.nbd}bin/qemu-nbd
+${PLIST.or1k}bin/qemu-or1k
+${PLIST.ppc}bin/qemu-ppc
+${PLIST.ppc64}bin/qemu-ppc64
+${PLIST.ppc64abi32}bin/qemu-ppc64abi32
+${PLIST.s390x}bin/qemu-s390x
+${PLIST.sh4}bin/qemu-sh4
+${PLIST.sh4eb}bin/qemu-sh4eb
+${PLIST.sparc}bin/qemu-sparc
+${PLIST.sparc32plus}bin/qemu-sparc32plus
+${PLIST.sparc64}bin/qemu-sparc64
+bin/qemu-system-aarch64
+bin/qemu-system-alpha
+bin/qemu-system-arm
+bin/qemu-system-cris
+bin/qemu-system-hppa
+bin/qemu-system-i386
+bin/qemu-system-lm32
+bin/qemu-system-m68k
+bin/qemu-system-microblaze
+bin/qemu-system-microblazeel
+bin/qemu-system-mips
+bin/qemu-system-mips64
+bin/qemu-system-mips64el
+bin/qemu-system-mipsel
+bin/qemu-system-moxie
+bin/qemu-system-nios2
+bin/qemu-system-or1k
+bin/qemu-system-ppc
+bin/qemu-system-ppc64
+bin/qemu-system-ppcemb
+bin/qemu-system-riscv32
+bin/qemu-system-riscv64
+bin/qemu-system-s390x
+bin/qemu-system-sh4
+bin/qemu-system-sh4eb
+bin/qemu-system-sparc
+bin/qemu-system-sparc64
+bin/qemu-system-tricore
+bin/qemu-system-unicore32
+bin/qemu-system-x86_64
+bin/qemu-system-xtensa
+bin/qemu-system-xtensaeb
+${PLIST.unicore32}bin/qemu-unicore32
+${PLIST.x86_64}bin/qemu-x86_64
+man/man1/qemu-img.1
+man/man1/qemu.1
+man/man7/qemu-block-drivers.7
+man/man7/qemu-ga-ref.7
+man/man7/qemu-qmp-ref.7
+man/man8/qemu-ga.8
+man/man8/qemu-nbd.8
+share/doc/qemu/Makefile.multinode-NetBSD
+share/doc/qemu/qemu-doc.html
+share/doc/qemu/qemu-doc.txt
+share/doc/qemu/qemu-ga-ref.html
+share/doc/qemu/qemu-ga-ref.txt
+share/doc/qemu/qemu-qmp-ref.html
+share/doc/qemu/qemu-qmp-ref.txt
+${PLIST.gtk}share/locale/bg/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/de_DE/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/fr_FR/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/hu/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/it/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/tr/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/zh_CN/LC_MESSAGES/qemu.mo
+share/qemu/QEMU,cgthree.bin
+share/qemu/QEMU,tcx.bin
+share/qemu/bamboo.dtb
+share/qemu/bios-256k.bin
+share/qemu/bios.bin
+share/qemu/canyonlands.dtb
+share/qemu/efi-e1000.rom
+share/qemu/efi-e1000e.rom
+share/qemu/efi-eepro100.rom
+share/qemu/efi-ne2k_pci.rom
+share/qemu/efi-pcnet.rom
+share/qemu/efi-rtl8139.rom
+share/qemu/efi-virtio.rom
+share/qemu/efi-vmxnet3.rom
+share/qemu/hppa-firmware.img
+share/qemu/keymaps/ar
+share/qemu/keymaps/bepo
+share/qemu/keymaps/common
+share/qemu/keymaps/cz
+share/qemu/keymaps/da
+share/qemu/keymaps/de
+share/qemu/keymaps/de-ch
+share/qemu/keymaps/en-gb
+share/qemu/keymaps/en-us
+share/qemu/keymaps/es
+share/qemu/keymaps/et
+share/qemu/keymaps/fi
+share/qemu/keymaps/fo
+share/qemu/keymaps/fr
+share/qemu/keymaps/fr-be
+share/qemu/keymaps/fr-ca
+share/qemu/keymaps/fr-ch
+share/qemu/keymaps/hr
+share/qemu/keymaps/hu
+share/qemu/keymaps/is
+share/qemu/keymaps/it
+share/qemu/keymaps/ja
+share/qemu/keymaps/lt
+share/qemu/keymaps/lv
+share/qemu/keymaps/mk
+share/qemu/keymaps/modifiers
+share/qemu/keymaps/nl
+share/qemu/keymaps/nl-be
+share/qemu/keymaps/no
+share/qemu/keymaps/pl
+share/qemu/keymaps/pt
+share/qemu/keymaps/pt-br
+share/qemu/keymaps/ru
+share/qemu/keymaps/sl
+share/qemu/keymaps/sv
+share/qemu/keymaps/th
+share/qemu/keymaps/tr
+share/qemu/kvmvapic.bin
+share/qemu/linuxboot.bin
+share/qemu/linuxboot_dma.bin
+share/qemu/multiboot.bin
+share/qemu/openbios-ppc
+share/qemu/openbios-sparc32
+share/qemu/openbios-sparc64
+share/qemu/palcode-clipper
+share/qemu/petalogix-ml605.dtb
+share/qemu/petalogix-s3adsp1800.dtb
+share/qemu/ppc_rom.bin
+share/qemu/pxe-e1000.rom
+share/qemu/pxe-eepro100.rom
+share/qemu/pxe-ne2k_pci.rom
+share/qemu/pxe-pcnet.rom
+share/qemu/pxe-rtl8139.rom
+share/qemu/pxe-virtio.rom
+share/qemu/qemu-icon.bmp
+share/qemu/qemu_logo_no_text.svg
+share/qemu/qemu_vga.ndrv
+share/qemu/s390-ccw.img
+share/qemu/s390-netboot.img
+share/qemu/sgabios.bin
+share/qemu/skiboot.lid
+share/qemu/slof.bin
+share/qemu/spapr-rtas.bin
+share/qemu/trace-events-all
+share/qemu/u-boot-sam460-20100605.bin
+share/qemu/u-boot.e500
+share/qemu/vgabios-cirrus.bin
+share/qemu/vgabios-qxl.bin
+share/qemu/vgabios-stdvga.bin
+share/qemu/vgabios-virtio.bin
+share/qemu/vgabios-vmware.bin
+share/qemu/vgabios.bin
diff --git a/qemu-haxm/PLIST.Linux b/qemu-haxm/PLIST.Linux
new file mode 100644
index 0000000000..ca5a923bb0
--- /dev/null
+++ b/qemu-haxm/PLIST.Linux
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.Linux,v 1.4 2015/12/10 02:51:05 joerg Exp $
+bin/qemu-aarch64
+bin/qemu-mips64
+bin/qemu-mips64el
+bin/qemu-mipsn32
+bin/qemu-mipsn32el
+bin/qemu-ppc64le
+libexec/qemu-bridge-helper
diff --git a/qemu-haxm/distinfo b/qemu-haxm/distinfo
new file mode 100644
index 0000000000..70c0e7db9b
--- /dev/null
+++ b/qemu-haxm/distinfo
@@ -0,0 +1,24 @@
+$NetBSD: distinfo,v 1.138 2018/11/05 07:27:59 skrll Exp $
+
+SHA1 (qemu-3.0.0.tar.xz) = fffb4aa0139c7290295a129e040cec0df4468ea6
+RMD160 (qemu-3.0.0.tar.xz) = ea61cb8b6b144c7017c3a53161f883c3aeb15611
+SHA512 (qemu-3.0.0.tar.xz) = a764302f50b9aca4134bbbc1f361b98e71240cdc7b25600dfe733bf4cf17bd86000bd28357697b08f3b656899dceb9e459350b8d55557817444ed5d7fa380a5a
+Size (qemu-3.0.0.tar.xz) = 35624516 bytes
+SHA1 (patch-Makefile) = b3899fb8d0dd2f29bf3edd843836612e6e6c019c
+SHA1 (patch-audio_audio.c) = 98a1de2fd48638886b5d16f6a61dc72910e98b41
+SHA1 (patch-block.c) = 5eb15a87d6646719bf1e9277fbe73a99e4905481
+SHA1 (patch-configure) = eb720300f48392da936773f003d8fc4d5aedea1f
+SHA1 (patch-contrib_ivshmem-client_ivshmem-client.c) = 40c8751607cbf66a37e4c4e08f2664b864e2e984
+SHA1 (patch-contrib_ivshmem-server_ivshmem-server.c) = d8f53432b5752f4263dc4ef96108a976a05147a3
+SHA1 (patch-hw_arm_boot.c) = bd28e4b8e8732a2b01ba1d0e8a727e8e7bc5227a
+SHA1 (patch-hw_core_loader.c) = 06ff8bfa5be720e428668987598d55b6799202e7
+SHA1 (patch-hw_core_uboot__image.h) = 26a656310d991747b7080b9f28042afd536e4c28
+SHA1 (patch-hw_display_omap__dss.c) = 6b13242f28e32346bc70548c216c578d98fd3420
+SHA1 (patch-hw_net_etraxfs__eth.c) = e5dd1661d60dbcd27b332403e0843500ba9544bc
+SHA1 (patch-hw_net_xilinx__axienet.c) = ebcd2676d64ce6f31e4a8c976d4fdf530ad5e8b7
+SHA1 (patch-hw_usb_dev-mtp.c) = 66543b5559d92f8e2fa9a6eb85e5dfe7c1ad3339
+SHA1 (patch-include_sysemu_kvm.h) = f99e8ad021f6c8e89e3ca52538bd9b0656e6f619
+SHA1 (patch-target_i386_Makefile.objs) = bf6e641f44abead5c1909c43681c2b8ea97f31a0
+SHA1 (patch-target_i386_hax-i386.h) = 040f5c4df532a027bb3d7305c7d924e1bd8fd831
+SHA1 (patch-target_i386_kvm-stub.c) = 4cd2b7a8d8d8a317829f982b5acff7fdf2479d9f
+SHA1 (patch-tests_Makefile.include) = 42345d697cb2e324dccf1d68bd8d61e8001c6162
diff --git a/qemu-haxm/files/Makefile.multinode-NetBSD b/qemu-haxm/files/Makefile.multinode-NetBSD
new file mode 100644
index 0000000000..f4313832eb
--- /dev/null
+++ b/qemu-haxm/files/Makefile.multinode-NetBSD
@@ -0,0 +1,59 @@
+# $Id: Makefile.multinode-NetBSD,v 1.4 2012/06/07 21:23:46 ryoon Exp $
+# Source: http://mail-index.NetBSD.org/netbsd-help/2005/03/25/0005.html
+#
+# Starts up two qemu instances and networks bridges them to the local
+# ethernet (ETHER_IF}.  Works best with NetBSD configured to use serial
+# consoles in DISK[12]
+#
+# Usage:
+#	sudo make netbsd1
+#	sudo make netbsd2
+#
+#  - Hubert Feyrer <hubert%feyrer.de@localhost>
+#
+
+#NETBSD_NOGFX=
+NETBSD_NOGFX=		-nographic
+
+ETHER_IF=	tlp0
+QEMU_RAM=	20
+DISK1=		harddisk.netbsd1
+DISK2=		harddisk.netbsd2
+
+
+all: netbsd1 netbsd2
+
+netbsd1: bridge 
+	ifconfig tap1 create up	     || echo tap1: already there
+	brconfig bridge0 add tap1 up || echo tap1: already on bridge0
+	brconfig bridge0 -learn tap1 # real hub mode, step 1b
+	brconfig bridge0 flush	# real hub more, step 2
+	qemu \	
+		-m ${QEMU_RAM} \
+		${NETBSD_NOGFX} \
+		-boot c \
+		-net tap,fd=3,ifname=tap1 3<>/dev/tap1 \
+		-net nic,macaddr=de:ad:be:ef:00:01 \
+		${DISK1}
+	brconfig bridge0 delete tap1 
+	ifconfig tap1 destroy
+
+netbsd2: bridge
+	ifconfig tap2 create up	     || echo tap2: already there
+	brconfig bridge0 add tap2 up || echo tap2: already on bridge0
+	brconfig bridge0 -learn tap2 # real hub mode, step 1c
+	brconfig bridge0 flush	     # real hub mode, step 2
+	qemu \
+		-m ${QEMU_RAM} \
+		${NETBSD_NOGFX} \
+		-boot c \
+		-net tap,fd=3,ifname=tap2 3<>/dev/tap2 \
+		-net nic,macaddr=de:ad:be:ef:00:02 \
+		${DISK2}
+	brconfig bridge0 delete tap2
+	ifconfig tap2 destroy
+	
+bridge:
+	ifconfig bridge0 create	  || echo bridge0: already there
+	brconfig bridge0 add ${ETHER_IF} || echo bridge0: ${ETHER_IF} already there
+	brconfig bridge0 -learn ${ETHER_IF} # real hub mode, step 1a
diff --git a/qemu-haxm/options.mk b/qemu-haxm/options.mk
new file mode 100644
index 0000000000..e7fbed3df6
--- /dev/null
+++ b/qemu-haxm/options.mk
@@ -0,0 +1,29 @@
+# $NetBSD: options.mk,v 1.5 2018/08/14 06:57:26 adam Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.qemu
+PKG_SUPPORTED_OPTIONS=	gtk3 sdl
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if ${OPSYS} != "Darwin"
+PKG_SUGGESTED_OPTIONS+=	sdl
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=		gtk
+
+.if !empty(PKG_OPTIONS:Mgtk3)
+PLIST.gtk=		yes
+CONFIGURE_ARGS+=	--enable-gtk
+.include "../../x11/gtk3/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-gtk
+.endif
+
+.if !empty(PKG_OPTIONS:Msdl)
+CONFIGURE_ARGS+=	--enable-sdl
+.include "../../devel/SDL2/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-sdl
+.endif
diff --git a/qemu-haxm/patches/patch-Makefile b/qemu-haxm/patches/patch-Makefile
new file mode 100644
index 0000000000..76fa15ebb6
--- /dev/null
+++ b/qemu-haxm/patches/patch-Makefile
@@ -0,0 +1,12 @@
+$NetBSD: patch-Makefile,v 1.1 2017/12/14 02:03:53 kamil Exp $
+
+--- Makefile.orig	2017-12-13 17:27:20.000000000 +0000
++++ Makefile
+@@ -385,6 +385,7 @@ subdir-%:
+ DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+ DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
+ DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
++ARFLAGS=	-rcs
+ 
+ subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests
+ 	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
diff --git a/qemu-haxm/patches/patch-audio_audio.c b/qemu-haxm/patches/patch-audio_audio.c
new file mode 100644
index 0000000000..2d6d38ae53
--- /dev/null
+++ b/qemu-haxm/patches/patch-audio_audio.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-audio_audio.c,v 1.1 2017/12/14 08:01:10 adam Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- audio/audio.c.orig	2016-09-02 15:34:17.000000000 +0000
++++ audio/audio.c
+@@ -1156,7 +1156,7 @@ int AUD_read (SWVoiceIn *sw, void *buf, 
+         return 0;
+     }
+ 
+-    return sw->hw->pcm_ops->read(sw, buf, size);
++    return (sw->hw->pcm_ops->read)(sw, buf, size);
+ }
+ 
+ int AUD_get_buffer_size_out (SWVoiceOut *sw)
diff --git a/qemu-haxm/patches/patch-block.c b/qemu-haxm/patches/patch-block.c
new file mode 100644
index 0000000000..c32359b910
--- /dev/null
+++ b/qemu-haxm/patches/patch-block.c
@@ -0,0 +1,42 @@
+$NetBSD: patch-block.c,v 1.2 2018/04/25 07:56:05 adam Exp $
+
+Remove block driver whitelisting logic; reasons being:
+- PkgSrc does not configure Qemu to use whitelisting
+- sometimes CONFIG...WHITELIST macros contain ["", NULL],
+  and bdrv_is_whitelisted() fails.
+
+--- block.c.orig	2018-03-27 22:29:23.000000000 +0000
++++ block.c
+@@ -373,31 +373,7 @@ BlockDriver *bdrv_find_format(const char
+ 
+ int bdrv_is_whitelisted(BlockDriver *drv, bool read_only)
+ {
+-    static const char *whitelist_rw[] = {
+-        CONFIG_BDRV_RW_WHITELIST
+-    };
+-    static const char *whitelist_ro[] = {
+-        CONFIG_BDRV_RO_WHITELIST
+-    };
+-    const char **p;
+-
+-    if (!whitelist_rw[0] && !whitelist_ro[0]) {
+-        return 1;               /* no whitelist, anything goes */
+-    }
+-
+-    for (p = whitelist_rw; *p; p++) {
+-        if (!strcmp(drv->format_name, *p)) {
+-            return 1;
+-        }
+-    }
+-    if (read_only) {
+-        for (p = whitelist_ro; *p; p++) {
+-            if (!strcmp(drv->format_name, *p)) {
+-                return 1;
+-            }
+-        }
+-    }
+-    return 0;
++    return 1;
+ }
+ 
+ bool bdrv_uses_whitelist(void)
diff --git a/qemu-haxm/patches/patch-configure b/qemu-haxm/patches/patch-configure
new file mode 100644
index 0000000000..fac18d335e
--- /dev/null
+++ b/qemu-haxm/patches/patch-configure
@@ -0,0 +1,14 @@
+$NetBSD: patch-configure,v 1.24 2019/02/13 05:16:12 kamil Exp $
+
+configure: Add HAX support in NetBSD
+
+--- configure.orig	2018-12-11 17:44:34.000000000 +0000
++++ configure
+@@ -809,6 +809,7 @@ DragonFly)
+ ;;
+ NetBSD)
+   bsd="yes"
++  hax="yes"
+   make="${MAKE-gmake}"
+   audio_drv_list="oss"
+   audio_possible_drivers="oss sdl"
diff --git a/qemu-haxm/patches/patch-contrib_ivshmem-client_ivshmem-client.c b/qemu-haxm/patches/patch-contrib_ivshmem-client_ivshmem-client.c
new file mode 100644
index 0000000000..8ed854c325
--- /dev/null
+++ b/qemu-haxm/patches/patch-contrib_ivshmem-client_ivshmem-client.c
@@ -0,0 +1,37 @@
+$NetBSD: patch-contrib_ivshmem-client_ivshmem-client.c,v 1.1 2017/08/25 12:39:56 jperkin Exp $
+
+Avoid sun definition.
+
+--- contrib/ivshmem-client/ivshmem-client.c.orig	2017-04-20 14:57:00.000000000 +0000
++++ contrib/ivshmem-client/ivshmem-client.c
+@@ -179,7 +179,7 @@ ivshmem_client_init(IvshmemClient *clien
+ int
+ ivshmem_client_connect(IvshmemClient *client)
+ {
+-    struct sockaddr_un sun;
++    struct sockaddr_un sockun;
+     int fd, ret;
+     int64_t tmp;
+ 
+@@ -193,16 +193,16 @@ ivshmem_client_connect(IvshmemClient *cl
+         return -1;
+     }
+ 
+-    sun.sun_family = AF_UNIX;
+-    ret = snprintf(sun.sun_path, sizeof(sun.sun_path), "%s",
++    sockun.sun_family = AF_UNIX;
++    ret = snprintf(sockun.sun_path, sizeof(sockun.sun_path), "%s",
+                    client->unix_sock_path);
+-    if (ret < 0 || ret >= sizeof(sun.sun_path)) {
++    if (ret < 0 || ret >= sizeof(sockun.sun_path)) {
+         IVSHMEM_CLIENT_DEBUG(client, "could not copy unix socket path\n");
+         goto err_close;
+     }
+ 
+-    if (connect(client->sock_fd, (struct sockaddr *)&sun, sizeof(sun)) < 0) {
+-        IVSHMEM_CLIENT_DEBUG(client, "cannot connect to %s: %s\n", sun.sun_path,
++    if (connect(client->sock_fd, (struct sockaddr *)&sockun, sizeof(sockun)) < 0) {
++        IVSHMEM_CLIENT_DEBUG(client, "cannot connect to %s: %s\n", sockun.sun_path,
+                              strerror(errno));
+         goto err_close;
+     }
diff --git a/qemu-haxm/patches/patch-contrib_ivshmem-server_ivshmem-server.c b/qemu-haxm/patches/patch-contrib_ivshmem-server_ivshmem-server.c
new file mode 100644
index 0000000000..d773418cfe
--- /dev/null
+++ b/qemu-haxm/patches/patch-contrib_ivshmem-server_ivshmem-server.c
@@ -0,0 +1,36 @@
+$NetBSD: patch-contrib_ivshmem-server_ivshmem-server.c,v 1.1 2017/08/25 12:39:56 jperkin Exp $
+
+Avoid sun definition.
+
+--- contrib/ivshmem-server/ivshmem-server.c.orig	2017-04-20 14:57:00.000000000 +0000
++++ contrib/ivshmem-server/ivshmem-server.c
+@@ -289,7 +289,7 @@ ivshmem_server_init(IvshmemServer *serve
+ int
+ ivshmem_server_start(IvshmemServer *server)
+ {
+-    struct sockaddr_un sun;
++    struct sockaddr_un sockun;
+     int shm_fd, sock_fd, ret;
+ 
+     /* open shm file */
+@@ -328,15 +328,15 @@ ivshmem_server_start(IvshmemServer *serv
+         goto err_close_shm;
+     }
+ 
+-    sun.sun_family = AF_UNIX;
+-    ret = snprintf(sun.sun_path, sizeof(sun.sun_path), "%s",
++    sockun.sun_family = AF_UNIX;
++    ret = snprintf(sockun.sun_path, sizeof(sockun.sun_path), "%s",
+                    server->unix_sock_path);
+-    if (ret < 0 || ret >= sizeof(sun.sun_path)) {
++    if (ret < 0 || ret >= sizeof(sockun.sun_path)) {
+         IVSHMEM_SERVER_DEBUG(server, "could not copy unix socket path\n");
+         goto err_close_sock;
+     }
+-    if (bind(sock_fd, (struct sockaddr *)&sun, sizeof(sun)) < 0) {
+-        IVSHMEM_SERVER_DEBUG(server, "cannot connect to %s: %s\n", sun.sun_path,
++    if (bind(sock_fd, (struct sockaddr *)&sockun, sizeof(sockun)) < 0) {
++        IVSHMEM_SERVER_DEBUG(server, "cannot connect to %s: %s\n", sockun.sun_path,
+                              strerror(errno));
+         goto err_close_sock;
+     }
diff --git a/qemu-haxm/patches/patch-hw_arm_boot.c b/qemu-haxm/patches/patch-hw_arm_boot.c
new file mode 100644
index 0000000000..60b69f66a8
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_arm_boot.c
@@ -0,0 +1,26 @@
+$NetBSD: patch-hw_arm_boot.c,v 1.1 2018/11/05 07:27:59 skrll Exp $
+
+--- hw/arm/boot.c.orig	2018-11-04 17:27:47.000000000 +0000
++++ hw/arm/boot.c
+@@ -29,8 +29,9 @@
+  * Documentation/arm/Booting and Documentation/arm64/booting.txt
+  * They have different preferred image load offsets from system RAM base.
+  */
+-#define KERNEL_ARGS_ADDR 0x100
+-#define KERNEL_LOAD_ADDR 0x00010000
++#define KERNEL_ARGS_ADDR   0x100
++#define KERNEL_NOLOAD_ADDR 0x00000000
++#define KERNEL_LOAD_ADDR   0x00010000
+ #define KERNEL64_LOAD_ADDR 0x00080000
+ 
+ #define ARM64_TEXT_OFFSET_OFFSET    8
+@@ -1049,7 +1050,8 @@ void arm_load_kernel(ARMCPU *cpu, struct
+     }
+     entry = elf_entry;
+     if (kernel_size < 0) {
+-        kernel_size = load_uimage_as(info->kernel_filename, &entry, NULL,
++        uint64_t loadaddr = info->loader_start + KERNEL_NOLOAD_ADDR;
++        kernel_size = load_uimage_as(info->kernel_filename, &entry, &loadaddr,
+                                      &is_linux, NULL, NULL, as);
+     }
+     if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64) && kernel_size < 0) {
diff --git a/qemu-haxm/patches/patch-hw_core_loader.c b/qemu-haxm/patches/patch-hw_core_loader.c
new file mode 100644
index 0000000000..700792064e
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_core_loader.c
@@ -0,0 +1,27 @@
+$NetBSD: patch-hw_core_loader.c,v 1.1 2018/11/05 07:27:59 skrll Exp $
+
+--- hw/core/loader.c.orig	2018-08-14 19:10:34.000000000 +0000
++++ hw/core/loader.c
+@@ -637,13 +637,19 @@ static int load_uboot_image(const char *
+         goto out;
+ 
+     if (hdr->ih_type != image_type) {
+-        fprintf(stderr, "Wrong image type %d, expected %d\n", hdr->ih_type,
+-                image_type);
+-        goto out;
++        if (image_type != IH_TYPE_KERNEL && hdr->ih_type != IH_TYPE_KERNEL_NOLOAD) {
++            fprintf(stderr, "Wrong image type %d, expected %d\n", hdr->ih_type,
++                    image_type);
++            goto out;
++        }
+     }
+ 
+     /* TODO: Implement other image types.  */
+     switch (hdr->ih_type) {
++    case IH_TYPE_KERNEL_NOLOAD:
++        hdr->ih_load = *loadaddr + sizeof(*hdr);
++        hdr->ih_ep += hdr->ih_load;
++
+     case IH_TYPE_KERNEL:
+         address = hdr->ih_load;
+         if (translate_fn) {
diff --git a/qemu-haxm/patches/patch-hw_core_uboot__image.h b/qemu-haxm/patches/patch-hw_core_uboot__image.h
new file mode 100644
index 0000000000..a9a005762b
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_core_uboot__image.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-hw_core_uboot__image.h,v 1.1 2018/11/05 07:27:59 skrll Exp $
+
+--- hw/core/uboot_image.h.orig	2018-08-14 19:10:34.000000000 +0000
++++ hw/core/uboot_image.h
+@@ -75,6 +75,7 @@
+ #define IH_CPU_NIOS2		15	/* Nios-II	*/
+ #define IH_CPU_BLACKFIN		16	/* Blackfin	*/
+ #define IH_CPU_AVR32		17	/* AVR32	*/
++#define IH_CPU_ARM64		22	/* ARM64        */
+ 
+ /*
+  * Image Types
+@@ -124,6 +125,7 @@
+ #define IH_TYPE_SCRIPT		6	/* Script file			*/
+ #define IH_TYPE_FILESYSTEM	7	/* Filesystem Image (any type)	*/
+ #define IH_TYPE_FLATDT		8	/* Binary Flat Device Tree Blob	*/
++#define IH_TYPE_KERNEL_NOLOAD  14	/* OS Kernel Image (noload)	*/
+ 
+ /*
+  * Compression Types
diff --git a/qemu-haxm/patches/patch-hw_display_omap__dss.c b/qemu-haxm/patches/patch-hw_display_omap__dss.c
new file mode 100644
index 0000000000..fca1167bf3
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_display_omap__dss.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-hw_display_omap__dss.c,v 1.2 2014/01/15 18:26:20 wiz Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- hw/display/omap_dss.c.orig	2013-11-27 22:15:55.000000000 +0000
++++ hw/display/omap_dss.c
+@@ -791,18 +791,18 @@ static void omap_rfbi_write(void *opaque
+         break;
+     case 0x58:	/* RFBI_READ */
+         if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
+-            s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 1);
++            s->rfbi.rxbuf = (*s->rfbi.chip[0]->read)(s->rfbi.chip[0]->opaque, 1);
+         else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
+-            s->rfbi.rxbuf = s->rfbi.chip[1]->read(s->rfbi.chip[1]->opaque, 1);
++            s->rfbi.rxbuf = (*s->rfbi.chip[1]->read)(s->rfbi.chip[1]->opaque, 1);
+         if (!-- s->rfbi.pixels)
+             omap_rfbi_transfer_stop(s);
+         break;
+ 
+     case 0x5c:	/* RFBI_STATUS */
+         if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
+-            s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 0);
++            s->rfbi.rxbuf = (*s->rfbi.chip[0]->read)(s->rfbi.chip[0]->opaque, 0);
+         else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
+-            s->rfbi.rxbuf = s->rfbi.chip[1]->read(s->rfbi.chip[1]->opaque, 0);
++            s->rfbi.rxbuf = (*s->rfbi.chip[1]->read)(s->rfbi.chip[1]->opaque, 0);
+         if (!-- s->rfbi.pixels)
+             omap_rfbi_transfer_stop(s);
+         break;
diff --git a/qemu-haxm/patches/patch-hw_net_etraxfs__eth.c b/qemu-haxm/patches/patch-hw_net_etraxfs__eth.c
new file mode 100644
index 0000000000..834cf8dfb1
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_net_etraxfs__eth.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-hw_net_etraxfs__eth.c,v 1.3 2014/01/15 18:26:20 wiz Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- hw/net/etraxfs_eth.c.orig	2013-11-27 22:15:55.000000000 +0000
++++ hw/net/etraxfs_eth.c
+@@ -185,7 +185,7 @@ static void mdio_read_req(struct qemu_md
+ 
+     phy = bus->devs[bus->addr];
+     if (phy && phy->read) {
+-        bus->data = phy->read(phy, bus->req);
++        bus->data = (*phy->read)(phy, bus->req);
+     } else {
+         bus->data = 0xffff;
+     }
+@@ -364,7 +364,7 @@ static void eth_validate_duplex(ETRAXFSE
+     int new_mm = 0;
+ 
+     phy = eth->mdio_bus.devs[eth->phyaddr];
+-    phy_duplex = !!(phy->read(phy, 18) & (1 << 11));
++    phy_duplex = !!((*phy->read)(phy, 18) & (1 << 11));
+     mac_duplex = !!(eth->regs[RW_REC_CTRL] & 128);
+ 
+     if (mac_duplex != phy_duplex) {
diff --git a/qemu-haxm/patches/patch-hw_net_xilinx__axienet.c b/qemu-haxm/patches/patch-hw_net_xilinx__axienet.c
new file mode 100644
index 0000000000..af632b972d
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_net_xilinx__axienet.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-hw_net_xilinx__axienet.c,v 1.2 2014/01/15 18:26:20 wiz Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- hw/net/xilinx_axienet.c.orig	2013-11-27 22:15:55.000000000 +0000
++++ hw/net/xilinx_axienet.c
+@@ -207,7 +207,7 @@ static uint16_t mdio_read_req(struct MDI
+ 
+     phy = bus->devs[addr];
+     if (phy && phy->read) {
+-        data = phy->read(phy, reg);
++        data = (*phy->read)(phy, reg);
+     } else {
+         data = 0xffff;
+     }
diff --git a/qemu-haxm/patches/patch-hw_usb_dev-mtp.c b/qemu-haxm/patches/patch-hw_usb_dev-mtp.c
new file mode 100644
index 0000000000..6358e81a2b
--- /dev/null
+++ b/qemu-haxm/patches/patch-hw_usb_dev-mtp.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-hw_usb_dev-mtp.c,v 1.2 2018/08/16 10:15:09 adam Exp $
+
+Support NAME_MAX.
+
+--- hw/usb/dev-mtp.c.orig	2018-08-14 19:10:34.000000000 +0000
++++ hw/usb/dev-mtp.c
+@@ -26,6 +26,10 @@
+ #include "hw/usb.h"
+ #include "desc.h"
+ 
++#ifndef NAME_MAX
++#define NAME_MAX 255
++#endif
++
+ /* ----------------------------------------------------------------------- */
+ 
+ enum mtp_container_type {
diff --git a/qemu-haxm/patches/patch-target_i386_hax-i386.h b/qemu-haxm/patches/patch-target_i386_hax-i386.h
new file mode 100644
index 0000000000..3578999af4
--- /dev/null
+++ b/qemu-haxm/patches/patch-target_i386_hax-i386.h
@@ -0,0 +1,26 @@
+$NetBSD: patch-target_i386_hax-i386.h,v 1.1 2019/02/13 05:16:12 kamil Exp $
+
+Cherry-pick:
+ - hax: Support for Linux hosts [modified for pkgsrc]
+   b65cc8dec07fec77dbda7bc5daf1defcb7c411d9
+
+--- target/i386/hax-i386.h.orig	2018-12-11 17:44:34.000000000 +0000
++++ target/i386/hax-i386.h
+@@ -16,7 +16,7 @@
+ #include "cpu.h"
+ #include "sysemu/hax.h"
+ 
+-#ifdef CONFIG_DARWIN
++#ifdef CONFIG_POSIX
+ typedef int hax_fd;
+ #endif
+ 
+@@ -82,7 +82,7 @@ hax_fd hax_mod_open(void);
+ void hax_memory_init(void);
+ 
+ 
+-#ifdef CONFIG_DARWIN
++#ifdef CONFIG_POSIX
+ #include "target/i386/hax-darwin.h"
+ #endif
+ 
diff --git a/qemu-haxm/patches/patch-target_i386_kvm-stub.c b/qemu-haxm/patches/patch-target_i386_kvm-stub.c
new file mode 100644
index 0000000000..0b551728c5
--- /dev/null
+++ b/qemu-haxm/patches/patch-target_i386_kvm-stub.c
@@ -0,0 +1,23 @@
+$NetBSD: patch-target_i386_kvm-stub.c,v 1.1 2019/02/13 05:16:12 kamil Exp $
+
+Fix debug build on NetBSD (without Linux-KVM).
+
+--- target/i386/kvm-stub.c.orig	2019-02-02 13:12:09.564671574 +0000
++++ target/i386/kvm-stub.c
+@@ -29,16 +29,6 @@ bool kvm_enable_x2apic(void)
+ {
+     return false;
+ }
+-
+-/* This function is only called inside conditionals which we
+- * rely on the compiler to optimize out when CONFIG_KVM is not
+- * defined.
+- */
+-uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function,
+-                                      uint32_t index, int reg)
+-{
+-    abort();
+-}
+ #endif
+ 
+ bool kvm_hv_vpindex_settable(void)
diff --git a/qemu-haxm/patches/patch-tests_Makefile.include b/qemu-haxm/patches/patch-tests_Makefile.include
new file mode 100644
index 0000000000..9921005155
--- /dev/null
+++ b/qemu-haxm/patches/patch-tests_Makefile.include
@@ -0,0 +1,17 @@
+$NetBSD: patch-tests_Makefile.include,v 1.1 2016/09/04 09:21:04 ryoon Exp $
+
+* Don't link -lutil on SunOS
+
+--- tests/Makefile.include.orig	2016-09-02 15:34:24.000000000 +0000
++++ tests/Makefile.include
+@@ -645,8 +645,10 @@ tests/migration/initrd-stress.img: tests
+ 	rmdir $(INITRD_WORK_DIR)
+ 
+ ifeq ($(CONFIG_POSIX),y)
++ifneq ($(CONFIG_SOLARIS),y)
+ LIBS += -lutil
+ endif
++endif
+ 
+ # QTest rules
+ 


Home | Main Index | Thread Index | Old Index