Index: MOVED =================================================================== --- MOVED +++ MOVED @@ -6868,8 +6868,6 @@ databases/ruby-frontbase||2014-09-07|Cascade removal (databases/frontbase) devel/flex-sdk2||2014-09-07|Not staged devel/flex_compiler_shell||2014-09-07|Cascade removal (devel/flex-sdk2) -emulators/virtualbox-ose-legacy||2014-09-09|Not staged -emulators/virtualbox-ose-kmod-legacy||2014-09-09|No purpose after removal of virtualbox-ose-legacy devel/arm-eabi-gcc||2014-09-09|Not staged devel/cross-gcc||2014-09-09|Not staged devel/arm-eabi-binutils||2014-09-09|No purpose after removal of arm-eabi-gcc Index: UPDATING =================================================================== --- UPDATING +++ UPDATING @@ -5,14 +5,33 @@ You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. -20210302: - AFFECTS: users of editors/emacs-devel - AUTHOR: jrm@FreeBSD.org +20210310: + AFFECTS: users of emulators/virtualbox-ose + AUTHOR: madpilot@FreeBSD.org - If you get the error "Symbol's value as variable is void: minor-modes", - rebuild the offending Emacs packages. See - https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg01164.html - for details. + emulators/virtualbox-ose has been updated to 6.1.18. This new + version only works on amd64 hardware. + + Previous version 5.x of the virtualbox ports have been preserved + as emulators/virtualbox-ose-legacy and similarly named ports for + the others. + + If you can't run the latest version or wish to stay with the old + version, please install the legacy ports. + + Also the additions at present build succefully only forf amd64. + If you need i386 additions you can fallback to the old legacy + ones. + + NOTE: There is no warranty or support for moving saved running + machine states across major updates of virtualbox. It is + recommended to properly shutdown all virtual machines before + upgrading. Otherwise the saved state can simply be discarded after + upgrade, if it's not cared for preserving it. + + It should also be possible to downgrade to the legacy ports and + shutdown the machine properly from the saved state and then upgrade + back again. 20210220: AFFECTS: users of math/py-mathics Index: emulators/Makefile =================================================================== --- emulators/Makefile +++ emulators/Makefile @@ -153,9 +153,14 @@ SUBDIR += vice SUBDIR += virtualbox-ose SUBDIR += virtualbox-ose-additions + SUBDIR += virtualbox-ose-additions-legacy SUBDIR += virtualbox-ose-additions-nox11 + SUBDIR += virtualbox-ose-additions-nox11-legacy SUBDIR += virtualbox-ose-kmod + SUBDIR += virtualbox-ose-kmod-legacy + SUBDIR += virtualbox-ose-legacy SUBDIR += virtualbox-ose-nox11 + SUBDIR += virtualbox-ose-nox11-legacy SUBDIR += visualboyadvance-m SUBDIR += vmips SUBDIR += vmsbackup Index: emulators/virtualbox-ose-additions-legacy/Makefile =================================================================== --- emulators/virtualbox-ose-additions-legacy/Makefile +++ emulators/virtualbox-ose-additions-legacy/Makefile @@ -6,7 +6,7 @@ PORTREVISION= 3 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ -PKGNAMESUFFIX?= -additions +PKGNAMESUFFIX?= -additions-legacy DISTNAME= VirtualBox-${PORTVERSION} MAINTAINER= vbox@FreeBSD.org @@ -26,7 +26,7 @@ CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox -PATCHDIR= ${.CURDIR}/../${PORTNAME}/files +PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} MAKE_JOBS_UNSAFE= yes @@ -44,7 +44,7 @@ CONFLICTS_INSTALL= virtualbox-ose-[0-9]* \ virtualbox-ose-additions-devel-[0-9]* \ virtualbox-ose-devel-[0-9]* \ - virtualbox-ose-legacy-[0-9]* \ + virtualbox-ose-[0-9]* \ virtualbox-ose-lite-[0-9]* \ virtualbox-ose-nox11-[0-9]* Index: emulators/virtualbox-ose-additions-nox11-legacy/Makefile =================================================================== --- emulators/virtualbox-ose-additions-nox11-legacy/Makefile +++ emulators/virtualbox-ose-additions-nox11-legacy/Makefile @@ -1,9 +1,9 @@ # $FreeBSD$ -PKGNAMESUFFIX= -additions-nox11 +PKGNAMESUFFIX= -additions-nox11-legacy OPTIONS_EXCLUDE= DBUS DEBUG OPENGL X11 -MASTERDIR= ${.CURDIR}/../virtualbox-ose-additions +MASTERDIR= ${.CURDIR}/../virtualbox-ose-additions-legacy .include "${MASTERDIR}/Makefile" Index: emulators/virtualbox-ose-additions/Makefile =================================================================== --- emulators/virtualbox-ose-additions/Makefile +++ emulators/virtualbox-ose-additions/Makefile @@ -2,10 +2,9 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.44 -PORTREVISION= 3 +PORTVERSION= 6.1.18 CATEGORIES= emulators -MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ +MASTER_SITES= https://download.virtualbox.com/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX?= -additions DISTNAME= VirtualBox-${PORTVERSION} @@ -15,7 +14,7 @@ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING -ONLY_FOR_ARCHS= amd64 i386 +ONLY_FOR_ARCHS= amd64 USES= compiler:c++11-lang cpe iconv kmod tar:bzip2 USE_RC_SUBR= vboxguest vboxservice @@ -91,12 +90,6 @@ .include -.if ${COMPILER_TYPE} == clang -.if ${COMPILER_FEATURES:Mlibc++} -EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk -.endif -.endif - post-patch: @${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_X11}' >> \ @@ -111,13 +104,10 @@ -e 's| -fno-merge-constants||' \ -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk .endif - @${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|g' \ - ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/display.cpp @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \ - ${WRKSRC}/src/VBox/Additions/common/crOpenGL/load.c \ ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \ ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \ ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \ Index: emulators/virtualbox-ose-additions/distinfo =================================================================== --- emulators/virtualbox-ose-additions/distinfo +++ emulators/virtualbox-ose-additions/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1594821235 -SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e -SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934 +TIMESTAMP = 1613903085 +SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40 +SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486 Index: emulators/virtualbox-ose-kmod-legacy/Makefile =================================================================== --- emulators/virtualbox-ose-kmod-legacy/Makefile +++ emulators/virtualbox-ose-kmod-legacy/Makefile @@ -6,7 +6,7 @@ PORTREVISION= 4 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ -PKGNAMESUFFIX= -kmod +PKGNAMESUFFIX= -kmod-legacy DISTNAME= VirtualBox-${PORTVERSION} MAINTAINER= vbox@FreeBSD.org @@ -21,7 +21,7 @@ CPE_PRODUCT= vm_virtualbox USES= cpe kmod tar:bzip2 -PATCHDIR= ${.CURDIR}/../${PORTNAME}/files +PATCHDIR= ${.CURDIR}/../${PORTNAME}-legacy/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} USE_RC_SUBR= vboxnet ONLY_FOR_ARCHS= i386 amd64 @@ -39,7 +39,7 @@ CONFIGURE_ARGS+= --nofatal --with-gcc="${CC}" --with-g++="${CXX}" CONFLICTS_INSTALL= virtualbox-ose-kmod-devel-* \ - virtualbox-ose-kmod-legacy-* + virtualbox-ose-kmod-* OPTIONS_DEFINE= DEBUG VIMAGE OPTIONS_DEFAULT=VIMAGE Index: emulators/virtualbox-ose-kmod/Makefile =================================================================== --- emulators/virtualbox-ose-kmod/Makefile +++ emulators/virtualbox-ose-kmod/Makefile @@ -2,10 +2,9 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.44 -PORTREVISION= 4 +PORTVERSION= 6.1.18 CATEGORIES= emulators -MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ +MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ PKGNAMESUFFIX= -kmod DISTNAME= VirtualBox-${PORTVERSION} @@ -20,11 +19,11 @@ CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox -USES= cpe kmod tar:bzip2 +USES= cpe compiler:c++14-lang kmod tar:bzip2 PATCHDIR= ${.CURDIR}/../${PORTNAME}/files WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} USE_RC_SUBR= vboxnet -ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS= amd64 HAS_CONFIGURE= yes CONFIGURE_ARGS+= --build-headless @@ -63,7 +62,8 @@ .if ${PORT_OPTIONS:MDEBUG} KMK_FLAGS+= BUILD_TYPE=debug KMK_BUILDTYPE= debug -EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-Config.kmk \ + ${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile MAKE_ARGS+= DEBUG_FLAGS="-O1 -g" .endif @@ -100,9 +100,6 @@ ${MKDIR} ${STAGEDIR}${KMODDIR} .for i in ${VBOX_KMODS} ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko ${STAGEDIR}${KMODDIR} -.if ${PORT_OPTIONS:MDEBUG} - ${INSTALL_KLD} ${VBOX_BIN}/${i}/${i}.ko.${SYMBOLSUFFIX} ${STAGEDIR}${KMODDIR} -.endif .endfor .include Index: emulators/virtualbox-ose-kmod/distinfo =================================================================== --- emulators/virtualbox-ose-kmod/distinfo +++ emulators/virtualbox-ose-kmod/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1594821147 -SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e -SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934 +TIMESTAMP = 1613865409 +SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40 +SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486 Index: emulators/virtualbox-ose-kmod/pkg-plist =================================================================== --- emulators/virtualbox-ose-kmod/pkg-plist +++ emulators/virtualbox-ose-kmod/pkg-plist @@ -1,6 +1,3 @@ /%%KMODDIR%%/vboxdrv.ko -%%DEBUG%%/%%KMODDIR%%/vboxdrv.ko.%%SYMBOLSUFFIX%% /%%KMODDIR%%/vboxnetadp.ko -%%DEBUG%%/%%KMODDIR%%/vboxnetadp.ko.%%SYMBOLSUFFIX%% /%%KMODDIR%%/vboxnetflt.ko -%%DEBUG%%/%%KMODDIR%%/vboxnetflt.ko.%%SYMBOLSUFFIX%% Index: emulators/virtualbox-ose-legacy/Makefile =================================================================== --- emulators/virtualbox-ose-legacy/Makefile +++ emulators/virtualbox-ose-legacy/Makefile @@ -6,6 +6,7 @@ PORTREVISION= 4 CATEGORIES= emulators MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ +PKGNAMESUFFIX?= -legacy DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} EXTRACT_ONLY= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} @@ -23,7 +24,7 @@ LIB_DEPENDS= libpng.so:graphics/png \ libxslt.so:textproc/libxslt \ libcurl.so:ftp/curl -RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod +RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/vboxnet:emulators/virtualbox-ose-kmod-legacy CPE_VENDOR= oracle CPE_PRODUCT= vm_virtualbox @@ -39,7 +40,7 @@ CONFLICTS_INSTALL= virtualbox-ose-additions-* \ virtualbox-ose-devel-[0-9]* \ - virtualbox-ose-legacy-[0-9]* \ + virtualbox-ose-[0-9]* \ virtualbox-ose-lite-[0-9]* LDFLAGS= -lpthread Index: emulators/virtualbox-ose-legacy/files/extrapatch-Config.kmk =================================================================== --- /dev/null +++ emulators/virtualbox-ose-legacy/files/extrapatch-Config.kmk @@ -0,0 +1,27 @@ +--- Config.kmk.orig 2016-07-18 11:50:32 UTC ++++ Config.kmk +@@ -3537,6 +3537,7 @@ ifdef VBOX_WITH_RAW_MODE + TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL) + TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) + TEMPLATE_VBoxRc_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK) ++ TEMPLATE_VBoxRc_CXXFLAGS.freebsd = -fno-builtin + ifeq ($(KBUILD_TARGET),solaris) + TEMPLATE_VBoxRc_LDFLAGS = -r + else +@@ -3677,6 +3678,7 @@ ifeq ($(VBOX_LDR_FMT),elf) + TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL) + TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK) + TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) ++TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -fno-builtin + TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding + TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables + ifeq ($(KBUILD_TARGET),solaris) +@@ -3945,7 +3947,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CM + | xargs -J% objcopy % $(out) + + ## Strip debug info (comment out if debugging or something). +- objcopy --strip-debug $(out) ++# objcopy --strip-debug $(out) + endef + else # x86 + TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld Index: emulators/virtualbox-ose-nox11-legacy/Makefile =================================================================== --- emulators/virtualbox-ose-nox11-legacy/Makefile +++ emulators/virtualbox-ose-nox11-legacy/Makefile @@ -1,10 +1,10 @@ # $FreeBSD$ -PKGNAMESUFFIX= -nox11 +PKGNAMESUFFIX= -nox11-legacy OPTIONS_EXCLUDE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO OPTIONS_EXCLUDE+= QT5 VPX X11 -MASTERDIR= ${.CURDIR}/../virtualbox-ose +MASTERDIR= ${.CURDIR}/../virtualbox-ose-legacy .include "${MASTERDIR}/Makefile" Index: emulators/virtualbox-ose/Makefile =================================================================== --- emulators/virtualbox-ose/Makefile +++ emulators/virtualbox-ose/Makefile @@ -2,10 +2,9 @@ # $FreeBSD$ PORTNAME= virtualbox-ose -PORTVERSION= 5.2.44 -PORTREVISION= 4 +PORTVERSION= 6.1.18 CATEGORIES= emulators -MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/ +MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/ DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} EXTRACT_ONLY= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} @@ -15,7 +14,6 @@ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING -PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild BUILD_DEPENDS= yasm:devel/yasm \ xsltproc:textproc/libxslt \ kmk:devel/kBuild \ @@ -29,7 +27,7 @@ CPE_PRODUCT= vm_virtualbox WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} -ONLY_FOR_ARCHS= i386 amd64 +ONLY_FOR_ARCHS= amd64 USES= compiler:c++14-lang cpe gnome iconv pkgconfig ssl tar:bzip2 USE_GNOME= libidl libxml2 @@ -42,8 +40,6 @@ virtualbox-ose-legacy-[0-9]* \ virtualbox-ose-lite-[0-9]* -LDFLAGS= -lpthread - VBOXUSER?= vboxusers VBOXWSUSER?= vboxusers VBOXGROUP?= vboxusers @@ -57,7 +53,7 @@ VBOX_UTILS= VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \ VBoxSVC VBoxXPCOMIPCD -OPTIONS_DEFINE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO \ +OPTIONS_DEFINE= ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS PULSEAUDIO \ PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11 OPTIONS_DEFAULT= DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11 OPTIONS_SUB= yes @@ -66,6 +62,7 @@ GUESTADDITIONS_DESC= Build with Guest Additions MANUAL_DESC= Build with user manual NLS_DESC= Native language support (requires QT5) +OPUS_DESC= Use libvpx for audio recording (requires VPX) QT5_DESC= Build with QT5 frontend (requires X11) R0LOGGING_DESC= Enable R0 logging (requires DEBUG) UDPTUNNEL_DESC= Build with UDP tunnel support @@ -82,6 +79,9 @@ MANUAL_BUILD_DEPENDS= ${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml MANUAL_CONFIGURE_OFF= --disable-docs NLS_IMPLIES= QT5 +OPUS_CONFIGURE_OFF= --disable-libopus +OPUS_LIB_DEPENDS= libopus.so:audio/opus +OPUS_IMPLIES= VPX PULSEAUDIO_CONFIGURE_OFF= --disable-pulse PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PYTHON_CONFIGURE_OFF= --disable-python @@ -124,6 +124,7 @@ .if ${PORT_OPTIONS:MDEBUG} KMK_BUILDTYPE= debug KMK_FLAGS+= BUILD_TYPE=debug +WITH_DEBUG= yes .else KMK_BUILDTYPE= release .endif @@ -158,7 +159,7 @@ USE_QT+= printsupport widgets x11extras USE_XORG= xcb INSTALLS_ICONS= yes -VBOX_PROGS+= VirtualBox +VBOX_PROGS+= VirtualBox VirtualBoxVM VBOX_UTILS+= VBoxTestOGL VBOX_WITH_QT= 1 .else @@ -174,7 +175,7 @@ .endif .if ${PORT_OPTIONS:MX11} -USES+= sdl +USES+= sdl xorg USE_SDL= sdl USE_XORG+= xorgproto x11 xcursor xext xinerama xmu xt VBOX_PROGS+= VBoxSDL @@ -202,6 +203,19 @@ .include +.if ${CHOSEN_COMPILER_TYPE} == clang +# llvm10 in FreeBSD before r364284 miscompiles virtualbox 6.1 causing errors. +# force llvm11 from ports +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1300109 +BUILD_DEPENDS+= clang11:devel/llvm${VBOX_LLVM_VER} +CC= ${LOCALBASE}/bin/clang${VBOX_LLVM_VER} +CXX= ${LOCALBASE}/bin/clang++${VBOX_LLVM_VER} +VBOX_LLVM_VER?= 11 +.endif +PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk +.endif + .if ${PYTHON_MAJOR_VER} >= 3 PLIST_SUB+= PYTHON_PYCDIR=/__pycache__/ \ PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc @@ -274,19 +288,20 @@ ${WRKSRC}/LocalConfig.kmk @${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \ ${WRKSRC}/LocalConfig.kmk - @${REINPLACE_CMD} -E -e '/soap_socket_errno\(/s/(soap_socket_errno)(\([^)]+\))/\1/' \ - ${WRKSRC}/src/VBox/Main/webservice/vboxweb.cpp .endif +.if empty(PORT_OPTIONS:MX11) + @${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk +.endif +.if ${CHOSEN_COMPILER_TYPE} == clang @${REINPLACE_CMD} -e 's| -finline-limit=8000||' \ - -e 's| -mpreferred-stack-boundary=2||' \ - -e 's|%%PYTHON_VERSION%%|${PYTHON_VERSION}|' \ - ${WRKSRC}/Config.kmk + -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk @${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \ ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk @${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk @${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \ ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \ ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk +.endif @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Config.kmk ${WRKSRC}/configure \ ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \ @@ -329,7 +344,7 @@ ${MKDIR} ${STAGEDIR}${VBOX_DIR} cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \ - "*.fd *.r0 *.rc *.so components" ${STAGEDIR}${VBOX_DIR} + "*.fd *.r0 *.so components" ${STAGEDIR}${VBOX_DIR} .if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE} ${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR} .endif Index: emulators/virtualbox-ose/distinfo =================================================================== --- emulators/virtualbox-ose/distinfo +++ emulators/virtualbox-ose/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1594897148 -SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e -SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934 -SHA256 (VBoxGuestAdditions_5.2.44.iso) = 9883ee443a309f4ffa1d5dee2833f9e35ced598686c36d159f410e5edbac1ca4 -SIZE (VBoxGuestAdditions_5.2.44.iso) = 49829888 +TIMESTAMP = 1613863264 +SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40 +SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486 +SHA256 (VBoxGuestAdditions_6.1.18.iso) = 904432eb331d7ae517afaa4e4304e6492b7947b46ecb8267de7ef792c4921b4c +SIZE (VBoxGuestAdditions_6.1.18.iso) = 61157376 Index: emulators/virtualbox-ose/files/extrapatch-Config.kmk =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/extrapatch-Config.kmk @@ -0,0 +1,27 @@ +--- Config.kmk.orig 2021-01-07 15:31:21 UTC ++++ Config.kmk +@@ -4327,6 +4327,7 @@ ifdef VBOX_WITH_RAW_MODE + TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL) + TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) + TEMPLATE_VBoxRc_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK) ++ TEMPLATE_VBoxRc_CXXFLAGS.freebsd + if $(VBOX_GCC32_VERSION_CC) < 30400 + TEMPLATE_VBoxRc_DEFS += RT_WITHOUT_PRAGMA_ONCE + endif +@@ -4479,6 +4480,7 @@ TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdi + $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions \ + $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \ + -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) ++TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -fno-builtin + TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables -ffreestanding + TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables + TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -ffreestanding +@@ -4914,7 +4916,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS + | xargs -J% objcopy % $(out) + + ## Strip debug info (comment out if debugging or something). +- objcopy --strip-debug $(out) ++# objcopy --strip-debug $(out) + endef + else # x86 + TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld Index: emulators/virtualbox-ose/files/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Additions/x11/VBoxClient/Makefile.kmk.orig 2013-11-29 14:20:43.000000000 -0500 -+++ src/VBox/Additions/x11/VBoxClient/Makefile.kmk 2013-12-16 14:03:08.000000000 -0500 -@@ -50,7 +50,7 @@ - # Xtst - # These are static replacements for gcc-specific parts of libstdc++ - VBoxClient_LIBS += \ -- supc++ \ -+ cxxrt \ - gcc_eh - ifdef VBOX_X11_SEAMLESS_GUEST - VBoxClient_DEFS += SEAMLESS_GUEST DYNAMIC_RESIZE Index: emulators/virtualbox-ose/files/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk @@ -0,0 +1,11 @@ +--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2013-11-29 14:23:32.000000000 -0500 ++++ src/VBox/Devices/PC/ipxe/Makefile.kmk 2013-12-13 15:06:45.000000000 -0500 +@@ -35,7 +35,7 @@ + iPxeBiosBin_CLEAN = \ + $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \ + +-if1of ($(KBUILD_TARGET), darwin os2 solaris win) ++if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win) + $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@) + $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@) + $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@ Index: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp.orig 2017-01-17 07:26:50 UTC -+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp -@@ -143,7 +143,7 @@ void UIDownloaderAdditions::handleVerifi - { - const QString strFileName = strRecord.section(" *", 1); - const QString strDownloadedSumm = strRecord.section(" *", 0, 0); -- if (strFileName == source().fileName()) -+ if (strFileName == QFileInfo(source().toString()).fileName()) - { - /* Calc the SHA-256 on the bytes, creating a string: */ - uint8_t abHash[RTSHA256_HASH_SIZE]; Index: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp.orig 2017-01-17 07:26:50 UTC -+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp -@@ -127,7 +127,7 @@ void UIDownloaderExtensionPack::handleVe - { - const QString strFileName = strRecord.section(" *", 1); - const QString strDownloadedSumm = strRecord.section(" *", 0, 0); -- if (strFileName == source().fileName()) -+ if (strFileName == QFileInfo(source().toString()).fileName()) - { - /* Calc the SHA-256 on the bytes, creating a string: */ - uint8_t abHash[RTSHA256_HASH_SIZE]; Index: emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp =================================================================== --- emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp.orig 2017-03-08 17:19:57 UTC -+++ src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp -@@ -243,6 +243,6 @@ QString UIGlobalSettingsNetworkDetailsHo - address.prepend(QString::number(uPart)); - uAddress = uAddress >> 8; - } -- return address.join('.'); -+ return address.join("."); - } - Index: emulators/virtualbox-ose/files/patch-Config.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-Config.kmk +++ emulators/virtualbox-ose/files/patch-Config.kmk @@ -1,6 +1,6 @@ ---- Config.kmk.orig 2020-07-09 16:49:46 UTC +--- Config.kmk.orig 2021-01-07 15:31:21 UTC +++ Config.kmk -@@ -445,11 +445,11 @@ ifn1of ($(KBUILD_TARGET), win darwin) +@@ -469,11 +469,11 @@ ifn1of ($(KBUILD_TARGET), win darwin) # Enable OSS audio support. VBOX_WITH_AUDIO_OSS = 1 endif @@ -14,9 +14,9 @@ # Enable PulseAudio audio support. VBOX_WITH_AUDIO_PULSE = 1 endif -@@ -464,11 +464,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1 - # Enable PCI passthrough support. - VBOX_WITH_PCI_PASSTHROUGH = 1 +@@ -489,11 +489,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1 + # (disabled with 6.1, since it's not complete/useful enough) + VBOX_WITH_PCI_PASSTHROUGH = # Enable statically linked dbus support. -if1of ($(KBUILD_TARGET), linux solaris) +if1of ($(KBUILD_TARGET), freebsd linux solaris) @@ -28,16 +28,25 @@ VBOX_WITH_PAM = 1 endif # Enable internal networking. -@@ -664,7 +664,7 @@ VBOX_WITH_TESTCASES = 1 - VBOX_WITH_VDITOOL = - # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled - VBOX_WITH_VBOX_IMG = --if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) -+if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 freebsd.x86 freebsd.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) - # Enables the video capturing support. - VBOX_WITH_VIDEOREC = 1 - # Enable VPX (VP8 / VP9 codec), used for video capturing. -@@ -992,10 +992,6 @@ ifeq ($(KBUILD_TARGET),darwin) +@@ -501,7 +501,7 @@ VBOX_WITH_INTERNAL_NETWORKING = 1 + # Enable vmsvga (svga2) graphics device variant, 2D part + VBOX_WITH_VMSVGA = 1 + # Enable vmsvga (svga2) graphics device variant, 3D part +-if1of ($(KBUILD_TARGET), darwin linux win) ++if1of ($(KBUILD_TARGET), darwin freebsd linux win) + VBOX_WITH_VMSVGA3D = 1 + endif + # Enable the generic 3D settings support if at least one 3D capable solution is enabled +@@ -647,7 +647,7 @@ VBOX_WITH_MAIN_USB_ID_DATABASE = 1 + #endif + # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems + # caused by our XPCOM library polluting the symbol namespace for system libs. +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1 + endif + # The webservices api. +@@ -1064,10 +1064,6 @@ ifeq ($(KBUILD_TARGET),darwin) VBOX_WITH_VBOXSDL= endif @@ -48,7 +57,7 @@ ifeq ($(KBUILD_TARGET),haiku) # Don't bother with SDL ttf for now. VBOX_WITH_SECURELABEL= -@@ -1155,7 +1151,7 @@ ifdef VBOX_OSE +@@ -1228,7 +1224,7 @@ ifdef VBOX_OSE VBOX_WITH_KCHMVIEWER= VBOX_WITH_PLUGIN_CRYPT= VBOX_WITH_DRAG_AND_DROP_PROMISES= @@ -57,93 +66,24 @@ VBOX_WITH_DOCS= VBOX_WITH_DOCS_PACKING= endif -@@ -1176,14 +1172,14 @@ ifdef VBOX_OSE - ifn1of ($(KBUILD_TARGET), darwin linux solaris win) - VBOX_WITH_INSTALLER= - endif -- if1of ($(KBUILD_TARGET), win) -+ # if1of ($(KBUILD_TARGET), win) - # Undefine codec libraries which are not needed. - VBOX_WITH_LIBVPX= - VBOX_WITH_LIBOPUS= - # Disable video recording (with audio support). - VBOX_WITH_VIDEOREC= - VBOX_WITH_AUDIO_VIDEOREC= -- endif -+ # endif - # branding - VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html - VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf -@@ -1810,6 +1806,7 @@ ifndef VBOX_BLD_PYTHON - else - VBOX_BLD_PYTHON := $(firstword $(which python2.7$(HOSTSUFF_EXE)) $(which python2.6$(HOSTSUFF_EXE)) \ - $(which python$(HOSTSUFF_EXE)) $(which python3$(HOSTSUFF_EXE)) \ -+ $(which %%PYTHON_VERSION%%) \ - python-not-found) - endif - endif -@@ -2550,6 +2547,10 @@ ifeq ($(KBUILD_HOST),win) ## @todo can drop this now, - # This isn't important (yet) on windows, so cook the result until - # cygwin is feeling better. - VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 3), $(int-mul 100, 3), 3) -+else ifeq($(KBUILD_HOST,freebsd)) -+ # At a minimum, we'll be building with GCC 4.2 on FreeBSD. LLVM will always -+ # pose as GCC 4.2 anyways, so this seems safe. -+ VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 4), $(int-mul 100, 2), 0) - else - # This is kind of bad, the returned string needs to be re-evaluated before use. - # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)). -@@ -4218,6 +4219,7 @@ ifdef VBOX_WITH_RAW_MODE - TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL) - TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) - TEMPLATE_VBoxRc_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK) -+ TEMPLATE_VBoxRc_CXXFLAGS.freebsd = -fno-builtin - ifeq ($(KBUILD_TARGET),solaris) - TEMPLATE_VBoxRc_LDFLAGS = -r - else -@@ -4359,6 +4361,7 @@ ifeq ($(VBOX_LDR_FMT),elf) - TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL) - TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK) - TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK) -+TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -fno-builtin - TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding - TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables - ifeq ($(KBUILD_TARGET),solaris) -@@ -4683,13 +4686,13 @@ TEMPLATE_VBOXR0DRV_CFLAGS = \ - -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ - $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ - -nostdinc -std=c99 --TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -+TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 - TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \ - -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ - -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef - TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \ - $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ -- -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ -+ -O2 -fno-builtin -fno-strict-aliasing -fno-common -finline-limit=8000 \ - $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ - -nostdinc - TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) -@@ -4716,7 +4719,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS - | xargs -J% objcopy % $(out) - - ## Strip debug info (comment out if debugging or something). -- objcopy --strip-debug $(out) -+# objcopy --strip-debug $(out) - endef - else # x86 - TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld -@@ -4730,7 +4733,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS +@@ -4928,7 +4924,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS | xargs -J% objcopy % $(outbase).kld # Link the final .ko (a shared object). - ld $(flags) -Bshareable -o $(out) $(outbase).kld -+ ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld ++ ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld endef endif # x86 -@@ -5016,10 +5019,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH += \ +@@ -5205,6 +5201,7 @@ TEMPLATE_VBOXR3EXE_LDFLAGS.x86 = -m32 + TEMPLATE_VBOXR3EXE_LDFLAGS.amd64 = -m64 + TEMPLATE_VBOXR3EXE_LDFLAGS.sparc32 = -m32 + TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64 = -m64 ++TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBOXR3EXE_LDFLAGS.solaris = -Wl,-z,ignore # same as VBOX_LD_as_needed + TEMPLATE_VBOXR3EXE_LDFLAGS.debug = $(VBOX_GCC_SANITIZER_FLAGS) $(VBOX_GCC_SANITIZER_LDFLAGS) +@@ -5238,10 +5235,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH += \ TEMPLATE_VBOXR3EXE_CFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_CXXFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_LDFLAGS += -fno-pic @@ -163,16 +103,48 @@ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -5310,7 +5321,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! - TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain - TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86 = $(NOT_SUCH_VARIABLE) - TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64 = $(NOT_SUCH_VARIABLE) --else ifn1of ($(KBUILD_TARGET), os2 solaris) -+else ifn1of ($(KBUILD_TARGET), freebsd os2 solaris) +@@ -5273,6 +5278,7 @@ TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VB + TEMPLATE_VBOXR3EXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' + endif + ifdef VBOX_WITH_ORIGIN ++ TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) + TEMPLATE_VBOXR3EXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) + endif + endif +@@ -5412,7 +5418,7 @@ ifeq ($(KBUILD_TARGET),win) + $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \ + $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \ + $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/oldnames.lib +-else ifn1of ($(KBUILD_TARGET), darwin linux solaris) ++else ifn1of ($(KBUILD_TARGET), darwin freebsd linux solaris) + # The gcc guys sans darwin, linux and solaris (don't depend on statically compiled system libs there) + TEMPLATE_VBOXR3STATIC_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -static + TEMPLATE_VBOXR3STATIC_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -static +@@ -5557,6 +5563,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT! + else ifn1of ($(KBUILD_TARGET), os2 solaris) # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH) TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS)) ++ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd)) TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux)) -@@ -5837,10 +5848,18 @@ TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTI + endif + +@@ -5584,6 +5591,7 @@ TEMPLATE_VBoxR3HardenedTstDll_INST = $(INST_TESTCASE) + TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.win = $(TEMPLATE_VBoxR3TstDll_LDFLAGS.win) -IntegrityCheck + ifn1of ($(KBUILD_TARGET), win os2) + TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS)) ++ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd)) + TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux)) + endif + +@@ -5606,6 +5614,7 @@ ifndef VBOX_WITH_HARDENING + TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' + endif + ifdef VBOX_WITH_ORIGIN ++ TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) + TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) + endif + endif +@@ -6132,10 +6141,19 @@ TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTI else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) network stdc++ supc++ @@ -180,6 +152,7 @@ + else ifeq ($(KBUILD_TARGET),freebsd) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) ++TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) +TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXMAINEXE_INCS += \ + /usr/local/include @@ -192,10 +165,19 @@ /usr/include \ /usr/X11R6/include \ /usr/local/include -@@ -6382,13 +6401,10 @@ ifdef VBOX_WITH_QTGUI +@@ -6167,6 +6185,7 @@ TEMPLATE_VBOXMAINEXE_LDFLAGS += '$(VBOX_GCC + TEMPLATE_VBOXMAINEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' + endif + ifdef VBOX_WITH_ORIGIN ++TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT) + TEMPLATE_VBOXMAINEXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) + endif + +@@ -6735,13 +6754,11 @@ ifdef VBOX_WITH_QTGUI TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ $(VBOX_LIBPATH_X11) ifeq ($(KBUILD_TARGET),freebsd) ++ TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) + TEMPLATE_VBOXQTGUIEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext TEMPLATE_VBOXQTGUIEXE_INCS += \ - /usr/include \ @@ -207,33 +189,46 @@ /usr/local/lib endif ifeq ($(KBUILD_TARGET),solaris) -@@ -6617,12 +6633,8 @@ TEMPLATE_VBoxBldProg_LIBPATH += \ +@@ -6988,10 +7005,17 @@ TEMPLATE_VBoxBldProg_TOOL = GXX3 + TEMPLATE_VBoxBldProg_LIBS = network iconv + TEMPLATE_VBoxBldProg_LIBPATH += \ + /boot/common/lib +- else if1of ($(KBUILD_HOST), freebsd openbsd) ++ else ifeq ($(KBUILD_HOST),freebsd) TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_LIBS = pthread TEMPLATE_VBoxBldProg_INCS += \ -- /usr/include \ -- /usr/X11R6/include \ ++ /usr/local/include ++TEMPLATE_VBoxBldProg_LIBPATH += \ ++ /usr/local/lib ++ else ifeq ($(KBUILD_HOST),openbsd) ++TEMPLATE_VBoxBldProg_TOOL = GXX3 ++TEMPLATE_VBoxBldProg_LIBS = pthread ++TEMPLATE_VBoxBldProg_INCS += \ + /usr/include \ + /usr/X11R6/include \ /usr/local/include - TEMPLATE_VBoxBldProg_LIBPATH += \ -- /usr/lib \ -- /usr/X11R6/lib \ - /usr/local/lib - else ifeq ($(KBUILD_HOST),netbsd) - TEMPLATE_VBoxBldProg_TOOL = GXX3 -@@ -7008,7 +7020,7 @@ +@@ -7115,6 +7139,7 @@ else # the gcc guys + # Do not inherit sanitizer flags from VBOXR3EXE in guest executables. Deal with them separately. + TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.debug = $(NO_SUCH_VARIABLE) + TEMPLATE_VBOXGUESTR3EXE_CFLAGS.debug = $(NO_SUCH_VARIABLE) ++ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd)) + TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux)) + TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.debug = $(NO_SUCH_VARIABLE) + TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS)) +@@ -7138,6 +7163,7 @@ TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux = \ + $(VBOX_GCC_fno-stack-protector) + TEMPLATE_VBOXGUESTR3EXE_CFLAGS.linux = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux) + # The GNU_HASH ELF tag is not supported by older systems. ++TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd += $(VBOX_LD_hash_style_sysv) + TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux += $(VBOX_LD_hash_style_sysv) + # - TEMPLATE_VBOXCROGLR3HOSTDLL = VBox OpenGL Host DLLs - TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS := $(if-expr "$(KBUILD_TARGET)" == "win",VBOXR3,VBOXR3NP) --TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY = prepending -+TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY = appending - TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS = VBOX_WITH_HGCM UNPACKS - TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.win = _WIN32_WINNT=0x0500 WINDOWS=1 - TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.linux = Linux=1 _GNU_SOURCE -@@ -7023,6 +7035,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \ - -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ - -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) - TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed -+TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.freebsd = -Wl,--no-as-needed - TEMPLATE_VBOXCROGLR3HOSTDLL_BLDDIRS = $(VBOX_PATH_CROGL_GENFILES)/ - ifeq ($(KBUILD_TARGET),darwin) - TEMPLATE_VBOXCROGLR3HOSTDLL_CFLAGS = $(TEMPLATE_VBOXR3NP_CFLAGS) -Wno-deprecated-declarations +@@ -7345,6 +7371,7 @@ TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE) = + TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) + # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers. ++TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv)) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) + TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS = -r Index: emulators/virtualbox-ose/files/patch-configure =================================================================== --- emulators/virtualbox-ose/files/patch-configure +++ emulators/virtualbox-ose/files/patch-configure @@ -1,6 +1,6 @@ ---- configure.orig 2020-05-13 19:36:41 UTC +--- configure.orig 2021-01-07 15:31:21 UTC +++ configure -@@ -138,10 +138,14 @@ CXX_FLAGS="" +@@ -140,10 +140,14 @@ CXX_FLAGS="" if [ "$OS" = "freebsd" ]; then INCCURL="-I/usr/local/include" LIBCURL="-L/usr/local/lib -lcurl" @@ -15,17 +15,7 @@ else INCCURL="" LIBCURL="-lcurl" -@@ -441,6 +445,9 @@ check_gcc() - elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then - log_success "found version $cc_ver" - # gcc-4.0 is allowed for Darwin only -+ elif [ $cc_maj -eq 4 -a $cc_min -eq 2 -a "$OS" = "freebsd" ]; then -+ log_success "found version $cc_ver" -+ # gcc-4.2 is allowed for FreeBSD only - elif [ $cc_maj -lt 4 \ - -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \ - -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS" = "darwin" \) ]; then -@@ -1208,7 +1215,7 @@ extern "C" int main(void) +@@ -1258,7 +1262,7 @@ extern "C" int main(void) #endif } EOF @@ -34,17 +24,18 @@ test_execute fi } -@@ -1508,8 +1515,7 @@ EOF +@@ -1563,9 +1567,7 @@ EOF if [ $? -eq 0 ]; then echo "(Qt5 from pkg-config)" >> $LOG FLGQT5=`pkg-config Qt5Core --cflags` - # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk) - [ $cc_maj -eq 4 -a $cc_min -eq 8 ] && FLGQT5="$FLGQT5 -std=c++11" -+ FLGQT5="$FLGQT5 -std=c++11" - INCQT5=`strip_I "$FLGQT5"` +- INCQT5=`strip_I "$FLGQT5"` ++ FLGQT5="$FLGQT5 -std=c++11" INCQT5=`strip_I "$FLGQT5"` LIBDIR5=`pkg-config Qt5Core --variable=libdir` LIBQT5=`pkg-config Qt5Core --libs` -@@ -1648,7 +1654,7 @@ check_libopus() + LIBQT5="-L$LIBDIR5 $LIBQT5" +@@ -1703,7 +1705,7 @@ check_libopus() fi cat > $ODIR.tmp_src.cc << EOF #include @@ -53,7 +44,7 @@ extern "C" int main(void) { OpusEncoder *test; -@@ -1980,8 +1986,8 @@ EOF +@@ -2035,8 +2037,8 @@ EOF echo "compiling the following source file:" >> $LOG cat $ODIR.tmp_src.cc >> $LOG echo "using the following command line:" >> $LOG @@ -64,7 +55,7 @@ if [ $? -eq 0 ]; then found=1 break -@@ -2453,7 +2459,7 @@ for option in "$@"; do +@@ -2512,7 +2514,7 @@ for option in "$@"; do --with-openssl-dir=*) OPENSSLDIR=`echo $option | cut -d'=' -f2` INCCRYPTO="-I${OPENSSLDIR}/include" @@ -73,38 +64,39 @@ ;; --with-ow-dir=*) WATCOM=`echo $option | cut -d'=' -f2` -@@ -2767,7 +2773,7 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then - check_ssl - check_curl - [ $WITH_LIBVPX -eq 1 ] && check_vpx -- check_libopus -+ [ $OSE -eq 0 -a "$OS" != "win" ] && check_libopus - [ "$OS" != "darwin" ] && check_z - [ "$OS" != "darwin" ] && check_png - [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam -@@ -2788,13 +2794,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then +@@ -2856,14 +2858,23 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then [ $WITH_PYTHON -eq 1 ] && check_python [ $WITH_JAVA -eq 1 ] && check_java - # PulseAudio - if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then +- if [ $WITH_PULSE -eq 1 ]; then +- check_pulse +- elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio. +- cnf_append "VBOX_WITH_AUDIO_PULSE" "" +- elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio. +- cnf_append "VBOX_WITH_AUDIO_PULSE" "1" +- fi ++ if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then + if [ $WITH_ALSA -eq 1 ]; then + check_alsa + else + cnf_append "VBOX_WITH_AUDIO_ALSA" "" + fi - if [ $WITH_PULSE -eq 1 ]; then - check_pulse - elif [ $WITH_PULSE -eq 0 ]; then - cnf_append "VBOX_WITH_AUDIO_PULSE" "" - fi ++ if [ $WITH_PULSE -eq 1 ]; then ++ check_pulse ++ elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio. ++ cnf_append "VBOX_WITH_AUDIO_PULSE" "" ++ elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio. ++ cnf_append "VBOX_WITH_AUDIO_PULSE" "1" ++ fi + if [ $WITH_DBUS -eq 0 ]; then + cnf_append "VBOX_WITH_DBUS" "" + fi - fi ++ fi fi -@@ -2810,14 +2823,6 @@ if [ "$OS" = "linux" ]; then + # Linux-specific +@@ -2878,14 +2889,6 @@ if [ "$OS" = "linux" ]; then cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1" fi if [ $ONLY_ADDITIONS -eq 0 ]; then Index: emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h =================================================================== --- emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h +++ /dev/null @@ -1,11 +0,0 @@ ---- include/VBox/vmm/cpumctx.h.orig 2020-05-13 19:36:46 UTC -+++ include/VBox/vmm/cpumctx.h -@@ -88,7 +88,7 @@ AssertCompileSize(CPUMSELREG, 24); - # define CPUMSELREG_ARE_HIDDEN_PARTS_VALID(a_pVCpu, a_pSelReg) \ - ( ((a_pSelReg)->fFlags & CPUMSELREG_FLAGS_VALID) \ - && ( (a_pSelReg)->ValidSel == (a_pSelReg)->Sel \ -- || ( (a_pVCpu) /*!= NULL*/ \ -+ || ( ((a_pVCpu) != NULL) \ - && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_OFF_RPL) \ - && ((a_pSelReg)->Sel & X86_SEL_RPL) == 1 \ - && ((a_pSelReg)->ValidSel & X86_SEL_RPL) == 0 \ Index: emulators/virtualbox-ose/files/patch-include-iprt-x86.h =================================================================== --- emulators/virtualbox-ose/files/patch-include-iprt-x86.h +++ emulators/virtualbox-ose/files/patch-include-iprt-x86.h @@ -1,6 +1,6 @@ ---- include/iprt/x86.h.orig 2020-05-13 19:36:52 UTC +--- include/iprt/x86.h.orig 2021-01-07 15:31:34 UTC +++ include/iprt/x86.h -@@ -35,6 +35,16 @@ +@@ -38,6 +38,16 @@ # pragma D depends_on library vbox-types.d #endif Index: emulators/virtualbox-ose/files/patch-include_VBox_VBoxGL2D.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_VBox_VBoxGL2D.h +++ /dev/null @@ -1,16 +0,0 @@ -Fix build with Qt5 5.13, which defined GLsizeiptr already. - -Obtained from: - https://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg436220.html - ---- include/VBox/VBoxGL2D.h.orig 2019-09-29 14:31:16 UTC -+++ include/VBox/VBoxGL2D.h -@@ -107,7 +107,7 @@ typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM3I)(GLint - typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); - - /* GL_ARB_pixel_buffer_object*/ --#ifndef Q_WS_MAC -+#if 0 - /* apears to be defined on mac */ - typedef ptrdiff_t GLsizeiptr; - #endif Index: emulators/virtualbox-ose/files/patch-include_VBox_com_array.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_VBox_com_array.h +++ emulators/virtualbox-ose/files/patch-include_VBox_com_array.h @@ -1,6 +1,6 @@ ---- include/VBox/com/array.h.orig 2019-04-12 15:47:42 UTC +--- include/VBox/com/array.h.orig 2021-01-07 15:31:25 UTC +++ include/VBox/com/array.h -@@ -168,7 +168,7 @@ +@@ -171,7 +171,7 @@ #include "VBox/com/defs.h" @@ -9,28 +9,28 @@ /** @def VBOX_WITH_TYPE_TRAITS * Type traits are a C++ 11 feature, so not available everywhere (yet). * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer. -@@ -940,12 +940,12 @@ class SafeArray : public Traits (public) - */ - T &operator[] (size_t aIdx) +@@ -960,12 +960,12 @@ class SafeArray : public Traits (public) { -- AssertReturn(m.arr != NULL, *((T *)NULL)); -- AssertReturn(aIdx < size(), *((T *)NULL)); + /** @todo r=klaus should do this as a AssertCompile, but cannot find a way which works. */ + Assert(sizeof(T) <= sizeof(Zeroes)); +- AssertReturn(m.arr != NULL, *(T *)&Zeroes[0]); +- AssertReturn(aIdx < size(), *(T *)&Zeroes[0]); + AssertReturn(m.arr != NULL, *((T *)1)); + AssertReturn(aIdx < size(), *((T *)1)); #ifdef VBOX_WITH_XPCOM return m.arr[aIdx]; #else -- AssertReturn(m.raw != NULL, *((T *)NULL)); +- AssertReturn(m.raw != NULL, *(T *)&Zeroes[0]); + AssertReturn(m.raw != NULL, *((T *)1)); return m.raw[aIdx]; #endif } -@@ -960,7 +960,7 @@ class SafeArray : public Traits (public) +@@ -980,7 +980,7 @@ class SafeArray : public Traits (public) #ifdef VBOX_WITH_XPCOM return m.arr[aIdx]; #else -- AssertReturn(m.raw != NULL, *((T *)NULL)); -+ AssertReturn(m.raw != NULL, *((T *)1)); +- AssertReturn(m.raw != NULL, *(const T *)&Zeroes[0]); ++ AssertReturn(m.raw != NULL, *((T *)1)); return m.raw[aIdx]; #endif } Index: emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h +++ /dev/null @@ -1,15 +0,0 @@ ---- include/iprt/assertcompile.h.orig 2018-01-15 14:49:42 UTC -+++ include/iprt/assertcompile.h -@@ -104,7 +104,11 @@ RT_C_DECLS_END - * @param expr Expression which should be true. - */ - #ifdef RTASSERT_HAVE_STATIC_ASSERT --# define AssertCompile(expr) static_assert(!!(expr), #expr) -+# ifdef __cplusplus -+# define AssertCompile(expr) static_assert(!!(expr), #expr) -+# else -+# define AssertCompile(expr) _Static_assert(!!(expr), #expr) -+# endif - #else - # define AssertCompile(expr) AssertCompileNS(expr) - #endif Index: emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h +++ /dev/null @@ -1,39 +0,0 @@ ---- include/iprt/cdefs.h.orig 2018-10-15 14:24:52 UTC -+++ include/iprt/cdefs.h -@@ -2611,28 +2611,28 @@ - - /** @def RT_BYTE1 - * Gets the first byte of something. */ --#define RT_BYTE1(a) ( (a) & 0xff ) -+#define RT_BYTE1(a) ( (uint8_t)((a) & 0xff) ) - /** @def RT_BYTE2 - * Gets the second byte of something. */ --#define RT_BYTE2(a) ( ((a) >> 8) & 0xff ) -+#define RT_BYTE2(a) ( (uint8_t)(((a) >> 8) & 0xff) ) - /** @def RT_BYTE3 - * Gets the second byte of something. */ --#define RT_BYTE3(a) ( ((a) >> 16) & 0xff ) -+#define RT_BYTE3(a) ( (uint8_t)(((a) >> 16) & 0xff) ) - /** @def RT_BYTE4 - * Gets the fourth byte of something. */ --#define RT_BYTE4(a) ( ((a) >> 24) & 0xff ) -+#define RT_BYTE4(a) ( (uint8_t)(((a) >> 24) & 0xff) ) - /** @def RT_BYTE5 - * Gets the fifth byte of something. */ --#define RT_BYTE5(a) ( ((a) >> 32) & 0xff ) -+#define RT_BYTE5(a) ( (uint8_t)(((a) >> 32) & 0xff) ) - /** @def RT_BYTE6 - * Gets the sixth byte of something. */ --#define RT_BYTE6(a) ( ((a) >> 40) & 0xff ) -+#define RT_BYTE6(a) ( (uint8_t)(((a) >> 40) & 0xff) ) - /** @def RT_BYTE7 - * Gets the seventh byte of something. */ --#define RT_BYTE7(a) ( ((a) >> 48) & 0xff ) -+#define RT_BYTE7(a) ( (uint8_t)(((a) >> 48) & 0xff) ) - /** @def RT_BYTE8 - * Gets the eight byte of something. */ --#define RT_BYTE8(a) ( ((a) >> 56) & 0xff ) -+#define RT_BYTE8(a) ( (uint8_t)(((a) >> 56) & 0xff) ) - - - /** @def RT_LODWORD Index: emulators/virtualbox-ose/files/patch-include_iprt_string.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_string.h +++ emulators/virtualbox-ose/files/patch-include_iprt_string.h @@ -1,6 +1,6 @@ ---- include/iprt/string.h.orig 2018-06-29 13:08:03 UTC +--- include/iprt/string.h.orig 2021-01-07 15:31:33 UTC +++ include/iprt/string.h -@@ -43,6 +43,11 @@ +@@ -46,6 +46,11 @@ #elif defined(RT_OS_FREEBSD) && defined(_KERNEL) RT_C_DECLS_BEGIN # include Index: emulators/virtualbox-ose/files/patch-include_iprt_types.h =================================================================== --- emulators/virtualbox-ose/files/patch-include_iprt_types.h +++ /dev/null @@ -1,26 +0,0 @@ ---- include/iprt/types.h.orig 2018-05-09 16:32:07 UTC -+++ include/iprt/types.h -@@ -56,22 +56,9 @@ RT_C_DECLS_END - # include - - # elif defined(RT_OS_FREEBSD) && defined(_KERNEL) -- /* -- * Kludge for the FreeBSD kernel: -- * stddef.h and sys/types.h have slightly different offsetof definitions -- * when compiling in kernel mode. This is just to make GCC shut up. -- */ --# ifndef _STDDEF_H_ --# undef offsetof --# endif -+ - # include --# ifndef _SYS_TYPES_H_ --# undef offsetof --# endif - # include --# ifndef offsetof --# error "offsetof is not defined!" --# endif - - # elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86) - /* Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c @@ -1,6 +1,22 @@ ---- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2020-05-13 19:37:01 UTC +--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig 2019-01-25 18:12:28 UTC +++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c -@@ -102,8 +102,6 @@ struct VBoxGuestDeviceState +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -61,6 +62,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -102,8 +104,6 @@ struct VBoxGuestDeviceState struct resource *pIrqRes; /** Pointer to the IRQ handler. */ void *pfnIrqHandler; @@ -9,7 +25,7 @@ }; -@@ -113,8 +111,7 @@ struct VBoxGuestDeviceState +@@ -113,8 +113,7 @@ struct VBoxGuestDeviceState /* * Character device file handlers. */ @@ -19,7 +35,7 @@ static d_ioctl_t vgdrvFreeBSDIOCtl; static int vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd); static d_write_t vgdrvFreeBSDWrite; -@@ -145,8 +142,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = +@@ -145,8 +144,7 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE | D_NEEDMINOR, @@ -29,7 +45,7 @@ .d_ioctl = vgdrvFreeBSDIOCtl, .d_read = vgdrvFreeBSDRead, .d_write = vgdrvFreeBSDWrite, -@@ -154,81 +150,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = +@@ -154,81 +152,28 @@ static struct cdevsw g_vgdrvFreeBSDChrDevSW = .d_name = "vboxguest" }; @@ -118,7 +134,7 @@ { int rc; PVBOXGUESTSESSION pSession; -@@ -236,25 +179,18 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp +@@ -240,12 +185,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp LogFlow(("vgdrvFreeBSDOpen:\n")); /* @@ -130,7 +146,9 @@ - /* * Create a new session. */ - rc = VGDrvCommonCreateUserSession(&g_DevExt, &pSession); + fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN; +@@ -262,14 +201,13 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp + rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession); if (RT_SUCCESS(rc)) { - if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42)) @@ -150,7 +168,7 @@ } LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc)); -@@ -262,33 +198,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp +@@ -277,33 +215,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp } /** @@ -184,7 +202,7 @@ * I/O control request. * * @returns depends... -@@ -301,8 +210,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF +@@ -316,8 +227,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) { PVBOXGUESTSESSION pSession; @@ -198,7 +216,7 @@ /* * Deal with the fast ioctl path first. */ -@@ -497,12 +410,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u +@@ -512,12 +427,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td) { @@ -216,7 +234,7 @@ Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev))); return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); } -@@ -543,11 +458,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice) +@@ -558,11 +475,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice) /* * Reverse what we did in vgdrvFreeBSDAttach. */ @@ -229,9 +247,9 @@ vgdrvFreeBSDRemoveIRQ(pDevice, pState); if (pState->pVMMDevMemRes) -@@ -698,18 +610,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice) - if (RT_SUCCESS(rc)) - { +@@ -727,18 +641,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice) + VGDrvCommonProcessOptionsFromHost(&g_DevExt); + /* - * Configure device cloning. + * Configure device. Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile @@ -1,5 +1,14 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2020-05-13 19:37:01 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig 2019-04-16 10:09:09 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile +@@ -25,7 +25,7 @@ + # + KMOD = vboxguest + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_GUEST -DIN_GUEST_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBGL_VBOXGUEST -DVBOX_WITH_HGCM -DVBOX_WITH_64_BITS_GUESTS + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 @@ -80,6 +80,7 @@ SRCS += \ handletable.c \ handletablectx.c \ @@ -8,7 +17,7 @@ thread.c .PATH: ${.CURDIR}/common/string -@@ -139,6 +140,7 @@ SRCS += \ +@@ -147,6 +148,7 @@ SRCS += \ .PATH: ${.CURDIR}/r0drv SRCS += \ Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest @@ -1,6 +1,14 @@ ---- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2020-05-13 19:37:01 UTC +--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig 2019-01-25 18:12:28 UTC +++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest -@@ -109,6 +109,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -63,6 +63,7 @@ FILES_VBOXGUEST_NOBIN=" \ + ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \ + ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \ + ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \ ++ ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ + ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ + ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ + ${PATH_ROOT}/include/iprt/crc.h=>include/iprt/crc.h \ +@@ -111,6 +112,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ @@ -8,7 +16,7 @@ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \ -@@ -171,6 +172,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -181,6 +183,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \ @@ -16,7 +24,7 @@ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \ -@@ -197,6 +199,7 @@ FILES_VBOXGUEST_NOBIN=" \ +@@ -207,6 +210,7 @@ FILES_VBOXGUEST_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \ Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py +++ /dev/null @@ -1,98 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig 2020-06-26 09:52:40 UTC -+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py -@@ -0,0 +1,95 @@ -+# Copyright (c) 2001, Stanford University -+# All rights reserved. -+# -+# See the file LICENSE.txt for information on redistributing this software. -+ -+ -+import sys -+ -+import apiutil -+ -+ -+def GenerateEntrypoints(): -+ -+ #apiutil.CopyrightC() -+ -+ # Get sorted list of dispatched functions. -+ # The order is very important - it must match cr_opcodes.h -+ # and spu_dispatch_table.h -+ print '%include "iprt/asmdefs.mac"' -+ print "" -+ print "%ifdef RT_ARCH_AMD64" -+ print "extern glim" -+ print "%else ; X86" -+ print "extern glim" -+ print "%endif" -+ print "" -+ -+ keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") -+ -+ for index in range(len(keys)): -+ func_name = keys[index] -+ if apiutil.Category(func_name) == "Chromium": -+ continue -+ if apiutil.Category(func_name) == "VBox": -+ continue -+ -+ print "BEGINPROC_EXPORTED gl%s" % func_name -+ print "%ifdef RT_ARCH_AMD64" -+ print "\tmov \trax, qword glim+%d" % (8*index) -+ print "\tjmp \t[rax]" -+ print "%else ; X86" -+ print "\tmov \teax, dword glim+%d" % (4*index) -+ print "\tjmp \t[eax]" -+ print "%endif" -+ print "ENDPROC gl%s" % func_name -+ print "" -+ -+ -+ print ';' -+ print '; Aliases' -+ print ';' -+ -+ # Now loop over all the functions and take care of any aliases -+ allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt") -+ for func_name in allkeys: -+ if "omit" in apiutil.ChromiumProps(func_name): -+ continue -+ -+ if func_name in keys: -+ # we already processed this function earlier -+ continue -+ -+ # alias is the function we're aliasing -+ alias = apiutil.Alias(func_name) -+ if alias: -+ # this dict lookup should never fail (raise an exception)! -+ index = keys.index(alias) -+ print "BEGINPROC_EXPORTED gl%s" % func_name -+ print "%ifdef RT_ARCH_AMD64" -+ print "\tmov \trax, qword glim+%d" % (8*index) -+ print "\tjmp \t[rax]" -+ print "%else ; X86" -+ print "\tmov \teax, dword glim+%d" % (4*index) -+ print "\tjmp \t[eax]" -+ print "%endif" -+ print "ENDPROC gl%s" % func_name -+ print "" -+ -+ -+ print ';' -+ print '; No-op stubs' -+ print ';' -+ -+ # Now generate no-op stub functions -+ for func_name in allkeys: -+ if "stub" in apiutil.ChromiumProps(func_name): -+ print "BEGINPROC_EXPORTED gl%s" % func_name -+ print "\tleave" -+ print "\tret" -+ print "ENDPROC gl%s" % func_name -+ print "" -+ -+ -+GenerateEntrypoints() -+ Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py +++ /dev/null @@ -1,98 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig 2020-06-26 09:53:28 UTC -+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py -@@ -0,0 +1,95 @@ -+# Copyright (c) 2001, Stanford University -+# All rights reserved. -+# -+# See the file LICENSE.txt for information on redistributing this software. -+ -+ -+import sys -+ -+import apiutil -+ -+ -+def GenerateEntrypoints(): -+ -+ #apiutil.CopyrightC() -+ -+ # Get sorted list of dispatched functions. -+ # The order is very important - it must match cr_opcodes.h -+ # and spu_dispatch_table.h -+ print '%include "iprt/asmdefs.mac"' -+ print "" -+ print "%ifdef RT_ARCH_AMD64" -+ print "extern glim" -+ print "%else ; X86" -+ print "extern glim" -+ print "%endif" -+ print "" -+ -+ keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt") -+ -+ for index in range(len(keys)): -+ func_name = keys[index] -+ if apiutil.Category(func_name) == "Chromium": -+ continue -+ if apiutil.Category(func_name) == "VBox": -+ continue -+ -+ print "BEGINPROC_EXPORTED cr_gl%s" % func_name -+ print "%ifdef RT_ARCH_AMD64" -+ print "\tmov \trax, qword glim+%d" % (8*index) -+ print "\tjmp \t[rax]" -+ print "%else ; X86" -+ print "\tmov \teax, dword glim+%d" % (4*index) -+ print "\tjmp \t[eax]" -+ print "%endif" -+ print "ENDPROC cr_gl%s" % func_name -+ print "" -+ -+ -+ print ';' -+ print '; Aliases' -+ print ';' -+ -+ # Now loop over all the functions and take care of any aliases -+ allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt") -+ for func_name in allkeys: -+ if "omit" in apiutil.ChromiumProps(func_name): -+ continue -+ -+ if func_name in keys: -+ # we already processed this function earlier -+ continue -+ -+ # alias is the function we're aliasing -+ alias = apiutil.Alias(func_name) -+ if alias: -+ # this dict lookup should never fail (raise an exception)! -+ index = keys.index(alias) -+ print "BEGINPROC_EXPORTED cr_gl%s" % func_name -+ print "%ifdef RT_ARCH_AMD64" -+ print "\tmov \trax, qword glim+%d" % (8*index) -+ print "\tjmp \t[rax]" -+ print "%else ; X86" -+ print "\tmov \teax, dword glim+%d" % (4*index) -+ print "\tjmp \t[eax]" -+ print "%endif" -+ print "ENDPROC cr_gl%s" % func_name -+ print "" -+ -+ -+ print ';' -+ print '; No-op stubs' -+ print ';' -+ -+ # Now generate no-op stub functions -+ for func_name in allkeys: -+ if "stub" in apiutil.ChromiumProps(func_name): -+ print "BEGINPROC_EXPORTED cr_gl%s" % func_name -+ print "\tleave" -+ print "\tret" -+ print "ENDPROC cr_gl%s" % func_name -+ print "" -+ -+ -+GenerateEntrypoints() -+ Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py +++ /dev/null @@ -1,107 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig 2020-06-26 09:53:39 UTC -+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py -@@ -0,0 +1,104 @@ -+""" -+Copyright (C) 2009-2012 Oracle Corporation -+ -+This file is part of VirtualBox Open Source Edition (OSE), as -+available from http://www.virtualbox.org. This file is free software; -+you can redistribute it and/or modify it under the terms of the GNU -+General Public License (GPL) as published by the Free Software -+Foundation, in version 2 as it comes in the "COPYING" file of the -+VirtualBox OSE distribution. VirtualBox OSE is distributed in the -+hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. -+""" -+ -+import sys -+ -+#Note, this should match the fakedri_glxfuncsList.h order -+glx_functions = [ -+"CopyContext", -+"UseXFont", -+#"GetDriverConfig", -+"GetProcAddress", -+"QueryExtension", -+"IsDirect", -+"DestroyGLXPbufferSGIX", -+"QueryGLXPbufferSGIX", -+"CreateGLXPixmap", -+"CreateGLXPixmapWithConfigSGIX", -+"QueryContext", -+"CreateContextWithConfigSGIX", -+"SwapBuffers", -+"CreateNewContext", -+"SelectEventSGIX", -+"GetCurrentDrawable", -+"ChooseFBConfig", -+"WaitGL", -+"GetFBConfigs", -+"CreatePixmap", -+"GetSelectedEventSGIX", -+"GetCurrentReadDrawable", -+"GetCurrentDisplay", -+"QueryServerString", -+"CreateWindow", -+"SelectEvent", -+"GetVisualFromFBConfigSGIX", -+"GetFBConfigFromVisualSGIX", -+"QueryDrawable", -+"CreateContext", -+"GetConfig", -+"CreateGLXPbufferSGIX", -+"CreatePbuffer", -+"ChooseFBConfigSGIX", -+"WaitX", -+"GetVisualFromFBConfig", -+#"GetScreenDriver", -+"GetFBConfigAttrib", -+"GetCurrentContext", -+"GetClientString", -+"DestroyPixmap", -+"MakeCurrent", -+"DestroyContext", -+"GetProcAddressARB", -+"GetSelectedEvent", -+"DestroyPbuffer", -+"DestroyWindow", -+"DestroyGLXPixmap", -+"QueryVersion", -+"ChooseVisual", -+"MakeContextCurrent", -+"QueryExtensionsString", -+"GetFBConfigAttribSGIX", -+"FreeMemoryMESA", -+"QueryContextInfoEXT", -+"ImportContextEXT", -+"GetContextIDEXT", -+"MakeCurrentReadSGI", -+"AllocateMemoryMESA", -+"GetMemoryOffsetMESA", -+"CreateGLXPixmapMESA", -+"GetCurrentDisplayEXT", -+"FreeContextEXT" -+]; -+ -+print '%include "iprt/asmdefs.mac"' -+print "" -+print "%ifdef RT_ARCH_AMD64" -+print "extern glxim" -+print "%else ; X86" -+print "extern glxim" -+print "%endif" -+print "" -+ -+for index in range(len(glx_functions)): -+ func_name = glx_functions[index] -+ -+ print "BEGINPROC_EXPORTED vbox_glX%s" % func_name -+ print "%ifdef RT_ARCH_AMD64" -+ print "\tmov \trax, qword glxim+%d" % (8*index) -+ print "\tjmp \t[rax]" -+ print "%else ; X86" -+ print "\tmov \teax, dword glxim+%d" % (4*index) -+ print "\tjmp \t[eax]" -+ print "%endif" -+ print "ENDPROC vbox_glX%s" % func_name -+ print "" -+ Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk +++ /dev/null @@ -1,79 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/Makefile.kmk.orig 2020-05-13 19:37:03 UTC -+++ src/VBox/Additions/common/crOpenGL/Makefile.kmk -@@ -50,9 +50,7 @@ endif - if1of ($(KBUILD_TARGET), linux solaris freebsd) - #VBoxOGL_DRI = 1 - DLLS += VBoxEGL -- ifn1of ($(KBUILD_TARGET),linux solaris) # No DRI on Solaris yet -- VBoxOGL_FAKEDRI = 1 -- endif -+ #VBoxOGL_FAKEDRI = 1 - - # Only Solaris right now needs C stubs because I can't figure out how to - # generate the GOT based relocation ASM yet. -@@ -188,10 +186,12 @@ VBoxOGL_CLEAN.linux += \ - $(VBOX_PATH_CROGL_GENFILES)/linux_exports.c - VBoxOGL_CLEAN.solaris += \ - $(VBOX_PATH_CROGL_GENFILES)/solaris_exports.c -+VBoxOGL_CLEAN.freebsd += \ -+ $(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.c - VBoxOGL_CLEAN.win = \ - $(VBOX_PATH_CROGL_GENFILES)/windows_exports.asm \ - $(VBOX_PATH_CROGL_GENFILES)/cropengl.def --if1of ($(KBUILD_TARGET), linux solaris) -+if1of ($(KBUILD_TARGET), linux solaris freebsd) - ifdef VBoxOGL_DRI - VBoxOGL_CLEAN += \ - $(VBOX_PATH_CROGL_GENFILES)/cr_gl.h \ -@@ -204,6 +204,8 @@ if1of ($(KBUILD_TARGET), linux solaris) - $(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm - VBoxOGL_CLEAN.solaris += \ - $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm -+ VBoxOGL_CLEAN.freebsd += \ -+ $(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm - endif - endif - VBoxOGL_LIBS = \ -@@ -244,6 +246,8 @@ if1of ($(KBUILD_TARGET), linux solaris freebsd) - else - VBoxOGL_SONAME.linux = libGL.so.1 - VBoxOGL_LDFLAGS.linux += -Wl,-e,LibMain -+ VBoxOGL_SONAME.freebsd = libGL.so.1 -+ VBoxOGL_LDFLAGS.freebsd += -Wl,-e,LibMain - endif - endif - ifdef VBOX_WITH_CRHGSMI -@@ -252,7 +256,7 @@ endif - ifdef VBOX_WITH_WDDM - VBoxOGL_DEFS.win += VBOX_WITH_WDDM - endif --if1of ($(KBUILD_TARGET), linux) -+if1of ($(KBUILD_TARGET), linux freebsd) - VBoxOGL_LDFLAGS += -Wl,-z,nodelete - endif - ifdef VBOX_WITH_WDDM -@@ -418,6 +422,16 @@ $(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm: \ - $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm: $(PATH_SUB_CURRENT)/SunOS_i386_glxapi_exports.py | $$(dir $$@) - $(call MSG_GENERATE,python,$@,$<) - $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< -+ else ifeq ($(KBUILD_TARGET),freebsd) -+$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports_dri.asm: \ -+ $(PATH_SUB_CURRENT)/FreeBSD_i386_exports_dri.py \ -+ $(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \ -+ | $$(dir $$@) -+ $(call MSG_GENERATE,python,$@,$<) -+ $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) -+$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm: $(PATH_SUB_CURRENT)/FreeBSD_i386_glxapi_exports.py | $$(dir $$@) -+ $(call MSG_GENERATE,python,$@,$<) -+ $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< - - else - $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \ -@@ -656,6 +670,7 @@ ifndef VBOX_USE_SYSTEM_GL_HEADERS - endif - VBoxEGL_LIBS = $(VBOX_LIB_OGL) # $(VBOX_LIB_IPRT_GUEST_R3_SHARED) - VBoxEGL_SONAME.linux = libEGL.so.1 -+VBoxEGL_SONAME.freebsd = libEGL.so.1 - - include $(FILE_KBUILD_SUB_FOOTER) - Index: emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient +++ emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient @@ -1,18 +1,17 @@ ---- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2020-05-13 19:37:09 UTC +--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig 2021-01-07 15:34:29 UTC +++ src/VBox/Additions/x11/Installer/98vboxadd-xclient -@@ -30,10 +30,10 @@ elif test -z "${SSH_CONNECTION}"; then +@@ -30,9 +30,9 @@ elif test -z "${SSH_CONNECTION}"; then # This script can also be triggered by a connection over SSH, which is not # what we had in mind, so we do not start VBoxClient in that case. We do # not use "exit" here as this script is "source"d, not executed. - /usr/bin/VBoxClient --clipboard - /usr/bin/VBoxClient --checkhostversion -- /usr/bin/VBoxClient --display - /usr/bin/VBoxClient --seamless - /usr/bin/VBoxClient --draganddrop +- /usr/bin/VBoxClient --vmsvga # In case VMSVGA emulation is enabled + /usr/local/bin/VBoxClient --clipboard + /usr/local/bin/VBoxClient --checkhostversion -+ /usr/local/bin/VBoxClient --display + /usr/local/bin/VBoxClient --seamless + /usr/local/bin/VBoxClient --draganddrop - /usr/bin/VBoxClient --vmsvga-x11 # In case VMSVGA emulation is enabled ++ /usr/local/bin/VBoxClient --vmsvga # In case VMSVGA emulation is enabled fi Index: emulators/virtualbox-ose/files/patch-src-VBox-Devices-PC-ipxe-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Devices-PC-ipxe-Makefile.kmk +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2020-05-13 19:42:27 UTC -+++ src/VBox/Devices/PC/ipxe/Makefile.kmk -@@ -35,7 +35,7 @@ iPxeBiosBin_SOURCES = $(iPxeBiosBin_0_OUTDIR)/iPxeBio - iPxeBiosBin_CLEAN = \ - $(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \ - --if1of ($(KBUILD_TARGET), darwin os2 solaris win) -+if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win) - $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@) - $(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@) - $(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@ Index: emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostBase-freebsd.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostBase-freebsd.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp 2020-09-17 20:17:20 UTC -+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp -@@ -149,6 +149,8 @@ - else - rc = RTErrConvertFromErrno(errno); - } -+ -+ return rc; - } - - Index: emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk +++ /dev/null @@ -1,20 +0,0 @@ ---- src/VBox/GuestHost/OpenGL/Makefile.kmk.orig 2019-07-12 08:49:27 UTC -+++ src/VBox/GuestHost/OpenGL/Makefile.kmk -@@ -94,7 +94,7 @@ VBoxOGLcrutil_DEFS.win += CR_DEBUG_BACKDOOR_ENABLE - VBoxOGLcrutil_INCS.win += $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm - VBoxOGLcrutil_LIBS.win += $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger$(VBOX_SUFF_LIB) - endif --if1of ($(KBUILD_TARGET), linux) -+if1of ($(KBUILD_TARGET), linux freebsd) - VBoxOGLcrutil_LDFLAGS += -Wl,-z,nodelete - endif - -@@ -140,7 +140,7 @@ VBoxOGLhostcrutil_TEMPLATE = VBOXCROGLR3HOSTLIB - if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_WDDM) - VBoxOGLhostcrutil_INSTTYPE.win = both - endif --if1of ($(KBUILD_TARGET), linux) -+if1of ($(KBUILD_TARGET), linux freebsd) - VBoxOGLhostcrutil_LDFLAGS = $(NO_SUCH_VARIABLE) - endif - VBoxOGLhostcrutil_LIBS.win = \ Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile @@ -1,4 +1,4 @@ ---- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2020-05-13 19:43:53 UTC +--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig 2019-01-25 18:19:55 UTC +++ src/VBox/HostDrivers/Support/freebsd/Makefile @@ -82,6 +82,7 @@ SRCS += \ assert.c \ @@ -8,12 +8,13 @@ once.c \ term.c \ thread.c -@@ -94,13 +95,14 @@ SRCS += \ +@@ -94,14 +95,15 @@ SRCS += \ RTStrCopy.c \ RTStrCopyEx.c \ RTStrCopyP.c \ + memchr.c \ strformat.c \ + strformatnum.c \ strformatrt.c \ strformattype.c \ + stringalloc.c \ Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv @@ -1,6 +1,6 @@ ---- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2020-05-13 19:43:53 UTC +--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig 2019-01-25 18:19:55 UTC +++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv -@@ -118,6 +118,7 @@ FILES_VBOXDRV_NOBIN=" \ +@@ -119,6 +119,7 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \ @@ -8,12 +8,13 @@ ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \ ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \ -@@ -127,13 +128,14 @@ FILES_VBOXDRV_NOBIN=" \ +@@ -128,14 +129,15 @@ FILES_VBOXDRV_NOBIN=" \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \ ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \ + ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \ Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk @@ -1,25 +1,20 @@ -Fix kmod panic when VIMAGE is disabled in the kernel and port - -Submitted by: Gleb Kurtsou ---- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2020-05-13 19:43:54 UTC +--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig 2019-05-13 13:33:07 UTC +++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk -@@ -203,12 +203,15 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \ +@@ -206,10 +206,14 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \ $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \ | $$(dir $$@) $(QUIET)$(RM) -f -- $@ - ifndef VBOX_WITH_HARDENING -- $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $< +- $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $< - else $(QUIET)$(CP) -f $< $@ + ifndef VBOX_WITH_HARDENING + $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ -+ ${QUIET}$(MV) -f $@.tmp $@ - endif -- ++ $(QUIET)$(MV) -f $@.tmp $@ ++ endif + ifndef VBOX_WITH_NETFLT_VIMAGE + $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@ -+ ${QUIET}$(MV) -f $@.tmp $@ -+ endif - endif # freebsd ++ $(QUIET)$(MV) -f $@.tmp $@ + endif - include $(FILE_KBUILD_SUB_FOOTER) + endif # freebsd Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c +++ /dev/null @@ -1,14 +0,0 @@ ---- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c.orig 2020-05-13 19:43:54 UTC -+++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c -@@ -235,7 +235,11 @@ static void VBoxNetAdpFreeBSDNetstart(struct ifnet *if - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - { -+#if __FreeBSD_version >= 1100036 -+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); -+#else - ifp->if_opackets++; -+#endif - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - BPF_MTAP(ifp, m); - m_freem(m); Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c @@ -1,4 +1,4 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2018-10-15 14:30:58 UTC +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2019-04-16 10:16:39 UTC +++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c @@ -52,6 +52,7 @@ #include @@ -16,31 +16,7 @@ static int vboxnetflt_modevent(struct module *, int, void *); static ng_constructor_t ng_vboxnetflt_constructor; -@@ -370,7 +372,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i - mtx_lock_spin(&pThis->u.s.inq.ifq_mtx); - _IF_ENQUEUE(&pThis->u.s.inq, m); - mtx_unlock_spin(&pThis->u.s.inq.ifq_mtx); -+#if __FreeBSD_version >= 1100100 -+ taskqueue_enqueue(taskqueue_fast, &pThis->u.s.tskin); -+#else - taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskin); -+#endif - } - /* - * Handle mbufs on the outgoing hook, frames going to the interface -@@ -388,7 +394,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i - mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); - _IF_ENQUEUE(&pThis->u.s.outq, m); - mtx_unlock_spin(&pThis->u.s.outq.ifq_mtx); -+#if __FreeBSD_version >= 1100100 -+ taskqueue_enqueue(taskqueue_fast, &pThis->u.s.tskout); -+#else - taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskout); -+#endif - } - else - { -@@ -428,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend +@@ -436,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend struct ifnet *ifp = pThis->u.s.ifp; unsigned int cSegs = 0; bool fDropIt = false, fActive; @@ -49,7 +25,7 @@ PINTNETSG pSG; VBOXCURVNET_SET(ifp->if_vnet); -@@ -440,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend +@@ -448,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend if (m == NULL) break; @@ -69,7 +45,7 @@ for (m0 = m; m0 != NULL; m0 = m0->m_next) if (m0->m_len > 0) cSegs++; -@@ -454,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend +@@ -462,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0); fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE); RTMemTmpFree(pSG); @@ -97,7 +73,7 @@ if (fDropIt) m_freem(m); else -@@ -513,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen +@@ -521,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen */ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst) { @@ -105,7 +81,7 @@ NOREF(pvIfData); void (*input_f)(struct ifnet *, struct mbuf *); -@@ -529,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -537,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p { m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG); if (m == NULL) @@ -122,7 +98,7 @@ m->m_flags |= M_PKTHDR; ether_output_frame(ifp, m); -@@ -542,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -550,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p { m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG); if (m == NULL) @@ -139,7 +115,7 @@ /* * Delivering packets to the host will be captured by the * input hook. Tag the packet with a mbuf tag so that we -@@ -556,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -564,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p if (mtag == NULL) { m_freem(m); @@ -147,7 +123,7 @@ return VERR_NO_MEMORY; } -@@ -566,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p +@@ -574,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p ifp->if_input(ifp, m); } VBOXCURVNET_RESTORE(); @@ -155,7 +131,7 @@ return VINF_SUCCESS; } -@@ -578,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT +@@ -586,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext) { @@ -163,7 +139,7 @@ char nam[NG_NODESIZ]; struct ifnet *ifp; node_p node; -@@ -586,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi +@@ -594,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi NOREF(pvContext); ifp = ifunit(pThis->szName); if (ifp == NULL) @@ -174,7 +150,7 @@ /* Create a new netgraph node for this instance */ if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0) -@@ -630,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi +@@ -638,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi vboxNetFltRelease(pThis, true /*fBusy*/); } VBOXCURVNET_RESTORE(); @@ -189,7 +165,7 @@ struct ifnet *ifp, *ifp0; ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *); -@@ -652,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi +@@ -660,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi pThis->u.s.node = NULL; } VBOXCURVNET_RESTORE(); @@ -197,7 +173,7 @@ if (ifp0 != NULL) { -@@ -664,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi +@@ -672,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) { @@ -205,7 +181,7 @@ taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin); taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout); -@@ -676,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) +@@ -684,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) ng_rmnode_self(pThis->u.s.node); VBOXCURVNET_RESTORE(); pThis->u.s.node = NULL; @@ -213,7 +189,7 @@ } int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) -@@ -689,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) +@@ -697,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis) void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive) { @@ -221,7 +197,7 @@ struct ifnet *ifp; struct ifreq ifreq; int error; -@@ -722,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -730,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, sizeof(struct ngm_connect), M_NOWAIT); if (msg == NULL) @@ -232,7 +208,7 @@ con = (struct ngm_connect *)msg->data; snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); strlcpy(con->ourhook, "lower", NG_HOOKSIZ); -@@ -736,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -744,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT, sizeof(struct ngm_connect), M_NOWAIT); if (msg == NULL) @@ -243,7 +219,7 @@ con = (struct ngm_connect *)msg->data; snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname); -@@ -759,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -767,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, sizeof(struct ngm_rmhook), M_NOWAIT); if (msg == NULL) @@ -254,7 +230,7 @@ rm = (struct ngm_rmhook *)msg->data; strlcpy(rm->ourhook, "input", NG_HOOKSIZ); NG_SEND_MSG_PATH(error, node, msg, path, 0); -@@ -770,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b +@@ -778,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK, sizeof(struct ngm_rmhook), M_NOWAIT); if (msg == NULL) Index: emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt +++ emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-files_vboxnetflt @@ -1,6 +1,6 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig 2018-10-15 14:30:58 UTC +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt.orig 2021-01-07 15:41:28 UTC +++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/files_vboxnetflt -@@ -61,6 +61,7 @@ VBOX_VBOXNETFLT_SOURCES=" \ +@@ -62,6 +62,7 @@ VBOX_VBOXNETFLT_SOURCES=" \ ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \ ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ Index: emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh +++ emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh @@ -1,6 +1,6 @@ --- src/VBox/Installer/freebsd/VBox.sh.orig 2016-08-27 05:10:34 UTC +++ src/VBox/Installer/freebsd/VBox.sh -@@ -0,0 +1,64 @@ +@@ -0,0 +1,67 @@ +#!/bin/sh +# +# Oracle VM VirtualBox startup script, FreeBSD hosts. @@ -37,6 +37,9 @@ +case "$APP" in + VirtualBox|virtualbox) + exec "$INSTALL_DIR/VirtualBox" "$@" ++ ;; ++ VirtualBoxVM|virtualboxvm) ++ exec "$INSTALL_DIR/VirtualBoxVM" "$@" + ;; + VBoxManage|vboxmanage) + exec "$INSTALL_DIR/VBoxManage" "$@" Index: emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp +++ emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp @@ -1,6 +1,6 @@ ---- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2020-05-13 19:44:10 UTC +--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig 2021-01-07 15:41:43 UTC +++ src/VBox/Main/src-server/VirtualBoxImpl.cpp -@@ -2251,7 +2251,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a +@@ -2663,7 +2663,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a if (aCiphertextSize < 32) return VERR_INVALID_PARAMETER; Index: emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp +++ /dev/null @@ -1,14 +0,0 @@ ---- src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp.orig 2020-05-13 19:44:10 UTC -+++ src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp -@@ -253,8 +253,9 @@ static int getDVDInfoFromCAM(DriveInfoList *pList, boo - PeriphMatchPattern.pattern.periph_pattern.path_id = paMatches[i].result.device_result.path_id; - PeriphMatchPattern.pattern.periph_pattern.target_id = paMatches[i].result.device_result.target_id; - PeriphMatchPattern.pattern.periph_pattern.target_lun = paMatches[i].result.device_result.target_lun; -- PeriphMatchPattern.pattern.periph_pattern.flags = PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | -- PERIPH_MATCH_LUN; -+ PeriphMatchPattern.pattern.periph_pattern.flags = static_cast -+ (PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET | -+ PERIPH_MATCH_LUN); - PeriphCCB.cdm.num_patterns = 1; - PeriphCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result); - PeriphCCB.cdm.patterns = &PeriphMatchPattern; Index: emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk @@ -1,4 +1,4 @@ ---- src/VBox/Main/webservice/Makefile.kmk.orig 2020-05-13 19:44:11 UTC +--- src/VBox/Main/webservice/Makefile.kmk.orig 2021-01-07 15:41:45 UTC +++ src/VBox/Main/webservice/Makefile.kmk @@ -158,7 +158,6 @@ VBOX_PATH_IDL := $(abspath $(PATH_SUB_ RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT) @@ -8,7 +8,7 @@ PATH_TARGET_SOAPDEMONSMAPS := $(VBOXWEB_OUT_DIR)/demo_namespacemaps PATH_TARGET_WEBTEST := $(VBOXWEB_OUT_DIR)/webtest -@@ -553,8 +552,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@) +@@ -565,8 +564,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@) $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \ $(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \ $(PATH_TARGET_SOAPDEMOXML)/dummy_file \ @@ -17,7 +17,7 @@ $(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \ $(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file -@@ -774,17 +771,14 @@ endif +@@ -786,17 +783,14 @@ endif # any more. Ignoring the exit code is the simple solution, accepting the error. $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@) $(RM) -f $@ Index: emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/Makefile.kmk.orig 2020-07-09 16:57:23 UTC +--- src/VBox/Runtime/Makefile.kmk.orig 2021-01-07 15:41:50 UTC +++ src/VBox/Runtime/Makefile.kmk -@@ -173,6 +173,11 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h: +@@ -177,6 +177,11 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h: # @@ -12,12 +12,3 @@ # Unicode Specification reader used to regenerate unidata-*.cpp. # uniread_TEMPLATE = VBoxBldProg -@@ -1632,7 +1637,7 @@ VBoxRT_SOURCES.solaris += \ - VBoxRT_SOURCES.darwin += \ - r3/posix/fileaio-posix.cpp - VBoxRT_SOURCES.freebsd += \ -- r3/freebsd/fileaio-freebsd.cpp -+ r3/posix/fileaio-posix.cpp - VBoxRT_INCS := $(RuntimeR3_INCS) - VBoxRT_INCS.$(KBUILD_TARGET) := $(RuntimeR3_INCS.$(KBUILD_TARGET)) - VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) Index: emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h =================================================================== --- emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h +++ emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h @@ -7,9 +7,9 @@ what tvtohz does. Submitted by: Andriy Gapon ---- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2020-05-13 19:44:32 UTC +--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig 2021-01-07 15:42:09 UTC +++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h -@@ -82,6 +82,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 +@@ -84,6 +84,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0 uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000)); if (cTicks >= INT_MAX) return RTSEMWAIT_FLAGS_INDEFINITE; Index: emulators/virtualbox-ose/files/patch-src-recompiler-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src-recompiler-Makefile.kmk +++ /dev/null @@ -1,10 +0,0 @@ ---- src/recompiler/Makefile.kmk.orig 2020-05-13 19:46:49 UTC -+++ src/recompiler/Makefile.kmk -@@ -41,6 +41,7 @@ endif - # - ifneq ($(KBUILD_TARGET),win) - VBoxRemPrimary_TEMPLATE = VBOXR3NP -+ VBoxRemPrimary_TOOL.freebsd = VBoxGccFreeBSD - # workaround the regparm bug in gcc <= 3.3 - VBoxRemPrimary_DEFS = $(if $(VBOX_GCC_BUGGY_REGPARM),GCC_WITH_BUGGY_REGPARM,) - else Index: emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c =================================================================== --- emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c +++ /dev/null @@ -1,22 +0,0 @@ ---- src/recompiler/Sun/testmath.c.orig 2020-05-13 19:46:49 UTC -+++ src/recompiler/Sun/testmath.c -@@ -273,8 +273,6 @@ extern int testmath(void) - #endif - set_cw(0x27f); - -- CHECK(logl(2.7182818284590452353602874713526625L), 1.0); -- - CHECK(remainderl(1.0L, 1.0L), 0.0); - CHECK(remainderl(1.0L, 1.5L), -0.5); - CHECK(remainderl(42.0L, 34.25L), 7.75); -@@ -341,10 +339,6 @@ extern int testmath(void) - - CHECK(tanl(0.0L), 0.0); - CHECK(tanl(0.7853981633974483096156608458198757L), 1.0); -- -- CHECK(powl(0.0, 0.0), 1.0); -- CHECK(powl(2.0, 2.0), 4.0); -- CHECK(powl(3.0, 3.0), 27.0); - - return cErrors; - } Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_VBoxService_VBoxServiceVMInfo.cpp @@ -1,6 +1,6 @@ ---- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig 2017-03-08 17:15:20 UTC +--- src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp.orig 2021-01-07 15:34:20 UTC +++ src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp -@@ -71,8 +71,8 @@ +@@ -67,8 +67,8 @@ # include # include /* getpwuid */ # include @@ -11,7 +11,7 @@ # endif # ifdef RT_OS_OS2 # include -@@ -531,7 +531,7 @@ static void vgsvcVMInfoWriteFixedPropert +@@ -528,7 +528,7 @@ static void vgsvcVMInfoWriteFixedProperties(void) } @@ -20,9 +20,9 @@ /* * Simple wrapper to work around compiler-specific va_list madness. */ -@@ -562,12 +562,6 @@ static int vgsvcVMInfoWriteUsers(void) - rc = VERR_NOT_IMPLEMENTED; - # endif +@@ -555,12 +555,6 @@ static int vgsvcVMInfoWriteUsers(void) + #ifdef RT_OS_WINDOWS + rc = VGSvcVMInfoWinWriteUsers(&g_VMInfoPropCache, &pszUserList, &cUsersInList); -#elif defined(RT_OS_FREEBSD) - /** @todo FreeBSD: Port logged on user info retrieval. @@ -33,7 +33,7 @@ #elif defined(RT_OS_HAIKU) /** @todo Haiku: Port logged on user info retrieval. */ rc = VERR_NOT_IMPLEMENTED; -@@ -593,7 +587,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -586,7 +580,7 @@ static int vgsvcVMInfoWriteUsers(void) while ( (ut_user = getutxent()) && RT_SUCCESS(rc)) { @@ -42,7 +42,7 @@ VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32)\n", ut_user->ut_user, ut_user->ut_type, ut_user->ut_pid); # else VGSvcVerbose(4, "Found entry '%s' (type: %d, PID: %RU32, session: %RU32)\n", -@@ -628,7 +622,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -621,7 +615,7 @@ static int vgsvcVMInfoWriteUsers(void) } # ifdef VBOX_WITH_DBUS @@ -51,7 +51,7 @@ DBusError dbErr; DBusConnection *pConnection = NULL; int rc2 = RTDBusLoadLib(); -@@ -837,7 +831,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -830,7 +824,7 @@ static int vgsvcVMInfoWriteUsers(void) if ( fHaveLibDbus && dbus_error_is_set(&dbErr)) dbus_error_free(&dbErr); @@ -60,7 +60,7 @@ # endif /* VBOX_WITH_DBUS */ /** @todo Fedora/others: Handle systemd-loginctl. */ -@@ -874,7 +868,7 @@ static int vgsvcVMInfoWriteUsers(void) +@@ -867,7 +861,7 @@ static int vgsvcVMInfoWriteUsers(void) RTMemFree(papszUsers); endutxent(); /* Close utmpx file. */ Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_dri__glx.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_dri__glx.h +++ /dev/null @@ -1,33 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/dri_glx.h.orig 2020-07-09 16:50:09 UTC -+++ src/VBox/Additions/common/crOpenGL/dri_glx.h -@@ -111,23 +111,23 @@ extern DECLEXPORT(const char *) VBOXGLXTAG(glXQueryExt - extern DECLEXPORT(GLXPbufferSGIX) VBOXGLXTAG(glXCreateGLXPbufferSGIX) - (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); - --extern DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX) --(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); -+extern DECLEXPORT(void) VBOXGLXTAG(glXQueryGLXPbufferSGIX) -+(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); - - extern DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXTAG(glXChooseFBConfigSGIX) - (Display *dpy, int screen, int *attrib_list, int *nelements); - --extern DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf); -+extern DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf); - extern DECLEXPORT(void) VBOXGLXTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask); - extern DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask); - - extern DECLEXPORT(GLXFBConfigSGIX) VBOXGLXTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis); --extern DECLEXPORT(XVisualInfo *) VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config); -+extern DECLEXPORT(XVisualInfo *) VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config); - extern DECLEXPORT(GLXContext) VBOXGLXTAG(glXCreateContextWithConfigSGIX) --(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -+(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); - --extern DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap); --extern DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value); -+extern DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); -+extern DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); - - /* - * GLX 1.3 functions Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_fakedri__drv.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_fakedri__drv.h +++ /dev/null @@ -1,25 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/fakedri_drv.h.orig 2020-07-09 16:50:09 UTC -+++ src/VBox/Additions/common/crOpenGL/fakedri_drv.h -@@ -80,16 +80,16 @@ extern Bool VBOXGLXENTRYTAG(glXQueryVersion)(Display * - extern XVisualInfo * VBOXGLXENTRYTAG(glXChooseVisual)(Display *dpy, int screen, int *attribList) ; - extern const char * VBOXGLXENTRYTAG(glXQueryExtensionsString)(Display *dpy, int screen) ; - extern GLXPbufferSGIX VBOXGLXENTRYTAG(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); --extern int VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); -+extern void VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); - extern GLXFBConfigSGIX * VBOXGLXENTRYTAG(glXChooseFBConfigSGIX)(Display *dpy, int screen, int *attrib_list, int *nelements); --extern void VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf) ; -+extern void VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf) ; - extern void VBOXGLXENTRYTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask) ; - extern void VBOXGLXENTRYTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask) ; - extern GLXFBConfigSGIX VBOXGLXENTRYTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis) ; --extern XVisualInfo * VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config) ; --extern GLXContext VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); --extern GLXPixmap VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap) ; --extern int VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value) ; -+extern XVisualInfo * VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config) ; -+extern GLXContext VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); -+extern GLXPixmap VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap) ; -+extern int VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value) ; - extern GLXFBConfig * VBOXGLXENTRYTAG(glXChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements) ; - extern GLXPbuffer VBOXGLXENTRYTAG(glXCreatePbuffer)(Display *dpy, GLXFBConfig config, ATTRIB_TYPE *attrib_list) ; - extern GLXPixmap VBOXGLXENTRYTAG(glXCreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const ATTRIB_TYPE *attrib_list) ; Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx.c +++ /dev/null @@ -1,58 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/glx.c.orig 2020-07-09 16:50:09 UTC -+++ src/VBox/Additions/common/crOpenGL/glx.c -@@ -742,7 +742,7 @@ VBOXGLXTAG(glXCreateGLXPbufferSGIX)(Display *dpy, GLXF - return 0; - } - --DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf) -+DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf) - { - (void) dpy; - (void) pbuf; -@@ -763,7 +763,7 @@ DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEventSGIX)(D - (void) mask; - } - --DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf, -+DECLEXPORT(void) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf, - int attribute, unsigned int *value) - { - (void) dpy; -@@ -771,10 +771,9 @@ DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Dis - (void) attribute; - (void) value; - crWarning("glXQueryGLXPbufferSGIX not implemented by Chromium"); -- return 0; - } - --DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, -+DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, - int attribute, int *value) - { - return VBOXGLXTAG(glXGetFBConfigAttrib)(dpy, config, attribute, value); -@@ -789,14 +788,14 @@ VBOXGLXTAG(glXChooseFBConfigSGIX)(Display *dpy, int sc - - DECLEXPORT(GLXPixmap) - VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, -- GLXFBConfig config, -+ GLXFBConfigSGIX config, - Pixmap pixmap) - { - return VBOXGLXTAG(glXCreatePixmap)(dpy, config, pixmap, NULL); - } - - DECLEXPORT(GLXContext) --VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfig config, -+VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, - int render_type, - GLXContext share_list, - Bool direct) -@@ -812,7 +811,7 @@ VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dp - - DECLEXPORT(XVisualInfo *) - VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, -- GLXFBConfig config) -+ GLXFBConfigSGIX config) - { - return visualInfoFromFBConfig(dpy, config); - } Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__c__exports.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__c__exports.c +++ /dev/null @@ -1,50 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/glx_c_exports.c.orig 2020-10-25 11:52:00 UTC -+++ src/VBox/Additions/common/crOpenGL/glx_c_exports.c -@@ -213,8 +213,8 @@ DECLEXPORT(GLXPbufferSGIX) VBOXGLXENTRYTAG(glXCreateGL - return glxim.CreateGLXPbufferSGIX(dpy, config, width, height, attrib_list); - } - --DECLEXPORT(int) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX) --(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value) -+DECLEXPORT(void) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX) -+(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value) - { - return glxim.QueryGLXPbufferSGIX(dpy, pbuf, attribute, value); - } -@@ -225,7 +225,7 @@ DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXENTRYTAG(glXChoos - return glxim.ChooseFBConfigSGIX(dpy, screen, attrib_list, nelements); - } - --DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf) -+DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf) - { - return glxim.DestroyGLXPbufferSGIX(dpy, pbuf); - } -@@ -245,23 +245,23 @@ DECLEXPORT(GLXFBConfigSGIX) VBOXGLXENTRYTAG(glXGetFBCo - return glxim.GetFBConfigFromVisualSGIX(dpy, vis); - } - --DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config) -+DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config) - { - return glxim.GetVisualFromFBConfigSGIX(dpy, config); - } - - DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX) --(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct) -+(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct) - { - return glxim.CreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct); - } - --DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap) -+DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap) - { - return glxim.CreateGLXPixmapWithConfigSGIX(dpy, config, pixmap); - } - --DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value) -+DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value) - { - return glxim.GetFBConfigAttribSGIX(dpy, config, attribute, value); - } Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__proto.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__proto.h +++ /dev/null @@ -1,33 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/glx_proto.h.orig 2020-07-09 16:50:09 UTC -+++ src/VBox/Additions/common/crOpenGL/glx_proto.h -@@ -95,23 +95,23 @@ typedef const char * (*PGLXFUNC_QueryExtensionsString) - typedef GLXPbufferSGIX (*PGLXFUNC_CreateGLXPbufferSGIX) - (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list); - --typedef int (*PGLXFUNC_QueryGLXPbufferSGIX) --(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); -+typedef void (*PGLXFUNC_QueryGLXPbufferSGIX) -+(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value); - - typedef GLXFBConfigSGIX * (*PGLXFUNC_ChooseFBConfigSGIX) - (Display *dpy, int screen, int *attrib_list, int *nelements); - --typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf); -+typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf); - typedef void (*PGLXFUNC_SelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask); - typedef void (*PGLXFUNC_GetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask); - - typedef GLXFBConfigSGIX (*PGLXFUNC_GetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis); --typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config); -+typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config); - typedef GLXContext (*PGLXFUNC_CreateContextWithConfigSGIX) --(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -+(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct); - --typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap); --typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value); -+typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap); -+typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value); - - /* - * GLX 1.3 functions Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_stub.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_stub.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Additions/common/crOpenGL/stub.h.orig 2016-07-18 11:50:44 UTC -+++ src/VBox/Additions/common/crOpenGL/stub.h -@@ -47,7 +47,7 @@ - #include - #endif - --#if defined(WINDOWS) || defined(Linux) || defined(SunOS) -+#if defined(WINDOWS) || defined(Linux) || defined(FreeBSD) || defined(SunOS) - # define CR_NEWWINTRACK - #endif - Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp @@ -1,6 +1,6 @@ ---- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2020-05-13 19:37:05 UTC +--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig 2021-01-07 15:34:21 UTC +++ src/VBox/Additions/common/pam/pam_vbox.cpp -@@ -105,7 +105,7 @@ static void pam_vbox_writesyslog(char *pszBuf) +@@ -104,7 +104,7 @@ static void pam_vbox_writesyslog(char *pszBuf) openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV); syslog(LOG_ERR, "%s", pszBuf); closelog(); @@ -9,7 +9,7 @@ syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf); #endif } -@@ -184,7 +184,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle +@@ -183,7 +183,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle pam_message msg; msg.msg_style = iStyle; Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile.kmk @@ -1,4 +1,4 @@ ---- src/VBox/Additions/freebsd/Makefile.kmk.orig 2019-07-12 08:42:35 UTC +--- src/VBox/Additions/freebsd/Makefile.kmk.orig 2021-01-07 15:34:22 UTC +++ src/VBox/Additions/freebsd/Makefile.kmk @@ -23,8 +23,9 @@ $(error "The FreeBSD guest additions installer can onl endif @@ -12,11 +12,12 @@ # # Globals -@@ -67,11 +68,13 @@ VBOX_FBSD_ADD_STRIP_BIN = \ +@@ -66,11 +67,14 @@ VBOX_FBSD_ADD_STRIP_BIN = \ + vboxvideo_drv_14.so \ vboxvideo_drv_15.so \ vboxvideo_drv_16.so \ - vboxvideo_drv_17.so \ -- VBoxOGL.so +- vboxvideo_drv_17.so ++ vboxvideo_drv_17.so \ + $(if $(VBOX_WITH_PAM),pam_vbox.so,) \ + VBoxOGL.so \ + mount_vboxvfs Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk @@ -1,10 +1,11 @@ ---- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig 2020-05-13 19:37:06 UTC +--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig 2021-01-07 15:34:22 UTC +++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk -@@ -33,32 +33,36 @@ vboxvfs_INCS = \ +@@ -33,32 +33,37 @@ vboxvfs_INCS = \ $(vboxvfs_0_OUTDIR) vboxvfs_SOURCES = \ vboxvfs_vfsops.c \ - vboxvfs_vnops.c ++ bcmp.c \ + vboxvfs_vnops.c \ + vboxvfs_prov.c vboxvfs_LIBS = \ Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c @@ -0,0 +1,12 @@ +--- src/VBox/Additions/freebsd/vboxvfs/bcmp.c.orig 2021-02-21 19:09:22 UTC ++++ src/VBox/Additions/freebsd/vboxvfs/bcmp.c +@@ -0,0 +1,9 @@ ++#include ++ ++int bcmp(const void *b1, const void *b2, size_t len); ++ ++int ++bcmp(const void *b1, const void *b2, size_t len) ++{ ++ return __builtin_memcmp((b1), (b2), (len)); ++} Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h @@ -1,4 +1,4 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2018-06-29 13:08:17 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig 2021-01-07 15:34:22 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h @@ -1,8 +1,3 @@ -/* $Id: vboxvfs.h $ */ @@ -7,9 +7,9 @@ - */ - /* - * Copyright (C) 2010-2017 Oracle Corporation + * Copyright (C) 2010-2020 Oracle Corporation * -@@ -21,72 +16,413 @@ +@@ -24,72 +19,371 @@ #define VBOXVFS_VFSNAME "vboxvfs" #define VBOXVFS_VERSION 1 @@ -78,7 +78,6 @@ +#include "../../../../../include/iprt/err.h" +#include "../../../../../include/iprt/fs.h" +#include "../../../../../include/iprt/log.h" -+#include "../../../../../include/iprt/mangling.h" +#include "../../../../../include/iprt/mem.h" +#include "../../../../../include/iprt/param.h" +#include "../../../../../include/iprt/path.h" @@ -89,27 +88,6 @@ +#include "../../../../../include/iprt/time.h" +#include "../../../../../include/iprt/types.h" +#include "../../../../../include/iprt/uni.h" -+#include "../../../../../include/iprt/nocrt/limits.h" -+#include "../../../../../include/iprt/alloc.h" -+#include "../../../../../include/iprt/asm.h" -+#include "../../../../../include/iprt/asm-amd64-x86.h" -+#include "../../../../../include/iprt/asm-math.h" -+#include "../../../../../include/iprt/assert.h" -+#include "../../../../../include/iprt/cdefs.h" -+#include "../../../../../include/iprt/err.h" -+#include "../../../../../include/iprt/fs.h" -+#include "../../../../../include/iprt/log.h" -+#include "../../../../../include/iprt/mangling.h" -+#include "../../../../../include/iprt/mem.h" -+#include "../../../../../include/iprt/param.h" -+#include "../../../../../include/iprt/path.h" -+#include "../../../../../include/iprt/semaphore.h" -+#include "../../../../../include/iprt/stdarg.h" -+#include "../../../../../include/iprt/stdint.h" -+#include "../../../../../include/iprt/string.h" -+#include "../../../../../include/iprt/time.h" -+#include "../../../../../include/iprt/types.h" -+#include "../../../../../include/iprt/uni.h" -#include +#else @@ -134,26 +112,6 @@ +#include "iprt/time.h" +#include "iprt/types.h" +#include "iprt/uni.h" -+#include "iprt/nocrt/limits.h" -+#include "iprt/alloc.h" -+#include "iprt/asm.h" -+#include "iprt/asm-amd64-x86.h" -+#include "iprt/asm-math.h" -+#include "iprt/assert.h" -+#include "iprt/cdefs.h" -+#include "iprt/err.h" -+#include "iprt/fs.h" -+#include "iprt/log.h" -+#include "iprt/mem.h" -+#include "iprt/param.h" -+#include "iprt/path.h" -+#include "iprt/semaphore.h" -+#include "iprt/stdarg.h" -+#include "iprt/stdint.h" -+#include "iprt/string.h" -+#include "iprt/time.h" -+#include "iprt/types.h" -+#include "iprt/uni.h" + +#include "common/VBoxGuestLib/SysHlp.h" + @@ -459,5 +417,5 @@ + #endif /* KERNEL */ - #endif /* !___VBOXVFS_H___ */ + #endif /* !GA_INCLUDED_SRC_freebsd_vboxvfs_vboxvfs_h */ - Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c @@ -1,4 +1,4 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2020-07-09 16:50:11 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig 2021-01-07 15:34:22 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c @@ -1,8 +1,3 @@ -/* $Id: vboxvfs_vfsops.c $ */ @@ -7,7 +7,7 @@ - */ - /* - * Copyright (C) 2008-2017 Oracle Corporation + * Copyright (C) 2008-2020 Oracle Corporation * @@ -14,245 +9,478 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c @@ -1,18 +1,6 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2020-07-09 16:50:11 UTC +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2021-01-07 15:34:22 UTC +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c -@@ -1,10 +1,6 @@ --/* $Id: vboxvfs_vnops.c $ */ --/** @file -- * Description. -- */ -- - /* - * Copyright (C) 2008-2017 Oracle Corporation -+ * Copyright (C) 2017 Mahdi Mokhtari - * - * This file is part of VirtualBox Open Source Edition (OSE), as - * available from http://www.virtualbox.org. This file is free software; -@@ -14,228 +10,1347 @@ +@@ -14,228 +14,1347 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_VBoxClient_logging.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_VBoxClient_logging.cpp @@ -0,0 +1,10 @@ +--- src/VBox/Additions/x11/VBoxClient/logging.cpp.orig 2021-01-07 15:34:30 UTC ++++ src/VBox/Additions/x11/VBoxClient/logging.cpp +@@ -17,6 +17,7 @@ + + + #include ++#include + #include + #include + #include Index: emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_x11include_xproto-7.0.18_X11_Xfuncproto.h =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_x11include_xproto-7.0.18_X11_Xfuncproto.h @@ -0,0 +1,230 @@ +--- src/VBox/Additions/x11/x11include/xproto-7.0.18/X11/Xfuncproto.h.orig 2021-01-07 15:37:10 UTC ++++ src/VBox/Additions/x11/x11include/xproto-7.0.18/X11/Xfuncproto.h +@@ -48,6 +48,227 @@ in this Software without prior written authorization f + #endif /* _Xconst */ + + /* Function prototype configuration (see configure for more info) */ ++#if !defined(NARROWPROTO) && \ ++ (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) ++#define NARROWPROTO ++#endif ++#ifndef FUNCPROTO ++#define FUNCPROTO 15 ++#endif ++ ++#ifndef NeedWidePrototypes ++#ifdef NARROWPROTO ++#define NeedWidePrototypes 0 ++#else ++#define NeedWidePrototypes 1 /* default to make interropt. easier */ ++#endif ++#endif /* NeedWidePrototypes */ ++ ++#endif /* NeedFunctionPrototypes */ ++ ++#ifndef _XFUNCPROTOBEGIN ++#if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ ++#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ ++#define _XFUNCPROTOEND } ++#else ++#define _XFUNCPROTOBEGIN ++#define _XFUNCPROTOEND ++#endif ++#endif /* _XFUNCPROTOBEGIN */ ++ ++/* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */ ++#ifndef __has_attribute ++# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ ++#endif ++#ifndef __has_feature ++# define __has_feature(x) 0 /* Compatibility with non-clang compilers. */ ++#endif ++#ifndef __has_extension ++# define __has_extension(x) 0 /* Compatibility with non-clang compilers. */ ++#endif ++ ++/* Added in X11R6.9, so available in any version of modular xproto */ ++#if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4)) ++# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x))) ++#else ++# define _X_SENTINEL(x) ++#endif /* GNUC >= 4 */ ++ ++/* Added in X11R6.9, so available in any version of modular xproto */ ++#if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \ ++ && !defined(__CYGWIN__) && !defined(__MINGW32__) ++# define _X_EXPORT __attribute__((visibility("default"))) ++# define _X_HIDDEN __attribute__((visibility("hidden"))) ++# define _X_INTERNAL __attribute__((visibility("internal"))) ++#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) ++# define _X_EXPORT __global ++# define _X_HIDDEN __hidden ++# define _X_INTERNAL __hidden ++#else /* not gcc >= 4 and not Sun Studio >= 8 */ ++# define _X_EXPORT ++# define _X_HIDDEN ++# define _X_INTERNAL ++#endif /* GNUC >= 4 */ ++ ++/* Branch prediction hints for individual conditionals */ ++/* requires xproto >= 7.0.9 */ ++#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) ++# define _X_LIKELY(x) __builtin_expect(!!(x), 1) ++# define _X_UNLIKELY(x) __builtin_expect(!!(x), 0) ++#else /* not gcc >= 3.3 */ ++# define _X_LIKELY(x) (x) ++# define _X_UNLIKELY(x) (x) ++#endif ++ ++/* Bulk branch prediction hints via marking error path functions as "cold" */ ++/* requires xproto >= 7.0.25 */ ++#if __has_attribute(__cold__) || \ ++ (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) /* 4.3+ */ ++# define _X_COLD __attribute__((__cold__)) ++#else ++# define _X_COLD /* nothing */ ++#endif ++ ++/* Added in X11R6.9, so available in any version of modular xproto */ ++#if __has_attribute(deprecated) \ ++ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \ ++ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130)) ++# define _X_DEPRECATED __attribute__((deprecated)) ++#else /* not gcc >= 3.1 */ ++# define _X_DEPRECATED ++#endif ++ ++/* requires xproto >= 7.0.30 */ ++#if __has_extension(attribute_deprecated_with_message) || \ ++ (defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))) ++# define _X_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg))) ++#else ++# define _X_DEPRECATED_MSG(_msg) _X_DEPRECATED ++#endif ++ ++/* requires xproto >= 7.0.17 */ ++#if __has_attribute(noreturn) \ ++ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ ++ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) ++# define _X_NORETURN __attribute((noreturn)) ++#else ++# define _X_NORETURN ++#endif /* GNUC */ ++ ++/* Added in X11R6.9, so available in any version of modular xproto */ ++#if __has_attribute(__format__) \ ++ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) ++# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y))) ++#else /* not gcc >= 2.3 */ ++# define _X_ATTRIBUTE_PRINTF(x,y) ++#endif ++ ++/* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable ++ argument macros, must be only used inside #ifdef _X_NONNULL guards, as ++ many legacy X clients are compiled in C89 mode still. */ ++#if __has_attribute(nonnull) \ ++ && defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ ++#define _X_NONNULL(...) __attribute__((nonnull(__VA_ARGS__))) ++#elif __has_attribute(nonnull) \ ++ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) ++#define _X_NONNULL(args...) __attribute__((nonnull(args))) ++#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ ++#define _X_NONNULL(...) /* */ ++#endif ++ ++/* requires xproto >= 7.0.22 */ ++#if __has_attribute(__unused__) \ ++ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205) ++#define _X_UNUSED __attribute__((__unused__)) ++#else ++#define _X_UNUSED /* */ ++#endif ++ ++/* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */ ++/* requires xproto >= 7.0.9 ++ (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */ ++#if defined(inline) /* assume autoconf set it correctly */ || \ ++ (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \ ++ (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) ++# define _X_INLINE inline ++#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ ++# define _X_INLINE __inline__ ++#else ++# define _X_INLINE ++#endif ++ ++/* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */ ++/* requires xproto >= 7.0.21 */ ++#ifndef _X_RESTRICT_KYWD ++# if defined(restrict) /* assume autoconf set it correctly */ || \ ++ (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \ ++ && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */ ++# define _X_RESTRICT_KYWD restrict ++# elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ ++# define _X_RESTRICT_KYWD __restrict__ ++# else ++# define _X_RESTRICT_KYWD ++# endif ++#endif ++ ++/* requires xproto >= 7.0.30 */ ++#if __has_attribute(no_sanitize_thread) ++# define _X_NOTSAN __attribute__((no_sanitize_thread)) ++#else ++# define _X_NOTSAN ++#endif ++ ++#endif /* _XFUNCPROTO_H_ */ ++/* ++ * ++Copyright 1989, 1991, 1998 The Open Group ++ ++Permission to use, copy, modify, distribute, and sell this software and its ++documentation for any purpose is hereby granted without fee, provided that ++the above copyright notice appear in all copies and that both that ++copyright notice and this permission notice appear in supporting ++documentation. ++ ++The above copyright notice and this permission notice shall be included in ++all copies or substantial portions of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN ++AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ ++Except as contained in this notice, the name of The Open Group shall not be ++used in advertising or otherwise to promote the sale, use or other dealings ++in this Software without prior written authorization from The Open Group. ++ * ++ */ ++ ++/* Definitions to make function prototypes manageable */ ++ ++#ifndef _XFUNCPROTO_H_ ++#define _XFUNCPROTO_H_ ++ ++#ifndef NeedFunctionPrototypes ++#define NeedFunctionPrototypes 1 ++#endif /* NeedFunctionPrototypes */ ++ ++#ifndef NeedVarargsPrototypes ++#define NeedVarargsPrototypes 1 ++#endif /* NeedVarargsPrototypes */ ++ ++#if NeedFunctionPrototypes ++ ++#ifndef NeedNestedPrototypes ++#define NeedNestedPrototypes 1 ++#endif /* NeedNestedPrototypes */ ++ ++#ifndef _Xconst ++#define _Xconst const ++#endif /* _Xconst */ ++ ++/* Function prototype configuration (see configure for more info) */ + #ifndef NARROWPROTO + #undef NARROWPROTO + #endif Index: emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk @@ -1,6 +1,6 @@ ---- src/VBox/Debugger/Makefile.kmk.orig 2020-05-13 19:39:41 UTC +--- src/VBox/Debugger/Makefile.kmk.orig 2021-01-07 15:37:12 UTC +++ src/VBox/Debugger/Makefile.kmk -@@ -113,6 +113,7 @@ VBoxDbg_SOURCES = \ +@@ -110,6 +110,7 @@ VBoxDbg_SOURCES = \ VBoxDbgBase.cpp \ VBoxDbgConsole.cpp \ VBoxDbgStatsQt.cpp Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp @@ -1,6 +1,6 @@ ---- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig 2020-05-13 19:39:41 UTC +--- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig 2021-01-07 15:37:12 UTC +++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp -@@ -819,6 +819,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP +@@ -820,6 +820,7 @@ static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamPlay continue; } @@ -8,7 +8,7 @@ case -ESTRPIPE: { /* Stream was suspended and waiting for a recovery. */ -@@ -832,6 +833,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP +@@ -833,6 +834,7 @@ static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamPlay LogFlowFunc(("Resumed suspended output stream\n")); continue; } Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp @@ -0,0 +1,31 @@ +--- src/VBox/Devices/Audio/DrvHostOSSAudio.cpp.orig 2021-01-07 15:37:12 UTC ++++ src/VBox/Devices/Audio/DrvHostOSSAudio.cpp +@@ -253,10 +253,11 @@ static int ossStreamOpen(const char *pszDev, int fOpen + + default: + rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE; ++ iFormat = -1; + break; + } + +- if (RT_FAILURE(rc)) ++ if (RT_UNLIKELY(iFormat == -1)) + break; + + if (ioctl(fdFile, SNDCTL_DSP_SAMPLESIZE, &iFormat)) +@@ -664,6 +665,7 @@ static int ossCreateStreamIn(POSSAUDIOSTREAM pStreamOS + + pCfgAcq->Backend.cFramesPeriod = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, ossAcq.cbFragmentSize); + pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering". */ ++ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize; + /** @todo Pre-buffering required? */ + } + } +@@ -782,6 +784,7 @@ static int ossCreateStreamOut(POSSAUDIOSTREAM pStreamO + #endif + pCfgAcq->Backend.cFramesPeriod = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, obtStream.cbFragmentSize); + pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering" */ ++ pCfgAcq->Backend.cFramesPreBuffering = pCfgAcq->Backend.cFramesBufferSize; + } + + } while (0); Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h @@ -0,0 +1,11 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h.orig 2021-01-07 15:39:17 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h +@@ -338,7 +338,7 @@ GLPFN BOOL (WINAPI *pfn_wglMakeCurrent)(HDC, HGLRC); + GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC); + #define wglShareLists pfn_wglShareLists + +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /* + * GLX + */ Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp @@ -0,0 +1,29 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp.orig 2021-01-07 15:39:16 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp +@@ -186,7 +186,7 @@ int glLdrInit(PPDMDEVINS pDevIns) + pfn_wglDeleteContext = 0; + pfn_wglMakeCurrent = 0; + pfn_wglShareLists = 0; +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + pfn_XConfigureWindow = 0; + pfn_XCloseDisplay = 0; + pfn_XCreateColormap = 0; +@@ -296,7 +296,7 @@ int glLdrInit(PPDMDEVINS pDevIns) + GLGETPROC_(wglDeleteContext, ""); + GLGETPROC_(wglMakeCurrent, ""); + GLGETPROC_(wglShareLists, ""); +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + X11GETPROC_(XConfigureWindow); + X11GETPROC_(XCloseDisplay); + X11GETPROC_(XCreateColormap); +@@ -397,7 +397,7 @@ int glLdrInit(PPDMDEVINS pDevIns) + GLGETPROC_(glVertexPointer, ""); + GLGETPROC_(glViewport, ""); + +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + XInitThreads(); + #endif + return VINF_SUCCESS; Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp @@ -0,0 +1,38 @@ +--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp.orig 2021-01-07 15:39:17 UTC ++++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp +@@ -1189,7 +1189,7 @@ int vmsvga3dTerminate(PVGASTATECC pThisCC) + RTSemEventDestroy(pState->WndRequestSem); + #elif defined(RT_OS_DARWIN) + +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /* signal to the thread that it is supposed to exit */ + pState->bTerminate = true; + /* wait for it to terminate */ +@@ -3194,7 +3194,7 @@ int vmsvga3dGenerateMipmaps(PVGASTATECC pThisCC, uint3 + } + + +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + /** + * X11 event handling thread. + * +@@ -3224,7 +3224,7 @@ DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD hThrea + } + return VINF_SUCCESS; + } +-#endif // RT_OS_LINUX ++#endif // RT_OS_FREEBSD || RT_OS_LINUX + + + /** +@@ -4052,7 +4052,7 @@ static int vmsvga3dContextDestroyOgl(PVGASTATECC pThis + AssertRC(rc); + #elif defined(RT_OS_DARWIN) + vmsvga3dCocoaDestroyViewAndContext(pContext->cocoaView, pContext->cocoaContext); +-#elif defined(RT_OS_LINUX) ++#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) + glXMakeCurrent(pState->display, None, NULL); + glXDestroyContext(pState->display, pContext->glxContext); + XDestroyWindow(pState->display, pContext->window); Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk @@ -0,0 +1,44 @@ +--- src/VBox/Devices/Makefile.kmk.orig 2021-01-07 15:39:35 UTC ++++ src/VBox/Devices/Makefile.kmk +@@ -112,6 +112,7 @@ if !defined(VBOX_ONLY_EXTPACKS) + VBoxDDU_LDFLAGS.darwin += -framework IOKit + endif + ++ VBoxDDU_LDFLAGS.freebsd = $(VBOX_GCC_NO_UNDEFINED) + VBoxDDU_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED) + $(call VBOX_SET_VER_INFO_DLL,VBoxDDU,VirtualBox VMM Devices and Drivers Utilities) + +@@ -245,6 +246,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU + -framework SystemConfiguration \ + -framework AVFoundation \ + -framework Foundation ++ VBoxDD_LDFLAGS.freebsd = $(VBOX_GCC_NO_UNDEFINED) + VBoxDD_LDFLAGS.linux = $(VBOX_GCC_NO_UNDEFINED) + + # --- Tracing bits. --- +@@ -287,7 +289,7 @@ if !defined(VBOX_ONLY_EXTPACKS) && "$(intersects $(KBU + VBoxDD_SOURCES += Graphics/DevVGA-SVGA.cpp + endif + ifdef VBOX_WITH_VMSVGA3D +- if1of ($(KBUILD_TARGET), linux win) ++ if1of ($(KBUILD_TARGET), freebsd linux win) + # Dynamically load 3D library (opengl32, libGL). + # This is a temporary solution. In future the 3D backend will be in a separate library. + VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1 +@@ -329,6 +331,7 @@ VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1 + VBoxDD_SOURCES += \ + Graphics/DevVGA-SVGA3d-glLdr.cpp + else ++ VBoxDD_LIBS.freebsd += X11 GL + VBoxDD_LIBS.linux += X11 GL + VBoxDD_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib + endif +@@ -1526,6 +1529,8 @@ if defined(VBOX_WITH_VMSVGA3D) && !defined(VBOX_ONLY_E + VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS) + VBoxSVGA3D_INCS.win := \ + Graphics/shaderlib/libWineStub/include ++ VBoxSVGA3D_INCS.freebsd := \ ++ Graphics/shaderlib/wine/include + VBoxSVGA3D_INCS.linux := \ + Graphics/shaderlib/wine/include + VBoxSVGA3D_INCS.darwin := \ Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk @@ -0,0 +1,20 @@ +--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig 2021-01-07 15:39:44 UTC ++++ src/VBox/Devices/PC/ipxe/Makefile.kmk +@@ -121,7 +121,7 @@ endif + -falign-loops=1 \ + -Os \ + -falign-functions=1 \ +- -mpreferred-stack-boundary=2 \ ++ -mstack-alignment=2 \ + -mregparm=3 \ + -mrtd \ + -freg-struct-return \ +@@ -144,7 +144,7 @@ endif + -falign-jumps=1 \ + -falign-loops=1 \ + -falign-functions=1 \ +- -mpreferred-stack-boundary=2 \ ++ -mstack-alignment=2 \ + -mregparm=3 \ + -mrtd \ + -freg-struct-return \ Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Devices/PC/vbox-cpuhotplug.dsl.orig 2020-07-09 16:55:56 UTC -+++ src/VBox/Devices/PC/vbox-cpuhotplug.dsl -@@ -48,7 +48,7 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB - Device (sck) \ - { \ - Name (_HID, "ACPI0004") \ -- Name (_UID, sckuid) \ -+ Name (_UID, id) \ - \ - \ - Processor (cpu, /* Name */ \ Index: emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp.orig 2017-10-18 07:11:48 UTC -+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - - /** Maximum buffer size supported by the CAM subsystem. */ Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp +++ emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp @@ -1,6 +1,15 @@ ---- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig 2020-05-13 19:43:27 UTC +--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig 2021-01-07 15:40:48 UTC +++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp -@@ -622,7 +622,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub +@@ -646,7 +646,7 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t fSu + " file |\n" + " ]\n" + " [--uarttype<1-N> 16450|16550A|16750]\n" +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + " [--lpt<1-N> off| ]\n" + " [--lptmode<1-N> ]\n" + #endif +@@ -661,7 +661,7 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t fSu RTStrmPrintf(pStrm, "|dsound"); #endif } @@ -9,7 +18,7 @@ { RTStrmPrintf(pStrm, "" #ifdef VBOX_WITH_AUDIO_OSS -@@ -635,22 +635,6 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub +@@ -674,22 +674,6 @@ void printUsage(USAGECATEGORY enmCommand, uint64_t fSu "|pulse" #endif ); Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp @@ -0,0 +1,29 @@ +--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig 2021-01-07 15:40:49 UTC ++++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp +@@ -153,7 +153,7 @@ enum + MODIFYVM_UARTMODE, + MODIFYVM_UARTTYPE, + MODIFYVM_UART, +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + MODIFYVM_LPTMODE, + MODIFYVM_LPT, + #endif +@@ -348,7 +348,7 @@ static const RTGETOPTDEF g_aModifyVMOptions[] = + { "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + { "--uarttype", MODIFYVM_UARTTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + { "--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + { "--lptmode", MODIFYVM_LPTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + { "--lpt", MODIFYVM_LPT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, + #endif +@@ -2278,7 +2278,7 @@ RTEXITCODE handleModifyVM(HandlerArg *a) + break; + } + +-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) ++#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) + case MODIFYVM_LPTMODE: + { + ComPtr lpt; Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk @@ -1,14 +1,14 @@ ---- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig 2020-05-13 19:43:28 UTC +--- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig 2021-01-07 15:40:49 UTC +++ src/VBox/Frontends/VirtualBox/Makefile.kmk -@@ -897,6 +897,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI - VirtualBox_SOURCES += \ +@@ -1186,6 +1186,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI + src/VBox2DHelpers.cpp \ src/VBoxFBOverlay.cpp \ src/VBoxGLSupportInfo.cpp + VirtualBox_CXXFLAGS.freebsd += -std=c++11 endif - # -@@ -1220,6 +1221,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) + $(call VBOX_SET_VER_INFO_EXE,VirtualBox,VirtualBox Manager,$(VBOX_WINDOWS_ICON_FILE)) +@@ -1862,6 +1863,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) VBoxOGL2D_SOURCES = \ src/VBoxGLSupportInfo.cpp VBoxOGL2D_INCS = include Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_globals_UIImageTools.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_globals_UIImageTools.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp.orig 2020-05-18 14:44:12 UTC -+++ src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp -@@ -24,6 +24,7 @@ - - /* Qt includes */ - # include -+# include - - #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ - Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMenuToolBar.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMenuToolBar.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp.orig 2020-05-18 15:10:10 UTC -+++ src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp -@@ -23,6 +23,7 @@ - # include - # include - # include -+# include - # include - # include - Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp.orig 2020-05-18 15:15:26 UTC -+++ src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp -@@ -28,6 +28,7 @@ - # include - # include - # include -+# include - # include - # ifdef VBOX_WS_X11 - # include Index: emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIPopupBox.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIPopupBox.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h.orig 2020-05-18 14:53:03 UTC -+++ src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h -@@ -20,6 +20,7 @@ - - /* Global includes: */ - #include -+#include - #include - - /* Forward declarations: */ Index: emulators/virtualbox-ose/files/patch-src_VBox_GuestHost_OpenGL_include_chromium.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_GuestHost_OpenGL_include_chromium.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/GuestHost/OpenGL/include/chromium.h.orig 2018-05-09 16:38:12 UTC -+++ src/VBox/GuestHost/OpenGL/include/chromium.h -@@ -63,7 +63,7 @@ - #include - /* Quick fix so as not to update the version of glext.h we provide. */ - #ifdef GL_GLEXT_PROTOTYPES --# if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) -+# if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) - GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint); - GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); - GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum); Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp @@ -4,8 +4,8 @@ /** @def SUPDRV_CHECK_SMAP_CHECK * Checks that the AC flag is set if SMAP is enabled. If AC is not set, it * will be logged and @a a_BadExpr is executed. */ --#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) -+#if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) +-#if (defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)) && !defined(VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV) ++#if (defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)) && !defined(VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV) # define SUPDRV_CHECK_SMAP_SETUP() uint32_t const fKernelFeatures = SUPR0GetKernelFeatures() # define SUPDRV_CHECK_SMAP_CHECK(a_pDevExt, a_BadExpr) \ do { \ Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h @@ -1,6 +1,6 @@ ---- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2020-05-13 19:43:52 UTC +--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig 2021-01-07 15:41:25 UTC +++ src/VBox/HostDrivers/Support/SUPDrvInternal.h -@@ -208,7 +208,7 @@ +@@ -217,7 +217,7 @@ # define SUPDRV_WITHOUT_MSR_PROBER #endif Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c @@ -1,14 +1,17 @@ ---- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2020-05-13 19:43:53 UTC +--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig 2021-01-07 15:41:26 UTC +++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c -@@ -46,6 +46,7 @@ +@@ -44,8 +44,10 @@ + #include + #include #include ++#include #include "../SUPDrvInternal.h" +#include "freebsd/the-freebsd-kernel.h" #include #include #include -@@ -57,7 +58,14 @@ +@@ -57,7 +59,14 @@ #include #include #include @@ -23,7 +26,7 @@ #ifdef VBOX_WITH_HARDENING # define VBOXDRV_PERM 0600 #else -@@ -76,7 +84,9 @@ static d_open_t VBoxDrvFreeBSDOpenUsr; +@@ -76,7 +85,9 @@ static d_open_t VBoxDrvFreeBSDOpenUsr; static d_open_t VBoxDrvFreeBSDOpenSys; static void vboxdrvFreeBSDDtr(void *pvData); static d_ioctl_t VBoxDrvFreeBSDIOCtl; @@ -33,7 +36,7 @@ /********************************************************************************************************************************* -@@ -182,6 +192,13 @@ static int VBoxDrvFreeBSDLoad(void) +@@ -182,6 +193,13 @@ static int VBoxDrvFreeBSDLoad(void) rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION)); if (RT_SUCCESS(rc)) { @@ -47,31 +50,9 @@ /* * Configure character devices. Add symbolic links for compatibility. */ -@@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo - PSUPDRVSESSION pSession; - devfs_get_cdevpriv((void **)&pSession); +@@ -324,6 +342,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo -+#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV - /* -+ * Refuse all I/O control calls if we've ever detected EFLAGS.AC being cleared. -+ * -+ * This isn't a problem, as there is absolutely nothing in the kernel context that -+ * depend on user context triggering cleanups. That would be pretty wild, right? -+ */ -+ if (RT_UNLIKELY(g_VBoxDrvFreeBSDDevExt.cBadContextCalls > 0)) -+ { -+ SUPR0Printf("VBoxDrvFreBSDIOCtl: EFLAGS.AC=0 detected %u times, refusing all I/O controls!\n", g_VBoxDrvFreeBSDDevExt.cBadContextCalls); -+ return ESPIPE; -+ } -+#endif -+ -+ /* - * Deal with the fast ioctl path first. - */ - if ( ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN -@@ -325,6 +356,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo - /** + * Alternative Device I/O Control entry point on hosts with SMAP support. + * @@ -115,7 +96,7 @@ * Deal with the 'slow' I/O control requests. * * @returns 0 on success, appropriate errno on failure. -@@ -373,11 +443,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -372,11 +429,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes */ SUPREQHDR Hdr; pvUser = *(void **)pvData; @@ -130,7 +111,7 @@ } if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC)) { -@@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -401,13 +457,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd)); return ENOMEM; } @@ -148,7 +129,7 @@ } if (Hdr.cbIn < cbReq) RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn); -@@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes +@@ -435,9 +490,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd)); cbOut = cbReq; } @@ -160,7 +141,7 @@ Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd)); -@@ -541,8 +608,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE +@@ -540,8 +594,7 @@ bool VBOXCALL supdrvOSGetForcedAsyncTscMode(PSUPDRVDE bool VBOXCALL supdrvOSAreCpusOfflinedOnSuspend(void) { @@ -170,7 +151,7 @@ } -@@ -625,11 +691,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, +@@ -624,11 +677,25 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, #endif /* SUPDRV_WITH_MSR_PROBER */ @@ -196,7 +177,7 @@ va_start(va, pszFormat); cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va); -@@ -637,12 +717,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) +@@ -636,12 +703,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...) printf("%s", szMsg); Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile +@@ -26,7 +26,7 @@ + + KMOD = vboxnetadp + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk +@@ -565,7 +565,7 @@ $(PATH_OUT)/opt_netgraph.h: + $(QUIET)$(RM) -f -- $@ + $(QUIET)$(CP) -f $< $@ + ifndef VBOX_WITH_HARDENING +- $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@.tmp $@ ++ $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@ + ${QUIET}$(MV) -f $@.tmp $@ + endif + ifndef VBOX_WITH_NETFLT_VIMAGE Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile @@ -0,0 +1,11 @@ +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile.orig 2019-05-13 13:33:07 UTC ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile +@@ -26,7 +26,7 @@ + + KMOD = vboxnetflt + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -DVBOX_WITH_HARDENING -DVBOX_WITH_64_BITS_GUESTS -DVIMAGE -Iinclude -I. -Ir0drv -w + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 Index: emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c +++ /dev/null @@ -1,34 +0,0 @@ ---- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig 2020-07-28 21:59:30.107638000 -0700 -+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2020-07-28 22:00:37.858885000 -0700 -@@ -361,7 +361,14 @@ - { - if (mtag != NULL || !fActive) - { -+#if __FreeBSD_version >= 1300049 -+ struct epoch_tracker et; -+ NET_EPOCH_ENTER(et); -+#endif - ether_demux(ifp, m); -+#if __FreeBSD_version >= 1300049 -+ NET_EPOCH_EXIT(et); -+#endif - if (fActive) - vboxNetFltRelease(pThis, true /*fBusy*/); - VBOXCURVNET_RESTORE(); -@@ -457,7 +464,16 @@ - if (fDropIt) - m_freem(m); - else -+ { -+#if __FreeBSD_version >= 1300049 -+ struct epoch_tracker et; -+ NET_EPOCH_ENTER(et); -+#endif - ether_demux(ifp, m); -+#if __FreeBSD_version >= 1300049 -+ NET_EPOCH_EXIT(et); -+#endif -+ } - } - vboxNetFltRelease(pThis, true /* fBusy */); - VBOXCURVNET_RESTORE(); Index: emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/HostServices/SharedOpenGL/Makefile.kmk.orig 2020-05-13 19:43:59 UTC -+++ src/VBox/HostServices/SharedOpenGL/Makefile.kmk -@@ -335,6 +335,7 @@ if ( defined(VBOX_WITH_QTGUI) \ - $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \ - $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) - ifdef VBOX_WITH_VIDEOHWACCEL -+ VBoxTestOGL_CXXFLAGS.freebsd += -std=c++11 - VBoxTestOGL_QT_MODULES += Core Gui OpenGL Widgets - VBoxTestOGL_LIBS.linux += xcb - VBoxTestOGL_LIBS.solaris += xcb Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk @@ -1,6 +1,6 @@ ---- src/VBox/Main/Makefile.kmk.orig 2020-05-13 19:44:04 UTC +--- src/VBox/Main/Makefile.kmk.orig 2021-01-07 15:41:36 UTC +++ src/VBox/Main/Makefile.kmk -@@ -526,6 +526,7 @@ VBoxSVC_SOURCES.os2 = \ +@@ -646,6 +646,7 @@ VBoxSVC_SOURCES.os2 = \ VBoxSVC_SOURCES.freebsd = \ src-server/freebsd/HostHardwareFreeBSD.cpp \ Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_include_HostPower.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_include_HostPower.h +++ emulators/virtualbox-ose/files/patch-src_VBox_Main_include_HostPower.h @@ -1,6 +1,6 @@ ---- src/VBox/Main/include/HostPower.h.orig 2017-10-18 07:12:54 UTC +--- src/VBox/Main/include/HostPower.h.orig 2021-01-07 15:41:38 UTC +++ src/VBox/Main/include/HostPower.h -@@ -28,7 +28,7 @@ +@@ -31,7 +31,7 @@ #include @@ -9,7 +9,7 @@ # include #endif -@@ -64,7 +64,7 @@ class HostPowerServiceWin : public HostPowerService (p +@@ -67,7 +67,7 @@ class HostPowerServiceWin : public HostPowerService (p RTTHREAD mThread; }; # endif Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h +++ /dev/null @@ -1,17 +0,0 @@ ---- src/VBox/Main/include/USBProxyBackend.h.orig 2020-05-13 19:44:06 UTC -+++ src/VBox/Main/include/USBProxyBackend.h -@@ -365,13 +365,10 @@ class USBProxyBackendFreeBSD : public USBProxyBackend - virtual int releaseDevice(HostUSBDevice *aDevice); - - protected: -- int initUsbfs(void); -- int initSysfs(void); - virtual int wait(RTMSINTERVAL aMillies); - virtual int interruptWait(void); - virtual PUSBDEVICE getDevices(void); -- int addDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, int rc); -- virtual void deviceAdded(ComObjPtr &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice); -+ virtual bool isFakeUpdateRequired(); - - private: - RTSEMEVENT mNotifyEventSem; Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp +++ /dev/null @@ -1,20 +0,0 @@ ---- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig 2020-05-13 19:44:07 UTC -+++ src/VBox/Main/src-client/ConsoleImpl2.cpp -@@ -5265,7 +5265,7 @@ int Console::i_configNetwork(const char *pszDevice, - { - switch (hrc) - { -- case VERR_ACCESS_DENIED: -+ case (HRESULT)VERR_ACCESS_DENIED: - return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( - "Failed to open '/dev/net/tun' for read/write access. Please check the " - "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or " -@@ -5467,7 +5467,7 @@ int Console::i_configNetwork(const char *pszDevice, - { - switch (hrc) - { -- case VERR_ACCESS_DENIED: -+ case (HRESULT)VERR_ACCESS_DENIED: - return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS, N_( - "Failed to open '/dev/%s' for read/write access. Please check the " - "permissions of that node, and that the net.link.tap.user_open " Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp +++ emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp @@ -1,6 +1,6 @@ ---- src/VBox/Main/src-server/HostImpl.cpp.orig 2020-05-13 19:44:09 UTC +--- src/VBox/Main/src-server/HostImpl.cpp.orig 2021-01-07 15:41:42 UTC +++ src/VBox/Main/src-server/HostImpl.cpp -@@ -284,7 +284,7 @@ HRESULT Host::init(VirtualBox *aParent) +@@ -286,7 +286,7 @@ HRESULT Host::init(VirtualBox *aParent) #if defined(RT_OS_WINDOWS) m->pHostPowerService = new HostPowerServiceWin(m->pParent); Index: emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp +++ /dev/null @@ -1,19 +0,0 @@ ---- src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp.orig 2017-10-18 07:12:58 UTC -+++ src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp -@@ -43,6 +43,7 @@ - - #include - #include -+#include - - #include - #include -@@ -311,7 +312,7 @@ int NetIfList(std::list wireless = isWireless(pNew->szName); -+ pNew->fWireless = isWireless(pNew->szName); - - ComObjPtr IfObj; - IfObj.createObject(); Index: emulators/virtualbox-ose/files/patch-src_VBox_NetworkServices_Dhcpd_VBoxNetDhcpd.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_NetworkServices_Dhcpd_VBoxNetDhcpd.cpp @@ -0,0 +1,11 @@ +--- src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp.orig 2021-01-07 15:41:46 UTC ++++ src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp +@@ -394,7 +394,7 @@ void VBoxNetDhcpd::ifPump() + WaitReq.Hdr.cbReq = sizeof(WaitReq); + WaitReq.pSession = m_pSession; + WaitReq.hIf = m_hIf; +- WaitReq.cMillies = RT_INDEFINITE_WAIT; ++ WaitReq.cMillies = 2000; + int rc = CALL_VMMR0(VMMR0_DO_INTNET_IF_WAIT, WaitReq); + + /* Index: emulators/virtualbox-ose/files/patch-src_VBox_RDP-client-1.8.4-Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_RDP-client-1.8.4-Makefile.kmk +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/RDP/client-1.8.4/Makefile.kmk.orig 2019-10-10 18:14:11 UTC -+++ src/VBox/RDP/client-1.8.4/Makefile.kmk -@@ -117,7 +117,6 @@ rdesktop-vrdp_SOURCES.solaris = \ - rdesktop-vrdp_SOURCES.freebsd = \ - rdpsnd_oss.c - rdesktop-vrdp_LIBPATH = \ -- /usr/lib \ - $(VBOX_LIBPATH_X11) - rdesktop-vrdp_LIBS = \ - X11 \ Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp.orig 2018-01-15 14:56:07 UTC -+++ src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp -@@ -302,7 +302,7 @@ RTDECL(int) RTErrConvertFromErrno(unsigned uNativeCod - case EILSEQ: return VERR_NO_TRANSLATION; - #endif - #ifdef ERESTART -- case ERESTART: return VERR_INTERRUPTED;/** @todo fix duplicate error?*/ -+ case (unsigned)ERESTART: return VERR_INTERRUPTED;/** @todo fix duplicate error?*/ - #endif - #ifdef ESTRPIPE - //case ESTRPIPE 86 /* Streams pipe error */ Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_alloc-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +++ src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c -@@ -54,6 +54,7 @@ MALLOC_DEFINE(M_IPRTCONT, "iprtcont", "IPRT - contiguo +@@ -78,6 +78,7 @@ MALLOC_DEFINE(M_IPRTCONT, "iprtcont", "IPRT - contiguo DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFlags, PRTMEMHDR *ppHdr) { @@ -8,7 +8,7 @@ size_t cbAllocated = cb; PRTMEMHDR pHdr = NULL; -@@ -76,8 +77,10 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl +@@ -100,8 +101,10 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl cbAllocated = RT_ALIGN_Z(cb + sizeof(*pHdr), PAGE_SIZE); pVmObject = vm_object_allocate(OBJT_DEFAULT, cbAllocated >> PAGE_SHIFT); @@ -20,7 +20,7 @@ /* Addr contains a start address vm_map_find will start searching for suitable space at. */ #if __FreeBSD_version >= 1000055 -@@ -114,6 +117,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl +@@ -138,6 +141,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl fFlags & RTMEMHDR_FLAG_ZEROED ? M_NOWAIT | M_ZERO : M_NOWAIT); } @@ -29,7 +29,7 @@ if (RT_UNLIKELY(!pHdr)) return VERR_NO_MEMORY; -@@ -129,6 +134,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl +@@ -153,6 +158,8 @@ DECLHIDDEN(int) rtR0MemAllocEx(size_t cb, uint32_t fFl DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr) { @@ -38,7 +38,7 @@ pHdr->u32Magic += 1; #ifdef RT_ARCH_AMD64 -@@ -141,11 +148,14 @@ DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr) +@@ -165,11 +172,14 @@ DECLHIDDEN(void) rtR0MemFree(PRTMEMHDR pHdr) else #endif free(pHdr, M_IPRTHEAP); @@ -53,7 +53,7 @@ void *pv; /* -@@ -170,6 +180,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_ +@@ -194,6 +204,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_ *pPhys = vtophys(pv); Assert(!(*pPhys & PAGE_OFFSET_MASK)); } @@ -61,7 +61,7 @@ return pv; } -@@ -179,7 +190,9 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb) +@@ -203,7 +214,9 @@ RTR0DECL(void) RTMemContFree(void *pv, size_t cb) if (pv) { AssertMsg(!((uintptr_t)pv & PAGE_OFFSET_MASK), ("pv=%p\n", pv)); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_assert-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +++ src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c -@@ -44,15 +44,18 @@ +@@ -68,15 +68,18 @@ DECLHIDDEN(void) rtR0AssertNativeMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) { @@ -19,7 +19,7 @@ char szMsg[256]; RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, va); -@@ -60,6 +63,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, +@@ -84,6 +87,7 @@ DECLHIDDEN(void) rtR0AssertNativeMsg2V(bool fInitial, printf("%s", szMsg); NOREF(fInitial); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2020-07-09 16:57:38 UTC +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2020-10-16 16:38:10 UTC +++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c -@@ -105,6 +105,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap(PRTR0MEMOBJINT +@@ -129,6 +129,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap(PRTR0MEMOBJINT DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) { @@ -8,7 +8,7 @@ PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)pMem; int rc; -@@ -121,16 +122,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) +@@ -145,16 +146,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) case RTR0MEMOBJTYPE_LOCK: { @@ -30,7 +30,7 @@ break; } -@@ -194,6 +194,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) +@@ -210,6 +210,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) return VERR_INTERNAL_ERROR; } @@ -38,93 +38,17 @@ return VINF_SUCCESS; } -@@ -224,18 +225,23 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe - #else - VM_OBJECT_UNLOCK(pObject); - #endif -- if (pPages) -+ if (pPages || cTries >= 1) - break; -+#if __FreeBSD_version >= 1100092 -+ if (!vm_page_reclaim_contig(fFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0)) -+ break; -+#elif __FreeBSD_version >= 1000015 - vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh); -+#else -+ vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); -+#endif - cTries++; - } -- -- return pPages; - #else -- while (cTries <= 1) -+ while (1) - { - pPages = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0); -- if (pPages) -+ if (pPages || cTries >= 1) - break; - vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); - cTries++; -@@ -243,11 +249,8 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe - - if (!pPages) - return pPages; --#if __FreeBSD_version >= 1000030 -- VM_OBJECT_WLOCK(pObject); --#else -+ - VM_OBJECT_LOCK(pObject); --#endif - for (vm_pindex_t iPage = 0; iPage < cPages; iPage++) - { - vm_page_t pPage = pPages + iPage; -@@ -259,13 +262,9 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe - atomic_add_int(&cnt.v_wire_count, 1); - } - } --#if __FreeBSD_version >= 1000030 -- VM_OBJECT_WUNLOCK(pObject); --#else - VM_OBJECT_UNLOCK(pObject); - #endif - return pPages; --#endif - } - - static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages, -@@ -292,16 +291,17 @@ static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_ - #else - VM_OBJECT_LOCK(pObject); - #endif -+ - while (iPage-- > 0) - { - pPage = vm_page_lookup(pObject, iPage); --#if __FreeBSD_version < 1000000 -+#if __FreeBSD_version < 900000 - vm_page_lock_queues(); - #endif - if (fWire) - vm_page_unwire(pPage, 0); - vm_page_free(pPage); --#if __FreeBSD_version < 1000000 -+#if __FreeBSD_version < 900000 - vm_page_unlock_queues(); - #endif - } -@@ -323,7 +323,8 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE +@@ -320,7 +321,8 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE size_t cPages = atop(pMemFreeBSD->Core.cb); int rc; - pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages); + pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, -+ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); ++ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); /* No additional object reference for auto-deallocation upon unmapping. */ #if __FreeBSD_version >= 1000055 -@@ -364,58 +365,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE +@@ -361,58 +363,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE } DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) { @@ -202,7 +126,7 @@ return rc; } -@@ -425,6 +445,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -422,6 +443,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB RTHCPHYS PhysHighest, size_t uAlignment, bool fContiguous, int rcNoMem) { @@ -210,7 +134,7 @@ uint32_t cPages = atop(cb); vm_paddr_t VmPhysAddrHigh; -@@ -432,9 +453,13 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -429,9 +451,13 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), enmType, NULL, cb); if (!pMemFreeBSD) @@ -221,11 +145,11 @@ - pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb)); + pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL, -+ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); ++ pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred); if (PhysHighest != NIL_RTHCPHYS) VmPhysAddrHigh = PhysHighest; -@@ -470,6 +495,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB +@@ -459,6 +485,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB rtR0MemObjDelete(&pMemFreeBSD->Core); } @@ -233,7 +157,7 @@ return rc; } -@@ -489,17 +515,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMO +@@ -478,17 +505,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMO DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy) { AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED); @@ -256,7 +180,7 @@ return VINF_SUCCESS; } -@@ -511,6 +542,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER +@@ -500,6 +532,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER vm_offset_t AddrStart, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process, int fFlags) { @@ -264,7 +188,7 @@ int rc; NOREF(fAccess); -@@ -519,21 +551,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER +@@ -508,21 +541,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER if (!pMemFreeBSD) return VERR_NO_MEMORY; @@ -301,7 +225,7 @@ return VERR_NO_MEMORY;/** @todo fix mach -> vbox error conversion for freebsd. */ } -@@ -569,6 +608,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOB +@@ -558,6 +598,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOB */ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, vm_map_t pMap) { @@ -309,7 +233,7 @@ int rc; /* -@@ -626,11 +666,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN +@@ -615,11 +656,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN pMemFreeBSD->Core.pv = (void *)MapAddress; pMemFreeBSD->Core.u.ResVirt.R0Process = R0Process; *ppMem = &pMemFreeBSD->Core; @@ -323,7 +247,7 @@ return rc; } -@@ -652,6 +694,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveUser(PPRTR0MEMO +@@ -641,6 +684,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveUser(PPRTR0MEMO DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt, size_t offSub, size_t cbSub) { @@ -332,7 +256,7 @@ // AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); -@@ -707,6 +751,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ +@@ -697,6 +742,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ Assert((vm_offset_t)pMemFreeBSD->Core.pv == Addr); pMemFreeBSD->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; *ppMem = &pMemFreeBSD->Core; @@ -340,7 +264,7 @@ return VINF_SUCCESS; } rc = vm_map_remove(kernel_map, Addr, Addr + cbSub); -@@ -715,6 +760,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ +@@ -705,6 +751,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ else vm_object_deallocate(pMemToMapFreeBSD->pObject); @@ -348,43 +272,39 @@ return VERR_NO_MEMORY; } -@@ -722,6 +768,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ +@@ -712,6 +759,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, - unsigned fProt, RTR0PROCESS R0Process) + unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub) { + IPRT_FREEBSD_SAVE_EFL_AC(); + /* * Check for unsupported stuff. */ -@@ -751,7 +799,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN - { - /** @todo is this needed?. */ - PROC_LOCK(pProc); -- AddrR3 = round_page((vm_offset_t)pProc->p_vmspace->vm_daddr + lim_max(pProc, RLIMIT_DATA)); -+ AddrR3 = round_page((vm_offset_t)pProc->p_vmspace->vm_daddr + -+#if __FreeBSD_version >= 1100077 -+ lim_max_proc(pProc, RLIMIT_DATA)); -+#else -+ lim_max(pProc, RLIMIT_DATA)); -+#endif - PROC_UNLOCK(pProc); - } - else -@@ -774,10 +827,9 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN +@@ -768,47 +817,53 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN 0); /* copy-on-write and similar flags */ if (rc == KERN_SUCCESS) -- { - rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); -- AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc)); -- ++ rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + cbSub, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); + if (rc == KERN_SUCCESS) -+ { - rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_INHERIT_SHARE); + { +- rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); ++ rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + cbSub, VM_INHERIT_SHARE); AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc)); -@@ -793,6 +845,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN +- rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_INHERIT_SHARE); +- AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc)); +- + /* + * Create a mapping object for it. + */ + PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD), + RTR0MEMOBJTYPE_MAPPING, + (void *)AddrR3, +- pMemToMap->cb); ++ cbSub); + if (pMemFreeBSD) + { Assert((vm_offset_t)pMemFreeBSD->Core.pv == AddrR3); pMemFreeBSD->Core.u.Mapping.R0Process = R0Process; *ppMem = &pMemFreeBSD->Core; @@ -392,7 +312,10 @@ return VINF_SUCCESS; } -@@ -802,19 +855,25 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN +- rc = vm_map_remove(pProcMap, AddrR3, AddrR3 + pMemToMap->cb); ++ rc = vm_map_remove(pProcMap, AddrR3, AddrR3 + cbSub /* XXX pMemToMap->cb*/ ); + AssertMsg(rc == KERN_SUCCESS, ("Deleting mapping failed\n")); + } else vm_object_deallocate(pMemToMapFreeBSD->pObject); @@ -418,7 +341,7 @@ if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE) ProtectionFlags = VM_PROT_NONE; -@@ -825,7 +884,12 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT +@@ -819,7 +874,12 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC) ProtectionFlags |= VM_PROT_EXECUTE; @@ -431,7 +354,7 @@ if (krc == KERN_SUCCESS) return VINF_SUCCESS; -@@ -850,11 +914,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P +@@ -844,11 +904,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage); @@ -455,7 +378,7 @@ } case RTR0MEMOBJTYPE_MAPPING: -@@ -863,11 +935,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P +@@ -857,11 +925,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) { @@ -472,18 +395,14 @@ } return vtophys(pb); } -@@ -877,6 +953,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P - case RTR0MEMOBJTYPE_PHYS_NC: +@@ -872,9 +944,11 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P { RTHCPHYS addr; + + IPRT_FREEBSD_SAVE_EFL_AC(); - #if __FreeBSD_version >= 1000030 VM_OBJECT_WLOCK(pMemFreeBSD->pObject); - #else -@@ -888,6 +965,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P - #else - VM_OBJECT_UNLOCK(pMemFreeBSD->pObject); - #endif + addr = VM_PAGE_TO_PHYS(vm_page_lookup(pMemFreeBSD->pObject, iPage)); + VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject); + IPRT_FREEBSD_RESTORE_EFL_AC(); return addr; } Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c @@ -1,22 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig 2019-04-16 10:17:21 UTC +++ src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c -@@ -36,6 +36,15 @@ - #include - #include "r0drv/mp-r0drv.h" - -+#if __FreeBSD_version >= 700000 && __FreeBSD_version < 900000 -+#define cpuset_t cpumask_t -+#define all_cpus (~(cpumask_t)0) -+#define CPU_CLR(n, p) do { *(p) &= ~((cpumask_t)1 << (n)); } while (0) -+#define CPU_SETOF(n, p) do { *(p) = (cpumask_t)1 << (n); } while (0) -+#endif -+#if __FreeBSD_version < 1200028 -+#define smp_no_rendezvous_barrier smp_no_rendevous_barrier -+#endif - - RTDECL(RTCPUID) RTMpCpuId(void) - { -@@ -143,7 +152,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void) +@@ -147,7 +147,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void) static void rtmpOnAllFreeBSDWrapper(void *pvArg) { PRTMPARGS pArgs = (PRTMPARGS)pvArg; @@ -26,18 +10,17 @@ } -@@ -155,7 +166,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p +@@ -159,7 +161,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p Args.pvUser2 = pvUser2; Args.idCpu = NIL_RTCPUID; Args.cHits = 0; -- smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendevous_barrier, &Args); + IPRT_FREEBSD_SAVE_EFL_AC(); -+ smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; } -@@ -171,7 +184,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) +@@ -175,7 +179,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg) PRTMPARGS pArgs = (PRTMPARGS)pvArg; RTCPUID idCpu = curcpu; if (pArgs->idCpu != idCpu) @@ -49,35 +32,15 @@ } -@@ -180,10 +197,8 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void - /* Will panic if no rendezvousing cpus, so check up front. */ - if (RTMpGetOnlineCount() > 1) - { --#if __FreeBSD_version >= 900000 -- cpuset_t Mask; --#elif __FreeBSD_version >= 700000 -- cpumask_t Mask; -+#if __FreeBSD_version >= 700000 -+ cpuset_t Cpus; - #endif - RTMPARGS Args; - -@@ -192,17 +207,15 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void +@@ -196,6 +204,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void Args.pvUser2 = pvUser2; Args.idCpu = RTMpCpuId(); Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 700000 --# if __FreeBSD_version >= 900000 -- Mask = all_cpus; -- CPU_CLR(curcpu, &Mask); --# else -- Mask = ~(cpumask_t)curcpu; --# endif -- smp_rendezvous_cpus(Mask, NULL, rtmpOnOthersFreeBSDWrapper, smp_no_rendevous_barrier, &Args); -+ Cpus = all_cpus; -+ CPU_CLR(curcpu, &Cpus); -+ smp_rendezvous_cpus(Cpus, NULL, rtmpOnOthersFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + # if __FreeBSD_version >= 900000 + Mask = all_cpus; +@@ -207,6 +216,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void #else smp_rendezvous(NULL, rtmpOnOthersFreeBSDWrapper, NULL, &Args); #endif @@ -85,7 +48,7 @@ } return VINF_SUCCESS; } -@@ -220,18 +233,18 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) +@@ -224,8 +234,10 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg) RTCPUID idCpu = curcpu; if (pArgs->idCpu == idCpu) { @@ -96,32 +59,15 @@ } } - - RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) - { --#if __FreeBSD_version >= 900000 -- cpuset_t Mask; --#elif __FreeBSD_version >= 700000 -- cpumask_t Mask; -+#if __FreeBSD_version >= 700000 -+ cpuset_t Cpus; - #endif - RTMPARGS Args; - -@@ -244,16 +257,14 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE +@@ -248,6 +260,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE Args.pvUser2 = pvUser2; Args.idCpu = idCpu; Args.cHits = 0; + IPRT_FREEBSD_SAVE_EFL_AC(); #if __FreeBSD_version >= 700000 --# if __FreeBSD_version >= 900000 -- CPU_SETOF(idCpu, &Mask); --# else -- Mask = (cpumask_t)1 << idCpu; --# endif -- smp_rendezvous_cpus(Mask, NULL, rtmpOnSpecificFreeBSDWrapper, smp_no_rendevous_barrier, &Args); -+ CPU_SETOF(idCpu, &Cpus); -+ smp_rendezvous_cpus(Cpus, NULL, rtmpOnSpecificFreeBSDWrapper, smp_no_rendezvous_barrier, &Args); + # if __FreeBSD_version >= 900000 + CPU_SETOF(idCpu, &Mask); +@@ -258,6 +271,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE #else smp_rendezvous(NULL, rtmpOnSpecificFreeBSDWrapper, NULL, &Args); #endif @@ -129,30 +75,17 @@ return Args.cHits == 1 ? VINF_SUCCESS : VERR_CPU_NOT_FOUND; -@@ -273,22 +284,16 @@ static void rtmpFreeBSDPokeCallback(void *pvArg) - - RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) - { --#if __FreeBSD_version >= 900000 -- cpuset_t Mask; --#elif __FreeBSD_version >= 700000 -- cpumask_t Mask; --#endif -+ cpuset_t Cpus; - - /* Will panic if no rendezvousing cpus, so make sure the cpu is online. */ +@@ -287,12 +301,14 @@ RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) if (!RTMpIsCpuOnline(idCpu)) return VERR_CPU_NOT_FOUND; --# if __FreeBSD_version >= 900000 -- CPU_SETOF(idCpu, &Mask); --# else -- Mask = (cpumask_t)1 << idCpu; --# endif -- smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendevous_barrier, NULL); + IPRT_FREEBSD_SAVE_EFL_AC(); -+ CPU_SETOF(idCpu, &Cpus); -+ smp_rendezvous_cpus(Cpus, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL); + # if __FreeBSD_version >= 900000 + CPU_SETOF(idCpu, &Mask); + # else + Mask = (cpumask_t)1 << idCpu; + # endif + smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL); + IPRT_FREEBSD_RESTORE_EFL_AC(); return VINF_SUCCESS; Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semevent-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +++ src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c -@@ -77,7 +77,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem +@@ -101,7 +101,9 @@ RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL)); AssertPtrReturn(phEventSem, VERR_INVALID_POINTER); @@ -10,7 +10,7 @@ if (!pThis) return VERR_NO_MEMORY; -@@ -128,10 +130,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) +@@ -152,10 +154,12 @@ RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) /* * Invalidate it and signal the object just in case. */ @@ -23,7 +23,7 @@ return VINF_SUCCESS; } -@@ -149,9 +153,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) +@@ -173,9 +177,11 @@ RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) /* * Signal the event object. */ @@ -35,7 +35,7 @@ return VINF_SUCCESS; } -@@ -175,6 +181,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, +@@ -199,6 +205,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, AssertPtrReturn(pThis, VERR_INVALID_PARAMETER); AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER); AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER); @@ -43,7 +43,7 @@ rtR0SemEventBsdRetain(pThis); /* -@@ -224,6 +231,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, +@@ -248,6 +255,7 @@ static int rtR0SemEventWait(PRTSEMEVENTINTERNAL pThis, } rtR0SemEventBsdRelease(pThis); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semeventmulti-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +++ src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c -@@ -96,7 +96,9 @@ RTDECL(int) RTSemEventMultiCreateEx(PRTSEMEVENTMULTI +@@ -120,7 +120,9 @@ RTDECL(int) RTSemEventMultiCreateEx(PRTSEMEVENTMULTI PRTSEMEVENTMULTIINTERNAL pThis; AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); @@ -10,7 +10,7 @@ if (pThis) { pThis->u32Magic = RTSEMEVENTMULTI_MAGIC; -@@ -152,10 +154,12 @@ RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hE +@@ -176,10 +178,12 @@ RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hE /* * Invalidate it and signal the object just in case. */ @@ -23,7 +23,7 @@ return VINF_SUCCESS; } -@@ -164,6 +168,7 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv +@@ -188,6 +192,7 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv { uint32_t fNew; uint32_t fOld; @@ -31,7 +31,7 @@ /* * Validate input. -@@ -190,12 +195,15 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv +@@ -214,12 +219,15 @@ RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEv rtR0SemBsdBroadcast(pThis); rtR0SemEventMultiBsdRelease(pThis); @@ -47,7 +47,7 @@ /* * Validate input. */ -@@ -212,6 +220,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve +@@ -236,6 +244,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve ASMAtomicAndU32(&pThis->fStateAndGen, ~RTSEMEVENTMULTIBSD_STATE_MASK); rtR0SemEventMultiBsdRelease(pThis); @@ -55,7 +55,7 @@ return VINF_SUCCESS; } -@@ -228,6 +237,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve +@@ -252,6 +261,7 @@ RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEve static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout, PCRTLOCKVALSRCPOS pSrcPos) { @@ -63,7 +63,7 @@ uint32_t fOrgStateAndGen; int rc; -@@ -287,6 +297,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN +@@ -311,6 +321,7 @@ static int rtR0SemEventMultiBsdWait(PRTSEMEVENTMULTIIN } rtR0SemEventMultiBsdRelease(pThis); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_semfastmutex-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c.orig 2021-01-07 15:42:08 UTC +++ src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c -@@ -62,6 +62,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa +@@ -86,6 +86,7 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa { AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *)); AssertPtrReturn(phFastMtx, VERR_INVALID_POINTER); @@ -8,7 +8,7 @@ PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); if (pThis) -@@ -70,8 +71,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa +@@ -94,8 +95,10 @@ RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFa sx_init_flags(&pThis->SxLock, "IPRT Fast Mutex Semaphore", SX_DUPOK); *phFastMtx = pThis; @@ -19,7 +19,7 @@ return VERR_NO_MEMORY; } -@@ -83,11 +86,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas +@@ -107,11 +110,13 @@ RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFas return VINF_SUCCESS; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); @@ -33,7 +33,7 @@ return VINF_SUCCESS; } -@@ -97,8 +102,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas +@@ -121,8 +126,11 @@ RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFas PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); @@ -45,7 +45,7 @@ return VINF_SUCCESS; } -@@ -108,8 +116,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas +@@ -132,8 +140,11 @@ RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFas PRTSEMFASTMUTEXINTERNAL pThis = hFastMtx; AssertPtrReturn(pThis, VERR_INVALID_HANDLE); AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("%p: u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_spinlock-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +++ src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c -@@ -82,7 +82,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u +@@ -106,7 +106,9 @@ RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, u * Allocate. */ AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *)); @@ -10,7 +10,7 @@ if (!pThis) return VERR_NO_MEMORY; -@@ -116,7 +118,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) +@@ -140,7 +142,9 @@ RTDECL(int) RTSpinlockDestroy(RTSPINLOCK Spinlock) * Make the lock invalid and release the memory. */ ASMAtomicIncU32(&pThis->u32Magic); @@ -20,7 +20,7 @@ return VINF_SUCCESS; } -@@ -142,6 +146,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) +@@ -166,6 +170,7 @@ RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock) { RT_ASSERT_PREEMPT_CPUID_SPIN_ACQUIRED(pThis); pThis->fIntSaved = fIntSaved; Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_the-freebsd-kernel.h @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig 2020-07-09 16:57:38 UTC +--- src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig 2021-01-07 15:42:09 UTC +++ src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h -@@ -60,6 +60,7 @@ +@@ -87,6 +87,7 @@ #include #include #include @@ -8,7 +8,7 @@ #include #include /* for vtophys */ #include -@@ -67,10 +68,10 @@ +@@ -94,10 +95,10 @@ #include #include /* KERN_SUCCESS ++ */ #include @@ -20,7 +20,7 @@ #include #include -@@ -114,6 +115,24 @@ +@@ -155,6 +156,24 @@ */ #if 0 /** @todo Not available yet. */ # define USE_KMEM_ALLOC_PROT @@ -44,4 +44,4 @@ +# define IPRT_FREEBSD_RESTORE_EFL_ONLY_AC_EX(f) do { } while (0) #endif - #endif + #endif /* !IPRT_INCLUDED_SRC_r0drv_freebsd_the_freebsd_kernel_h */ Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_thread2-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +++ src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c -@@ -70,6 +70,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT +@@ -94,6 +94,8 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT return VERR_INVALID_PARAMETER; } @@ -9,7 +9,7 @@ #if __FreeBSD_version < 700000 /* Do like they're doing in subr_ntoskrnl.c... */ mtx_lock_spin(&sched_lock); -@@ -86,6 +88,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT +@@ -110,6 +112,7 @@ DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT thread_unlock(curthread); #endif @@ -17,7 +17,7 @@ return VINF_SUCCESS; } -@@ -135,6 +138,7 @@ static void rtThreadNativeMain(void *pvThreadInt) +@@ -159,6 +162,7 @@ static void rtThreadNativeMain(void *pvThreadInt) DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread) { @@ -25,7 +25,7 @@ int rc; struct proc *pProc; -@@ -150,6 +154,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr +@@ -174,6 +178,7 @@ DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThr } else rc = RTErrConvertFromErrno(rc); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_time-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig 2016-07-18 11:56:55 UTC +--- src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +++ src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c -@@ -40,16 +40,23 @@ +@@ -64,16 +64,23 @@ RTDECL(uint64_t) RTTimeNanoTS(void) { @@ -29,7 +29,7 @@ } -@@ -67,8 +74,7 @@ RTDECL(uint64_t) RTTimeSystemMilliTS(voi +@@ -91,8 +98,7 @@ RTDECL(uint64_t) RTTimeSystemMilliTS(void) RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) { Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_timer-r0drv-freebsd.c @@ -1,6 +1,6 @@ ---- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig 2018-10-15 14:31:31 UTC +--- src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c.orig 2021-01-07 15:42:09 UTC +++ src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c -@@ -92,6 +92,7 @@ static void rtTimerFreeBSDCallback(void *pvTimer); +@@ -116,6 +116,7 @@ static void rtTimerFreeBSDCallback(void *pvTimer); RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, uint32_t fFlags, PFNRTTIMER pfnTimer, void *pvUser) { *ppTimer = NULL; @@ -8,7 +8,7 @@ /* * Validate flags. -@@ -121,6 +122,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ +@@ -145,6 +146,7 @@ RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_ callout_init(&pTimer->Callout, CALLOUT_MPSAFE); *ppTimer = pTimer; @@ -16,7 +16,7 @@ return VINF_SUCCESS; } -@@ -141,6 +143,8 @@ DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer) +@@ -165,6 +167,8 @@ DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer) RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) { @@ -25,7 +25,7 @@ /* It's ok to pass NULL pointer. */ if (pTimer == /*NIL_RTTIMER*/ NULL) return VINF_SUCCESS; -@@ -153,6 +157,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) +@@ -177,6 +181,8 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) pTimer->u32Magic++; callout_stop(&pTimer->Callout); RTMemFree(pTimer); @@ -34,7 +34,7 @@ return VINF_SUCCESS; } -@@ -160,6 +166,7 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) +@@ -184,6 +190,7 @@ RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First) { struct timeval tv; @@ -42,7 +42,7 @@ if (!rtTimerIsValid(pTimer)) return VERR_INVALID_HANDLE; -@@ -183,12 +190,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 +@@ -207,12 +214,15 @@ RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64 tv.tv_usec = (u64First % 1000000000) / 1000; callout_reset(&pTimer->Callout, tvtohz(&tv), rtTimerFreeBSDCallback, pTimer); @@ -58,7 +58,7 @@ if (!rtTimerIsValid(pTimer)) return VERR_INVALID_HANDLE; if (pTimer->fSuspended) -@@ -200,6 +210,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer) +@@ -224,6 +234,7 @@ RTDECL(int) RTTimerStop(PRTTIMER pTimer) pTimer->fSuspended = true; callout_stop(&pTimer->Callout); Index: emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp @@ -0,0 +1,29 @@ +--- src/VBox/Runtime/r3/posix/process-creation-posix.cpp.orig 2021-01-07 15:42:15 UTC ++++ src/VBox/Runtime/r3/posix/process-creation-posix.cpp +@@ -30,7 +30,7 @@ + *********************************************************************************************************************************/ + #define LOG_GROUP RTLOGGROUP_PROCESS + #include +-#ifdef RT_OS_LINUX ++#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) + # define IPRT_WITH_DYNAMIC_CRYPT_R + #endif + #if (defined(RT_OS_LINUX) || defined(RT_OS_OS2)) && !defined(_GNU_SOURCE) +@@ -64,7 +64,7 @@ + # include + #endif + +-#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) ++#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) + /* While Solaris has posix_spawn() of course we don't want to use it as + * we need to have the child in a different process contract, no matter + * whether it is started detached or not. */ +@@ -372,7 +372,7 @@ static int rtCheckCredentials(const char *pszUser, con + if (pPwd->pw_passwd && *pPwd->pw_passwd) + # endif + { +-# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) ++# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) + # ifdef IPRT_WITH_DYNAMIC_CRYPT_R + size_t const cbCryptData = RT_MAX(sizeof(struct crypt_data) * 2, _256K); + # else Index: emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/VMM/VMMR0/GVMMR0.cpp.orig 2020-05-13 19:44:47 UTC -+++ src/VBox/VMM/VMMR0/GVMMR0.cpp -@@ -1243,7 +1243,7 @@ static void gvmmR0CleanupVM(PGVM pGVM) - - GMMR0CleanupVM(pGVM); - -- AssertCompile((uintptr_t)NIL_RTTHREADCTXHOOK == 0); /* Depends on zero initialized memory working for NIL at the moment. */ -+ AssertCompile(NIL_RTTHREADCTXHOOK == (RTTHREADCTXHOOK)0); /* Depends on zero initialized memory working for NIL at the moment. */ - for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++) - { - /** @todo Can we busy wait here for all thread-context hooks to be Index: emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/VMM/VMMR3/VMReq.cpp.orig 2018-01-15 14:56:37 UTC -+++ src/VBox/VMM/VMMR3/VMReq.cpp -@@ -669,7 +669,7 @@ VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, - Assert(pReq->enmType == VMREQTYPE_INVALID); - Assert(pReq->enmState == VMREQSTATE_FREE); - Assert(pReq->pUVM == pUVM); -- ASMAtomicXchgSize(&pReq->pNext, NULL); -+ ASMAtomicXchgSize(&pReq->pNext, (uintptr_t)NULL); - pReq->enmState = VMREQSTATE_ALLOCATED; - pReq->iStatus = VERR_VM_REQUEST_STATUS_STILL_PENDING; - pReq->fFlags = VMREQFLAGS_VBOX_STATUS; Index: emulators/virtualbox-ose/files/patch-src_VBox_VMM_include_IEMInternal.h =================================================================== --- emulators/virtualbox-ose/files/patch-src_VBox_VMM_include_IEMInternal.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/VBox/VMM/include/IEMInternal.h.orig 2020-04-14 19:58:48 UTC -+++ src/VBox/VMM/include/IEMInternal.h -@@ -1082,7 +1082,7 @@ typedef enum IEMACCESSCRX - - #if defined(__GNUC__) && defined(RT_ARCH_X86) - # define IEM_DECL_IMPL_TYPE(a_RetType, a_Name, a_ArgList) \ -- __attribute__((__fastcall__)) a_RetType (a_Name) a_ArgList -+ __attribute__((__fastcall__, __nothrow__)) a_RetType (a_Name) a_ArgList - # define IEM_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) \ - __attribute__((__fastcall__, __nothrow__)) a_RetType a_Name a_ArgList - Index: emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_Makefile.kmk +++ emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_Makefile.kmk @@ -1,6 +1,6 @@ ---- src/libs/xpcom18a4/Makefile.kmk.orig 2019-01-25 18:32:58 UTC +--- src/libs/xpcom18a4/Makefile.kmk.orig 2021-01-07 15:44:04 UTC +++ src/libs/xpcom18a4/Makefile.kmk -@@ -980,6 +980,8 @@ VBoxXPCOM_LIBS = \ +@@ -985,6 +985,8 @@ VBoxXPCOM_LIBS = \ $(VBox-xpcom-proxy_1_TARGET) \ $(VBox-xpcom-nspr_1_TARGET) \ $(VBoxXPCOMGlue_s_1_TARGET) Index: emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c =================================================================== --- emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c +++ emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c @@ -1,4 +1,4 @@ ---- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2020-05-13 19:46:23 UTC +--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig 2019-04-16 10:18:41 UTC +++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c @@ -49,6 +49,9 @@ #include @@ -10,13 +10,11 @@ static pthread_mutexattr_t _pt_mattr; static pthread_condattr_t _pt_cvar_attr; -@@ -798,7 +801,8 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char * +@@ -798,6 +801,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char * * From the semctl(2) man page in glibc 2.0 */ #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \ -- || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) + || (defined(FREEBSD) && __FreeBSD_version < 1200059) \ -+ || defined(OPENBSD) || defined(BSDI) + || defined(OPENBSD) || defined(BSDI) /* union semun is defined by including */ #else - /* according to X/OPEN we have to define it ourselves */ Index: emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp =================================================================== --- emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp +++ /dev/null @@ -1,38 +0,0 @@ ---- src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp.orig 2019-10-10 18:15:53 UTC -+++ src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp -@@ -143,11 +143,22 @@ XPTC_InvokeByIndex(nsISupports * that, PRUint32 method - if (nr_stack) - nr_stack = (nr_stack + 1) & ~1; - -+#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__) - // Load parameters to stack, if necessary - PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8); -+#else -+ typedef struct { PRUint64 stack[20]; } methodStack; -+ if (nr_stack > 20) -+ return NS_ERROR_CALL_FAILED; -+ methodStack stack; -+#endif - PRUint64 gpregs[GPR_COUNT]; - double fpregs[FPR_COUNT]; -+#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__) - invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs); -+#else -+ invoke_copy_to_stack(stack.stack, paramCount, params, gpregs, fpregs); -+#endif - - // Load FPR registers from fpregs[] - register double d0 asm("xmm0"); -@@ -205,7 +216,12 @@ XPTC_InvokeByIndex(nsISupports * that, PRUint32 method - methodAddress += 8 * methodIndex; - methodAddress = *((PRUint64 *)methodAddress); - -+#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__) - typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64); - PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5); -+#else -+ typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, methodStack); -+ PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5, stack); -+#endif - return result; - } Index: emulators/virtualbox-ose/files/patch-src_recompiler_Makefile.kmk =================================================================== --- emulators/virtualbox-ose/files/patch-src_recompiler_Makefile.kmk +++ /dev/null @@ -1,12 +0,0 @@ ---- src/recompiler/Makefile.kmk.orig 2019-01-25 18:33:40 UTC -+++ src/recompiler/Makefile.kmk -@@ -63,6 +63,9 @@ else - # Missing fpclassify. Is there a better define or flag for this? - VBoxRemPrimary_DEFS.solaris += __C99FEATURES__ - endif # win -+# XXX Work around a linker issue with GCC 8.x & LLD: -+# ld: error: translate.c:(.debug_loc+0xA40FD): has non-ABS relocation R_386_GOTOFF against symbol 'cpu_regs' -+VBoxRemPrimary_CFLAGS.freebsd.x86 += -g0 - VBoxRemPrimary_DEFS += IN_REM_R3 REM_INCLUDE_CPU_H NEED_CPU_H - #VBoxRemPrimary_DEFS += REM_PHYS_ADDR_IN_TLB - #VBoxRemPrimary_DEFS += DEBUG_ALL_LOGGING DEBUG_DISAS DEBUG_PCALL CONFIG_DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB # Enables huge amounts of debug logging. Index: emulators/virtualbox-ose/pkg-plist =================================================================== --- emulators/virtualbox-ose/pkg-plist +++ emulators/virtualbox-ose/pkg-plist @@ -6,6 +6,7 @@ %%X11%%bin/VBoxSDL bin/VBoxVRDP %%QT%%bin/VirtualBox +%%QT%%bin/VirtualBoxVM bin/vboxautostart bin/vboxballoonctrl bin/vboxbugreport @@ -14,6 +15,7 @@ %%X11%%bin/vboxsdl %%WEBSERVICE%%bin/vboxwebsrv %%QT%%bin/virtualbox +%%QT%%bin/virtualboxvm include/virtualbox/VirtualBox_XPCOM.h include/virtualbox/ipcIClientObserver.h include/virtualbox/ipcIDConnectService.h @@ -378,8 +380,8 @@ lib/virtualbox/VBoxDD.so lib/virtualbox/VBoxDD2.so lib/virtualbox/VBoxDDR0.r0 -lib/virtualbox/VBoxDDRC.rc lib/virtualbox/VBoxDDU.so +%%QT%%lib/virtualbox/UICommon.so %%QT%%lib/virtualbox/VBoxDbg.so %%QT%%lib/virtualbox/VBoxDragAndDropSvc.so lib/virtualbox/VBoxEFI32.fd @@ -399,15 +401,14 @@ lib/virtualbox/VBoxNetNAT.so %%PYTHON%%lib/virtualbox/VBoxPython.so %%PYTHON%%lib/virtualbox/VBoxPython%%PYTHON_VERU%%.so -lib/virtualbox/VBoxREM.so %%I386%%lib/virtualbox/VBoxREM32.so %%I386%%lib/virtualbox/VBoxREM64.so lib/virtualbox/VBoxRT.so %%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL %%X11%%lib/virtualbox/VBoxSDL.so lib/virtualbox/VBoxSVC +%%X11%%lib/virtualbox/VBoxSVGA3D.so %%X11%%lib/virtualbox/VBoxSharedClipboard.so -%%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so lib/virtualbox/VBoxSharedFolders.so %%QT%%lib/virtualbox/VBoxTestOGL lib/virtualbox/VBoxVMM.so @@ -416,9 +417,9 @@ lib/virtualbox/VBoxXPCOMC.so lib/virtualbox/VBoxXPCOMIPCD lib/virtualbox/VMMR0.r0 -lib/virtualbox/VMMRC.rc -%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBox -%%QT%%lib/virtualbox/VirtualBox.so +%%QT%%lib/virtualbox/VirtualBox +%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM +%%QT%%lib/virtualbox/VirtualBoxVM.so %%SDK%%lib/virtualbox/sdk %%WEBSERVICE%%lib/virtualbox/vboxwebsrv %%WEBSERVICE%%lib/virtualbox/webtest