View | Details | Raw Unified | Return to bug 234878 | Differences between
and this patch

Collapse All | Expand All

(-)emulators/virtualbox-ose/Makefile (-15 / +30 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.44
5
PORTVERSION=	6.1.18
6
PORTREVISION=	4
7
CATEGORIES=	emulators
6
CATEGORIES=	emulators
8
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
9
DISTFILES=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
8
DISTFILES=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
10
EXTRACT_ONLY=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX}
9
EXTRACT_ONLY=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX}
11
10
Lines 15-21 Link Here
15
LICENSE=	GPLv2
14
LICENSE=	GPLv2
16
LICENSE_FILE=	${WRKSRC}/COPYING
15
LICENSE_FILE=	${WRKSRC}/COPYING
17
16
18
PATCH_DEPENDS+=	${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild
19
BUILD_DEPENDS=	yasm:devel/yasm \
17
BUILD_DEPENDS=	yasm:devel/yasm \
20
		xsltproc:textproc/libxslt \
18
		xsltproc:textproc/libxslt \
21
		kmk:devel/kBuild \
19
		kmk:devel/kBuild \
Lines 42-49 Link Here
42
			virtualbox-ose-legacy-[0-9]* \
40
			virtualbox-ose-legacy-[0-9]* \
43
			virtualbox-ose-lite-[0-9]*
41
			virtualbox-ose-lite-[0-9]*
44
42
45
LDFLAGS=	-lpthread
46
47
VBOXUSER?=	vboxusers
43
VBOXUSER?=	vboxusers
48
VBOXWSUSER?=	vboxusers
44
VBOXWSUSER?=	vboxusers
49
VBOXGROUP?=	vboxusers
45
VBOXGROUP?=	vboxusers
Lines 57-63 Link Here
57
VBOX_UTILS=	VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
53
VBOX_UTILS=	VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
58
		VBoxSVC VBoxXPCOMIPCD
54
		VBoxSVC VBoxXPCOMIPCD
59
55
60
OPTIONS_DEFINE=	ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO \
56
OPTIONS_DEFINE=	ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS PULSEAUDIO \
61
		PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11
57
		PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11
62
OPTIONS_DEFAULT=	DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11
58
OPTIONS_DEFAULT=	DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11
63
OPTIONS_SUB=	yes
59
OPTIONS_SUB=	yes
Lines 66-71 Link Here
66
GUESTADDITIONS_DESC=	Build with Guest Additions
62
GUESTADDITIONS_DESC=	Build with Guest Additions
67
MANUAL_DESC=	Build with user manual
63
MANUAL_DESC=	Build with user manual
68
NLS_DESC=	Native language support (requires QT5)
64
NLS_DESC=	Native language support (requires QT5)
65
OPUS_DESC=	Use libvpx for audio recording (requires VPX)
69
QT5_DESC=	Build with QT5 frontend (requires X11)
66
QT5_DESC=	Build with QT5 frontend (requires X11)
70
R0LOGGING_DESC=	Enable R0 logging (requires DEBUG)
67
R0LOGGING_DESC=	Enable R0 logging (requires DEBUG)
71
UDPTUNNEL_DESC=	Build with UDP tunnel support
68
UDPTUNNEL_DESC=	Build with UDP tunnel support
Lines 82-87 Link Here
82
MANUAL_BUILD_DEPENDS=	${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml
79
MANUAL_BUILD_DEPENDS=	${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml
83
MANUAL_CONFIGURE_OFF=	--disable-docs
80
MANUAL_CONFIGURE_OFF=	--disable-docs
84
NLS_IMPLIES=		QT5
81
NLS_IMPLIES=		QT5
82
OPUS_CONFIGURE_OFF=	--disable-libopus
83
OPUS_LIB_DEPENDS=	libopus.so:audio/opus
84
OPUS_IMPLIES=		VPX
85
PULSEAUDIO_CONFIGURE_OFF=	--disable-pulse
85
PULSEAUDIO_CONFIGURE_OFF=	--disable-pulse
86
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
86
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
87
PYTHON_CONFIGURE_OFF=	--disable-python
87
PYTHON_CONFIGURE_OFF=	--disable-python
Lines 152-164 Link Here
152
.if ${PORT_OPTIONS:MQT5}
152
.if ${PORT_OPTIONS:MQT5}
153
CONFIGURE_ARGS+=	--enable-qt5
153
CONFIGURE_ARGS+=	--enable-qt5
154
PLIST_SUB+=	QT=""
154
PLIST_SUB+=	QT=""
155
USES+=		gl qmake:no_env qt:5 xorg
155
USES+=		gl qmake:no_env qt:5
156
USE_GL=		gl glu
156
USE_GL=		gl glu
157
USE_QT=		buildtools_build core dbus gui linguisttools_build opengl
157
USE_QT=		buildtools_build core dbus gui linguisttools_build opengl
158
USE_QT+=	printsupport widgets x11extras
158
USE_QT+=	printsupport widgets x11extras
159
USE_XORG=	xcb
159
USE_XORG=	xcb
160
INSTALLS_ICONS=	yes
160
INSTALLS_ICONS=	yes
161
VBOX_PROGS+=	VirtualBox
161
VBOX_PROGS+=	VirtualBox VirtualBoxVM
162
VBOX_UTILS+=	VBoxTestOGL
162
VBOX_UTILS+=	VBoxTestOGL
163
VBOX_WITH_QT=	1
163
VBOX_WITH_QT=	1
164
.else
164
.else
Lines 202-207 Link Here
202
202
203
.include <bsd.port.pre.mk>
203
.include <bsd.port.pre.mk>
204
204
205
.if ${COMPILER_TYPE} == clang
206
.if ${COMPILER_VERSION} == 80
207
# XXX PR236616: Clang 8.0 caused runtime problems.
208
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang${VBOX_LLVM_VER}:devel/llvm${VBOX_LLVM_VER}
209
CC=		${LOCALBASE}/bin/clang${VBOX_LLVM_VER}
210
CXX=		${LOCALBASE}/bin/clang++${VBOX_LLVM_VER}
211
VBOX_LLVM_VER?=	80
212
.endif
213
PATCH_DEPENDS+=	${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild
214
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk
215
#EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-Config.kmk \
216
		${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk
217
.endif
218
205
.if ${PYTHON_MAJOR_VER} >= 3
219
.if ${PYTHON_MAJOR_VER} >= 3
206
PLIST_SUB+=	PYTHON_PYCDIR=/__pycache__/ \
220
PLIST_SUB+=	PYTHON_PYCDIR=/__pycache__/ \
207
		PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc
221
		PYTHON_PYCEXT=.cpython-${PYTHON_SUFFIX}.pyc
Lines 274-286 Link Here
274
	    ${WRKSRC}/LocalConfig.kmk
288
	    ${WRKSRC}/LocalConfig.kmk
275
	@${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
289
	@${ECHO_CMD} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
276
	    ${WRKSRC}/LocalConfig.kmk
290
	    ${WRKSRC}/LocalConfig.kmk
277
	@${REINPLACE_CMD} -E -e '/soap_socket_errno\(/s/(soap_socket_errno)(\([^)]+\))/\1/' \
278
		${WRKSRC}/src/VBox/Main/webservice/vboxweb.cpp
279
.endif
291
.endif
292
.if empty(PORT_OPTIONS:MX11)
293
	@${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk
294
.endif
295
.if ${COMPILER_TYPE} == clang
280
	@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
296
	@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
281
	    -e 's| -mpreferred-stack-boundary=2||' \
297
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
282
	    -e 's|%%PYTHON_VERSION%%|${PYTHON_VERSION}|' \
283
		${WRKSRC}/Config.kmk
284
	@${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \
298
	@${REINPLACE_CMD} -e 's| -fpermissive||' ${WRKSRC}/Config.kmk \
285
	    ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk
299
	    ${WRKSRC}/src/VBox/Main/webservice/Makefile.kmk
286
	@${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk
300
	@${ECHO_CMD} 'TOOL_VBoxGccFreeBSD_LD = ${CXX}' >> ${WRKSRC}/LocalConfig.kmk
Lines 287-292 Link Here
287
	@${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \
301
	@${SED} -e 's|GXX3|VBoxGccFreeBSD|g' \
288
	    ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \
302
	    ${LOCALBASE}/share/kBuild/tools/GXX3.kmk > \
289
	    ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk
303
	    ${WRKSRC}/tools/kBuildTools/VBoxGccFreeBSD.kmk
304
.endif
290
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
305
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
291
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
306
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
292
	    ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
307
	    ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
Lines 329-335 Link Here
329
344
330
	${MKDIR} ${STAGEDIR}${VBOX_DIR}
345
	${MKDIR} ${STAGEDIR}${VBOX_DIR}
331
	cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \
346
	cd ${KMK_BUILDDIR}/bin && ${COPYTREE_SHARE} \
332
	    "*.fd *.r0 *.rc *.so components" ${STAGEDIR}${VBOX_DIR}
347
	    "*.fd *.r0 *.so components" ${STAGEDIR}${VBOX_DIR}
333
.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE}
348
.if ${PORT_OPTIONS:MPYTHON} || ${PORT_OPTIONS:MWEBSERVICE}
334
	${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR}
349
	${RLN} ${STAGEDIR}${DATADIR}/sdk ${STAGEDIR}${VBOX_DIR}
335
.endif
350
.endif
(-)emulators/virtualbox-ose/distinfo (-5 / +5 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1594897148
1
TIMESTAMP = 1613863264
2
SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e
2
SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40
3
SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934
3
SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486
4
SHA256 (VBoxGuestAdditions_5.2.44.iso) = 9883ee443a309f4ffa1d5dee2833f9e35ced598686c36d159f410e5edbac1ca4
4
SHA256 (VBoxGuestAdditions_6.1.18.iso) = 904432eb331d7ae517afaa4e4304e6492b7947b46ecb8267de7ef792c4921b4c
5
SIZE (VBoxGuestAdditions_5.2.44.iso) = 49829888
5
SIZE (VBoxGuestAdditions_6.1.18.iso) = 61157376
(-)emulators/virtualbox-ose/files/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Additions/x11/VBoxClient/Makefile.kmk.orig	2013-11-29 14:20:43.000000000 -0500
2
+++ src/VBox/Additions/x11/VBoxClient/Makefile.kmk	2013-12-16 14:03:08.000000000 -0500
3
@@ -50,7 +50,7 @@
4
 #	Xtst
5
 # These are static replacements for gcc-specific parts of libstdc++
6
 VBoxClient_LIBS += \
7
-	supc++ \
8
+	cxxrt \
9
 	gcc_eh
10
 ifdef VBOX_X11_SEAMLESS_GUEST
11
  VBoxClient_DEFS += SEAMLESS_GUEST DYNAMIC_RESIZE
(-)emulators/virtualbox-ose/files/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk (+11 lines)
Line 0 Link Here
1
--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig	2013-11-29 14:23:32.000000000 -0500
2
+++ src/VBox/Devices/PC/ipxe/Makefile.kmk	2013-12-13 15:06:45.000000000 -0500
3
@@ -35,7 +35,7 @@
4
 iPxeBiosBin_CLEAN    = \
5
 	$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \
6
 
7
-if1of ($(KBUILD_TARGET), darwin os2 solaris win)
8
+if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win)
9
  $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@)
10
 	$(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
11
 	$(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp.orig	2017-01-17 07:26:50 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp
3
@@ -143,7 +143,7 @@ void UIDownloaderAdditions::handleVerifi
4
         {
5
             const QString strFileName = strRecord.section(" *", 1);
6
             const QString strDownloadedSumm = strRecord.section(" *", 0, 0);
7
-            if (strFileName == source().fileName())
8
+            if (strFileName == QFileInfo(source().toString()).fileName())
9
             {
10
                 /* Calc the SHA-256 on the bytes, creating a string: */
11
                 uint8_t abHash[RTSHA256_HASH_SIZE];
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp.orig	2017-01-17 07:26:50 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp
3
@@ -127,7 +127,7 @@ void UIDownloaderExtensionPack::handleVe
4
         {
5
             const QString strFileName = strRecord.section(" *", 1);
6
             const QString strDownloadedSumm = strRecord.section(" *", 0, 0);
7
-            if (strFileName == source().fileName())
8
+            if (strFileName == QFileInfo(source().toString()).fileName())
9
             {
10
                 /* Calc the SHA-256 on the bytes, creating a string: */
11
                 uint8_t abHash[RTSHA256_HASH_SIZE];
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp.orig	2017-03-08 17:19:57 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp
3
@@ -243,6 +243,6 @@ QString UIGlobalSettingsNetworkDetailsHo
4
         address.prepend(QString::number(uPart));
5
         uAddress = uAddress >> 8;
6
     }
7
-    return address.join('.');
8
+    return address.join(".");
9
 }
10
 
(-)emulators/virtualbox-ose/files/patch-Config.kmk (-130 / +125 lines)
Lines 1-6 Link Here
1
--- Config.kmk.orig	2020-07-09 16:49:46 UTC
1
--- Config.kmk.orig	2020-12-12 16:35:14.481298000 +0100
2
+++ Config.kmk
2
+++ Config.kmk	2020-12-12 17:00:58.394146000 +0100
3
@@ -445,11 +445,11 @@ ifn1of ($(KBUILD_TARGET), win darwin)
3
@@ -469,11 +469,11 @@
4
  # Enable OSS audio support.
4
  # Enable OSS audio support.
5
  VBOX_WITH_AUDIO_OSS = 1
5
  VBOX_WITH_AUDIO_OSS = 1
6
 endif
6
 endif
Lines 14-22 Link Here
14
  # Enable PulseAudio audio support.
14
  # Enable PulseAudio audio support.
15
  VBOX_WITH_AUDIO_PULSE = 1
15
  VBOX_WITH_AUDIO_PULSE = 1
16
 endif
16
 endif
17
@@ -464,11 +464,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1
17
@@ -489,11 +489,11 @@
18
 # Enable PCI passthrough support.
18
 # (disabled with 6.1, since it's not complete/useful enough)
19
 VBOX_WITH_PCI_PASSTHROUGH = 1
19
 VBOX_WITH_PCI_PASSTHROUGH =
20
 # Enable statically linked dbus support.
20
 # Enable statically linked dbus support.
21
-if1of ($(KBUILD_TARGET), linux solaris)
21
-if1of ($(KBUILD_TARGET), linux solaris)
22
+if1of ($(KBUILD_TARGET), freebsd linux solaris)
22
+if1of ($(KBUILD_TARGET), freebsd linux solaris)
Lines 28-43 Link Here
28
  VBOX_WITH_PAM = 1
28
  VBOX_WITH_PAM = 1
29
 endif
29
 endif
30
 # Enable internal networking.
30
 # Enable internal networking.
31
@@ -664,7 +664,7 @@ VBOX_WITH_TESTCASES = 1
31
@@ -501,7 +501,7 @@
32
 VBOX_WITH_VDITOOL =
32
 # Enable vmsvga (svga2) graphics device variant, 2D part
33
 # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled
33
 VBOX_WITH_VMSVGA = 1
34
 VBOX_WITH_VBOX_IMG =
34
 # Enable vmsvga (svga2) graphics device variant, 3D part
35
-if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64)
35
-if1of ($(KBUILD_TARGET), darwin linux win)
36
+if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 freebsd.x86 freebsd.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64)
36
+if1of ($(KBUILD_TARGET), darwin freebsd linux win)
37
  # Enables the video capturing support.
37
  VBOX_WITH_VMSVGA3D = 1
38
  VBOX_WITH_VIDEOREC = 1
38
 endif
39
  # Enable VPX (VP8 / VP9 codec), used for video capturing.
39
 # Enable the generic 3D settings support if at least one 3D capable solution is enabled
40
@@ -992,10 +992,6 @@ ifeq ($(KBUILD_TARGET),darwin)
40
@@ -647,7 +647,7 @@
41
 #endif
42
 # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems
43
 # caused by our XPCOM library polluting the symbol namespace for system libs.
44
-if1of ($(KBUILD_TARGET), linux solaris)
45
+if1of ($(KBUILD_TARGET), freebsd linux solaris)
46
  VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1
47
 endif
48
 # The webservices api.
49
@@ -1064,10 +1064,6 @@
41
  VBOX_WITH_VBOXSDL=
50
  VBOX_WITH_VBOXSDL=
42
 endif
51
 endif
43
 
52
 
Lines 48-54 Link Here
48
 ifeq ($(KBUILD_TARGET),haiku)
57
 ifeq ($(KBUILD_TARGET),haiku)
49
  # Don't bother with SDL ttf for now.
58
  # Don't bother with SDL ttf for now.
50
  VBOX_WITH_SECURELABEL=
59
  VBOX_WITH_SECURELABEL=
51
@@ -1155,7 +1151,7 @@ ifdef VBOX_OSE
60
@@ -1228,7 +1224,7 @@
52
  VBOX_WITH_KCHMVIEWER=
61
  VBOX_WITH_KCHMVIEWER=
53
  VBOX_WITH_PLUGIN_CRYPT=
62
  VBOX_WITH_PLUGIN_CRYPT=
54
  VBOX_WITH_DRAG_AND_DROP_PROMISES=
63
  VBOX_WITH_DRAG_AND_DROP_PROMISES=
Lines 57-149 Link Here
57
   VBOX_WITH_DOCS=
66
   VBOX_WITH_DOCS=
58
   VBOX_WITH_DOCS_PACKING=
67
   VBOX_WITH_DOCS_PACKING=
59
  endif
68
  endif
60
@@ -1176,14 +1172,14 @@ ifdef VBOX_OSE
69
@@ -4923,7 +4919,7 @@
61
  ifn1of ($(KBUILD_TARGET), darwin linux solaris win)
62
   VBOX_WITH_INSTALLER=
63
  endif
64
- if1of ($(KBUILD_TARGET), win)
65
+ # if1of ($(KBUILD_TARGET), win)
66
   # Undefine codec libraries which are not needed.
67
   VBOX_WITH_LIBVPX=
68
   VBOX_WITH_LIBOPUS=
69
   # Disable video recording (with audio support).
70
   VBOX_WITH_VIDEOREC=
71
   VBOX_WITH_AUDIO_VIDEOREC=
72
- endif
73
+ # endif
74
  # branding
75
  VBOX_BRAND_LICENSE_HTML             := $(PATH_ROOT)/doc/License-gpl-2.0.html
76
  VBOX_BRAND_LICENSE_RTF              := $(PATH_ROOT)/doc/License-gpl-2.0.rtf
77
@@ -1810,6 +1806,7 @@ ifndef VBOX_BLD_PYTHON
78
  else
79
   VBOX_BLD_PYTHON := $(firstword $(which python2.7$(HOSTSUFF_EXE)) $(which python2.6$(HOSTSUFF_EXE)) \
80
                                  $(which python$(HOSTSUFF_EXE)) $(which python3$(HOSTSUFF_EXE)) \
81
+                                 $(which %%PYTHON_VERSION%%) \
82
 				   python-not-found)
83
  endif
84
 endif
85
@@ -2550,6 +2547,10 @@ ifeq ($(KBUILD_HOST),win) ## @todo can drop this now, 
86
  # This isn't important (yet) on windows, so cook the result until
87
  # cygwin is feeling better.
88
  VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 3), $(int-mul 100, 3), 3)
89
+else ifeq($(KBUILD_HOST,freebsd))
90
+ # At a minimum, we'll be building with GCC 4.2 on FreeBSD. LLVM will always
91
+ # pose as GCC 4.2 anyways, so this seems safe.
92
+ VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 4), $(int-mul 100, 2), 0)
93
 else
94
  # This is kind of bad, the returned string needs to be re-evaluated before use.
95
  # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)).
96
@@ -4218,6 +4219,7 @@ ifdef VBOX_WITH_RAW_MODE
97
  TEMPLATE_VBoxRc_TOOL                = $(VBOX_GCC32_TOOL)
98
  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)
99
  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)
100
+ TEMPLATE_VBoxRc_CXXFLAGS.freebsd    = -fno-builtin
101
   ifeq ($(KBUILD_TARGET),solaris)
102
    TEMPLATE_VBoxRc_LDFLAGS           = -r
103
   else
104
@@ -4359,6 +4361,7 @@ ifeq ($(VBOX_LDR_FMT),elf)
105
 TEMPLATE_VBoxR0_TOOL                = $(VBOX_GCC_TOOL)
106
 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)
107
 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)
108
+TEMPLATE_VBoxR0_CXXFLAGS.freebsd    = -fno-builtin
109
 TEMPLATE_VBoxR0_CFLAGS.amd64        = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
110
 TEMPLATE_VBoxR0_CXXFLAGS.amd64      = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
111
 ifeq ($(KBUILD_TARGET),solaris)
112
@@ -4683,13 +4686,13 @@ TEMPLATE_VBOXR0DRV_CFLAGS              =  \
113
 	-O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
114
 	$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
115
 	-nostdinc -std=c99
116
-TEMPLATE_VBOXR0DRV_CFLAGS.x86          = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
117
+TEMPLATE_VBOXR0DRV_CFLAGS.x86          = -m32 -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
118
 TEMPLATE_VBOXR0DRV_CFLAGS.amd64        = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \
119
 	-fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \
120
 	-mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef
121
 TEMPLATE_VBOXR0DRV_CXXFLAGS            = -fno-exceptions -fno-rtti \
122
 	$(VBOX_GCC_WARN) -Wpointer-arith -Winline \
123
-	-O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \
124
+	-O2 -fno-builtin -fno-strict-aliasing -fno-common -finline-limit=8000 \
125
 	$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
126
 	-nostdinc
127
 TEMPLATE_VBOXR0DRV_CXXFLAGS.x86        = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86)
128
@@ -4716,7 +4719,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
129
 		| xargs -J% objcopy % $(out)
130
 
131
 ## Strip debug info (comment out if debugging or something).
132
-	objcopy --strip-debug $(out)
133
+#	objcopy --strip-debug $(out)
134
 endef
135
  else # x86
136
 TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld
137
@@ -4730,7 +4733,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
138
 		| xargs -J% objcopy % $(outbase).kld
70
 		| xargs -J% objcopy % $(outbase).kld
139
 
71
 
140
 # Link the final .ko (a shared object).
72
 # Link the final .ko (a shared object).
141
-	ld $(flags) -Bshareable -o $(out) $(outbase).kld
73
-	ld $(flags) -Bshareable -o $(out) $(outbase).kld
142
+	ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld
74
+    ld $(flags) -Bshareable -znotext -o $(out) $(outbase).kld
143
 endef
75
 endef
144
  endif # x86
76
  endif # x86
145
 
77
 
146
@@ -5016,10 +5019,18 @@ TEMPLATE_VBOXR3EXE_LIBPATH            += \
78
@@ -5200,6 +5196,7 @@
79
 TEMPLATE_VBOXR3EXE_LDFLAGS.amd64       = -m64
80
 TEMPLATE_VBOXR3EXE_LDFLAGS.sparc32     = -m32
81
 TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64     = -m64
82
+TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd     = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
83
 TEMPLATE_VBOXR3EXE_LDFLAGS.linux       = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
84
 TEMPLATE_VBOXR3EXE_LDFLAGS.solaris     = -Wl,-z,ignore # same as VBOX_LD_as_needed
85
 TEMPLATE_VBOXR3EXE_LDFLAGS.debug       = $(VBOX_GCC_SANITIZER_FLAGS) $(VBOX_GCC_SANITIZER_LDFLAGS)
86
@@ -5233,10 +5230,18 @@
147
 TEMPLATE_VBOXR3EXE_CFLAGS             += -fno-pic
87
 TEMPLATE_VBOXR3EXE_CFLAGS             += -fno-pic
148
 TEMPLATE_VBOXR3EXE_CXXFLAGS           += -fno-pic
88
 TEMPLATE_VBOXR3EXE_CXXFLAGS           += -fno-pic
149
 TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
89
 TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
Lines 163-178 Link Here
163
 	/usr/include \
103
 	/usr/include \
164
 	/usr/X11R6/include \
104
 	/usr/X11R6/include \
165
 	/usr/local/include
105
 	/usr/local/include
166
@@ -5310,7 +5321,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT!
106
@@ -5268,6 +5273,7 @@
167
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain
107
   TEMPLATE_VBOXR3EXE_LDFLAGS          += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
168
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86       = $(NOT_SUCH_VARIABLE)
108
  endif
169
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64     = $(NOT_SUCH_VARIABLE)
109
  ifdef VBOX_WITH_ORIGIN
170
-else ifn1of ($(KBUILD_TARGET), os2 solaris)
110
+  TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd  += $(VBOX_GCC_ORIGIN_OPT)
171
+else ifn1of ($(KBUILD_TARGET), freebsd os2 solaris)
111
   TEMPLATE_VBOXR3EXE_LDFLAGS.linux    += $(VBOX_GCC_ORIGIN_OPT)
112
  endif
113
 endif
114
@@ -5407,7 +5413,7 @@
115
  	$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
116
  	$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
117
  	$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/oldnames.lib
118
-else ifn1of ($(KBUILD_TARGET), darwin linux solaris)
119
+else ifn1of ($(KBUILD_TARGET), darwin freebsd linux solaris)
120
  # The gcc guys sans darwin, linux and solaris (don't depend on statically compiled system libs there)
121
  TEMPLATE_VBOXR3STATIC_CFLAGS          = $(TEMPLATE_VBOXR3EXE_CFLAGS) -static
122
  TEMPLATE_VBOXR3STATIC_CXXFLAGS        = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -static
123
@@ -5552,6 +5558,7 @@
124
 else ifn1of ($(KBUILD_TARGET), os2 solaris)
172
  # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH)
125
  # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH)
173
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
126
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
127
+ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd))
174
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
128
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
175
@@ -5837,10 +5848,18 @@ TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTI
129
 endif
130
 
131
@@ -5579,6 +5586,7 @@
132
  TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.win = $(TEMPLATE_VBoxR3TstDll_LDFLAGS.win) -IntegrityCheck
133
 ifn1of ($(KBUILD_TARGET), win os2)
134
  TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS))
135
+ TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.freebsd))
136
  TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux))
137
 endif
138
 
139
@@ -5601,6 +5609,7 @@
140
   TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
141
  endif
142
  ifdef VBOX_WITH_ORIGIN
143
+  TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.freebsd += $(VBOX_GCC_ORIGIN_OPT)
144
   TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
145
  endif
146
 endif
147
@@ -6127,10 +6136,19 @@
176
  else ifeq ($(KBUILD_TARGET),haiku)
148
  else ifeq ($(KBUILD_TARGET),haiku)
177
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
149
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
178
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) network stdc++ supc++
150
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) network stdc++ supc++
Lines 180-185 Link Here
180
+ else ifeq ($(KBUILD_TARGET),freebsd)
152
+ else ifeq ($(KBUILD_TARGET),freebsd)
181
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
153
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
182
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
154
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
155
+TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd     = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
183
+TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext
156
+TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext
184
 TEMPLATE_VBOXMAINEXE_INCS               += \
157
 TEMPLATE_VBOXMAINEXE_INCS               += \
185
+	/usr/local/include
158
+	/usr/local/include
Lines 192-201 Link Here
192
 	/usr/include \
165
 	/usr/include \
193
 	/usr/X11R6/include \
166
 	/usr/X11R6/include \
194
 	/usr/local/include
167
 	/usr/local/include
195
@@ -6382,13 +6401,10 @@ ifdef VBOX_WITH_QTGUI
168
@@ -6162,6 +6180,7 @@
169
 TEMPLATE_VBOXMAINEXE_LDFLAGS            += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
170
  endif
171
  ifdef VBOX_WITH_ORIGIN
172
+TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd    += $(VBOX_GCC_ORIGIN_OPT)
173
 TEMPLATE_VBOXMAINEXE_LDFLAGS.linux      += $(VBOX_GCC_ORIGIN_OPT)
174
  endif
175
 
176
@@ -6727,13 +6746,11 @@
196
    TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
177
    TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
197
 	$(VBOX_LIBPATH_X11)
178
 	$(VBOX_LIBPATH_X11)
198
    ifeq ($(KBUILD_TARGET),freebsd)
179
    ifeq ($(KBUILD_TARGET),freebsd)
180
+    TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
199
+    TEMPLATE_VBOXQTGUIEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext
181
+    TEMPLATE_VBOXQTGUIEXE_LDFLAGS.freebsd.x86 = -Wl,-z,notext
200
     TEMPLATE_VBOXQTGUIEXE_INCS += \
182
     TEMPLATE_VBOXQTGUIEXE_INCS += \
201
-	/usr/include \
183
-	/usr/include \
Lines 207-239 Link Here
207
 	/usr/local/lib
189
 	/usr/local/lib
208
    endif
190
    endif
209
    ifeq ($(KBUILD_TARGET),solaris)
191
    ifeq ($(KBUILD_TARGET),solaris)
210
@@ -6617,12 +6633,8 @@ TEMPLATE_VBoxBldProg_LIBPATH            += \
192
@@ -6980,10 +6997,17 @@
193
 TEMPLATE_VBoxBldProg_LIBS                = network 
194
 TEMPLATE_VBoxBldProg_LIBPATH            += \
195
 	/boot/common/lib
196
- else if1of ($(KBUILD_HOST), freebsd openbsd)
197
+ else ifeq ($(KBUILD_HOST),freebsd)
211
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
198
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
212
 TEMPLATE_VBoxBldProg_LIBS                = pthread
199
 TEMPLATE_VBoxBldProg_LIBS                = pthread
213
 TEMPLATE_VBoxBldProg_INCS               += \
200
 TEMPLATE_VBoxBldProg_INCS               += \
214
-	/usr/include \
201
+	/usr/local/include
215
-	/usr/X11R6/include \
202
+TEMPLATE_VBoxBldProg_LIBPATH            += \
203
+	/usr/local/lib
204
+ else ifeq ($(KBUILD_HOST),openbsd)
205
+TEMPLATE_VBoxBldProg_TOOL                = GXX3
206
+TEMPLATE_VBoxBldProg_LIBS                = pthread
207
+TEMPLATE_VBoxBldProg_INCS               += \
208
 	/usr/include \
209
 	/usr/X11R6/include \
216
 	/usr/local/include
210
 	/usr/local/include
217
 TEMPLATE_VBoxBldProg_LIBPATH            += \
211
@@ -7107,6 +7131,7 @@
218
-	/usr/lib \
212
  # Do not inherit sanitizer flags from VBOXR3EXE in guest executables.  Deal with them separately.
219
-	/usr/X11R6/lib \
213
  TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.debug = $(NO_SUCH_VARIABLE)
220
 	/usr/local/lib
214
  TEMPLATE_VBOXGUESTR3EXE_CFLAGS.debug = $(NO_SUCH_VARIABLE)
221
  else ifeq ($(KBUILD_HOST),netbsd)
215
+ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd))
222
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
216
  TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
223
@@ -7008,7 +7020,7 @@
217
  TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.debug = $(NO_SUCH_VARIABLE)
218
  TEMPLATE_VBOXGUESTR3EXE_LDFLAGS  = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
219
@@ -7130,6 +7155,7 @@
220
 	$(VBOX_GCC_fno-stack-protector)
221
 TEMPLATE_VBOXGUESTR3EXE_CFLAGS.linux      = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux)
222
 # The GNU_HASH ELF tag is not supported by older systems.
223
+TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd    += $(VBOX_LD_hash_style_sysv)
224
 TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux      += $(VBOX_LD_hash_style_sysv)
225
 
224
 #
226
 #
225
 TEMPLATE_VBOXCROGLR3HOSTDLL                  = VBox OpenGL Host DLLs
227
@@ -7337,6 +7363,7 @@
226
 TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS         := $(if-expr "$(KBUILD_TARGET)" == "win",VBOXR3,VBOXR3NP)
228
 TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET)    = $(NO_SUCH_VARIABLE)
227
-TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY       = prepending
229
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
228
+TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY       = appending
230
 # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers.
229
 TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS             = VBOX_WITH_HGCM UNPACKS
231
+TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv))
230
 TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.win         = _WIN32_WINNT=0x0500 WINDOWS=1
232
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv))
231
 TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.linux       = Linux=1 _GNU_SOURCE
233
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE)   = $(NO_SUCH_VARIABLE)
232
@@ -7023,6 +7035,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin  += \
234
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS          = -r
233
 	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
234
 	-compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
235
 TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux    = -Wl,--no-as-needed
236
+TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.freebsd  = -Wl,--no-as-needed
237
 TEMPLATE_VBOXCROGLR3HOSTDLL_BLDDIRS          = $(VBOX_PATH_CROGL_GENFILES)/
238
 ifeq ($(KBUILD_TARGET),darwin)
239
  TEMPLATE_VBOXCROGLR3HOSTDLL_CFLAGS          = $(TEMPLATE_VBOXR3NP_CFLAGS) -Wno-deprecated-declarations
(-)emulators/virtualbox-ose/files/patch-configure (-36 / +28 lines)
Lines 1-4 Link Here
1
--- configure.orig	2020-05-13 19:36:41 UTC
1
--- configure.orig	2019-11-21 13:51:26.000000000 -0300
2
+++ configure
2
+++ configure
3
@@ -138,10 +138,14 @@ CXX_FLAGS=""
3
@@ -138,10 +138,14 @@ CXX_FLAGS=""
4
 if [ "$OS" = "freebsd" ]; then
4
 if [ "$OS" = "freebsd" ]; then
Lines 15-31 Link Here
15
 else
15
 else
16
   INCCURL=""
16
   INCCURL=""
17
   LIBCURL="-lcurl"
17
   LIBCURL="-lcurl"
18
@@ -441,6 +445,9 @@ check_gcc()
18
@@ -1221,7 +1225,7 @@ extern "C" int main(void)
19
       elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
20
         log_success "found version $cc_ver"
21
       # gcc-4.0 is allowed for Darwin only
22
+      elif [ $cc_maj -eq 4 -a $cc_min -eq 2 -a "$OS" = "freebsd" ]; then
23
+        log_success "found version $cc_ver"
24
+      # gcc-4.2 is allowed for FreeBSD only
25
       elif [ $cc_maj -lt 4 \
26
              -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \
27
              -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS"  = "darwin" \) ]; then
28
@@ -1208,7 +1215,7 @@ extern "C" int main(void)
29
 #endif
19
 #endif
30
 }
20
 }
31
 EOF
21
 EOF
Lines 34-50 Link Here
34
     test_execute
24
     test_execute
35
   fi
25
   fi
36
 }
26
 }
37
@@ -1508,8 +1515,7 @@ EOF
27
@@ -1527,9 +1531,7 @@ EOF
38
         if [ $? -eq 0 ]; then
28
         if [ $? -eq 0 ]; then
39
           echo "(Qt5 from pkg-config)" >> $LOG
29
           echo "(Qt5 from pkg-config)" >> $LOG
40
           FLGQT5=`pkg-config Qt5Core --cflags`
30
           FLGQT5=`pkg-config Qt5Core --cflags`
41
-          # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk)
31
-          # gcc 4.8 is able to compile with C++11 (see also VBOX_GCC_std in Config.kmk)
42
-          [ $cc_maj -eq 4 -a $cc_min -eq 8 ] && FLGQT5="$FLGQT5 -std=c++11"
32
-          [ $cc_maj -eq 4 -a $cc_min -eq 8 ] && FLGQT5="$FLGQT5 -std=c++11"
43
+          FLGQT5="$FLGQT5 -std=c++11"
33
-          INCQT5=`strip_I "$FLGQT5"`
44
           INCQT5=`strip_I "$FLGQT5"`
34
+          FLGQT5="$FLGQT5 -std=c++11"          INCQT5=`strip_I "$FLGQT5"`
45
           LIBDIR5=`pkg-config Qt5Core --variable=libdir`
35
           LIBDIR5=`pkg-config Qt5Core --variable=libdir`
46
           LIBQT5=`pkg-config Qt5Core --libs`
36
           LIBQT5=`pkg-config Qt5Core --libs`
47
@@ -1648,7 +1654,7 @@ check_libopus()
37
           LIBQT5="-L$LIBDIR5 $LIBQT5"
38
@@ -1667,7 +1669,7 @@ check_libopus()
48
       fi
39
       fi
49
       cat > $ODIR.tmp_src.cc << EOF
40
       cat > $ODIR.tmp_src.cc << EOF
50
 #include <cstdio>
41
 #include <cstdio>
Lines 53-59 Link Here
53
 extern "C" int main(void)
44
 extern "C" int main(void)
54
 {
45
 {
55
   OpusEncoder *test;
46
   OpusEncoder *test;
56
@@ -1980,8 +1986,8 @@ EOF
47
@@ -1999,8 +2001,8 @@
57
         echo "compiling the following source file:" >> $LOG
48
         echo "compiling the following source file:" >> $LOG
58
         cat $ODIR.tmp_src.cc >> $LOG
49
         cat $ODIR.tmp_src.cc >> $LOG
59
         echo "using the following command line:" >> $LOG
50
         echo "using the following command line:" >> $LOG
Lines 64-70 Link Here
64
         if [ $? -eq 0 ]; then
55
         if [ $? -eq 0 ]; then
65
           found=1
56
           found=1
66
           break
57
           break
67
@@ -2453,7 +2459,7 @@ for option in "$@"; do
58
@@ -2476,7 +2478,7 @@
68
     --with-openssl-dir=*)
59
     --with-openssl-dir=*)
69
       OPENSSLDIR=`echo $option | cut -d'=' -f2`
60
       OPENSSLDIR=`echo $option | cut -d'=' -f2`
70
       INCCRYPTO="-I${OPENSSLDIR}/include"
61
       INCCRYPTO="-I${OPENSSLDIR}/include"
Lines 73-110 Link Here
73
       ;;
64
       ;;
74
     --with-ow-dir=*)
65
     --with-ow-dir=*)
75
       WATCOM=`echo $option | cut -d'=' -f2`
66
       WATCOM=`echo $option | cut -d'=' -f2`
76
@@ -2767,7 +2773,7 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then
67
@@ -2818,14 +2820,23 @@
77
   check_ssl
78
   check_curl
79
   [ $WITH_LIBVPX -eq 1 ] && check_vpx
80
-  check_libopus
81
+  [ $OSE -eq 0 -a "$OS" != "win" ] && check_libopus
82
  [ "$OS" != "darwin"  ] && check_z
83
   [ "$OS" != "darwin"  ] && check_png
84
   [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
85
@@ -2788,13 +2794,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then
86
   [ $WITH_PYTHON -eq 1 ] && check_python
68
   [ $WITH_PYTHON -eq 1 ] && check_python
87
   [ $WITH_JAVA   -eq 1 ] && check_java
69
   [ $WITH_JAVA   -eq 1 ] && check_java
88
 
70
 
89
-  # PulseAudio
71
-  # PulseAudio
90
   if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then
72
-  if [ $WITH_PULSE -eq 1 ]; then
73
-    check_pulse
74
-  elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio.
75
-    cnf_append "VBOX_WITH_AUDIO_PULSE" ""
76
-  elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio.
77
-    cnf_append "VBOX_WITH_AUDIO_PULSE" "1"
78
-  fi
79
+  if [ "$OS" = "linux" -o "$OS" = "freebsd" -o "$OS" = "netbsd" ]; then
91
+    if [ $WITH_ALSA -eq 1 ]; then
80
+    if [ $WITH_ALSA -eq 1 ]; then
92
+      check_alsa
81
+      check_alsa
93
+    else
82
+    else
94
+      cnf_append "VBOX_WITH_AUDIO_ALSA" ""
83
+      cnf_append "VBOX_WITH_AUDIO_ALSA" ""
95
+    fi
84
+    fi
96
     if [ $WITH_PULSE -eq 1 ]; then
85
+    if [ $WITH_PULSE -eq 1 ]; then
97
       check_pulse
86
+      check_pulse
98
     elif [ $WITH_PULSE -eq 0 ]; then
87
+    elif [ $WITH_PULSE -eq 0 ]; then # Force disabling PulseAudio.
99
       cnf_append "VBOX_WITH_AUDIO_PULSE" ""
88
+      cnf_append "VBOX_WITH_AUDIO_PULSE" ""
100
     fi
89
+    elif [ $WITH_PULSE -eq 2 ]; then # --enable-pulse was passed, force PulseAudio.
90
+      cnf_append "VBOX_WITH_AUDIO_PULSE" "1"
91
+    fi
101
+    if [ $WITH_DBUS -eq 0 ]; then
92
+    if [ $WITH_DBUS -eq 0 ]; then
102
+      cnf_append "VBOX_WITH_DBUS" ""
93
+      cnf_append "VBOX_WITH_DBUS" ""
103
+    fi
94
+    fi
104
  fi
95
+  fi  
105
 fi
96
 fi
106
 
97
 
107
@@ -2810,14 +2823,6 @@ if [ "$OS" = "linux" ]; then
98
 # Linux-specific
99
@@ -2840,14 +2851,6 @@
108
     cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
100
     cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
109
   fi
101
   fi
110
   if [ $ONLY_ADDITIONS -eq 0 ]; then
102
   if [ $ONLY_ADDITIONS -eq 0 ]; then
(-)emulators/virtualbox-ose/files/patch-include-VBox-vmm-cpumctx.h (-11 lines)
Lines 1-11 Link Here
1
--- include/VBox/vmm/cpumctx.h.orig	2020-05-13 19:36:46 UTC
2
+++ include/VBox/vmm/cpumctx.h
3
@@ -88,7 +88,7 @@ AssertCompileSize(CPUMSELREG, 24);
4
 # define CPUMSELREG_ARE_HIDDEN_PARTS_VALID(a_pVCpu, a_pSelReg) \
5
     (   ((a_pSelReg)->fFlags & CPUMSELREG_FLAGS_VALID) \
6
      && (   (a_pSelReg)->ValidSel == (a_pSelReg)->Sel \
7
-         || (   (a_pVCpu) /*!= NULL*/ \
8
+         || (   ((a_pVCpu) != NULL) \
9
              && (a_pSelReg)->ValidSel == ((a_pSelReg)->Sel & X86_SEL_MASK_OFF_RPL) \
10
              && ((a_pSelReg)->Sel      & X86_SEL_RPL) == 1 \
11
              && ((a_pSelReg)->ValidSel & X86_SEL_RPL) == 0 \
(-)emulators/virtualbox-ose/files/patch-include-iprt-x86.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- include/iprt/x86.h.orig	2020-05-13 19:36:52 UTC
1
--- include/iprt/x86.h.orig	2014-02-25 11:59:50.000000000 -0500
2
+++ include/iprt/x86.h
2
+++ include/iprt/x86.h	2014-03-11 16:46:08.000000000 -0400
3
@@ -35,6 +35,16 @@
3
@@ -35,6 +35,16 @@
4
 # pragma D depends_on library vbox-types.d
4
 # pragma D depends_on library vbox-types.d
5
 #endif
5
 #endif
(-)emulators/virtualbox-ose/files/patch-include_VBox_VBoxGL2D.h (-16 lines)
Lines 1-16 Link Here
1
Fix build with Qt5 5.13, which defined GLsizeiptr already.
2
3
Obtained from:
4
	https://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg436220.html
5
6
--- include/VBox/VBoxGL2D.h.orig	2019-09-29 14:31:16 UTC
7
+++ include/VBox/VBoxGL2D.h
8
@@ -107,7 +107,7 @@ typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM3I)(GLint
9
 typedef GLvoid (APIENTRY *PFNVBOXVHWA_UNIFORM4I)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
10
 
11
 /* GL_ARB_pixel_buffer_object*/
12
-#ifndef Q_WS_MAC
13
+#if 0
14
 /* apears to be defined on mac */
15
 typedef ptrdiff_t GLsizeiptr;
16
 #endif
(-)emulators/virtualbox-ose/files/patch-include_VBox_com_array.h (-11 / +11 lines)
Lines 1-6 Link Here
1
--- include/VBox/com/array.h.orig	2019-04-12 15:47:42 UTC
1
--- include/VBox/com/array.h.orig	2019-11-21 13:51:32.000000000 -0300
2
+++ include/VBox/com/array.h
2
+++ include/VBox/com/array.h
3
@@ -168,7 +168,7 @@
3
@@ -171,7 +171,7 @@
4
 
4
 
5
 #include "VBox/com/defs.h"
5
 #include "VBox/com/defs.h"
6
 
6
 
Lines 9-36 Link Here
9
 /** @def VBOX_WITH_TYPE_TRAITS
9
 /** @def VBOX_WITH_TYPE_TRAITS
10
  * Type traits are a C++ 11 feature, so not available everywhere (yet).
10
  * Type traits are a C++ 11 feature, so not available everywhere (yet).
11
  * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer.
11
  * Only GCC 4.6 or newer and MSVC++ 16.0 (Visual Studio 2010) or newer.
12
@@ -940,12 +940,12 @@ class SafeArray : public Traits (public)
12
@@ -960,12 +960,12 @@
13
      */
14
     T &operator[] (size_t aIdx)
15
     {
13
     {
16
-        AssertReturn(m.arr != NULL,  *((T *)NULL));
14
         /** @todo r=klaus should do this as a AssertCompile, but cannot find a way which works. */
17
-        AssertReturn(aIdx < size(), *((T *)NULL));
15
         Assert(sizeof(T) <= sizeof(Zeroes));
16
-        AssertReturn(m.arr != NULL, *(T *)&Zeroes[0]);
17
-        AssertReturn(aIdx < size(), *(T *)&Zeroes[0]);
18
+        AssertReturn(m.arr != NULL,  *((T *)1));
18
+        AssertReturn(m.arr != NULL,  *((T *)1));
19
+        AssertReturn(aIdx < size(), *((T *)1));
19
+        AssertReturn(aIdx < size(), *((T *)1));
20
 #ifdef VBOX_WITH_XPCOM
20
 #ifdef VBOX_WITH_XPCOM
21
         return m.arr[aIdx];
21
         return m.arr[aIdx];
22
 #else
22
 #else
23
-        AssertReturn(m.raw != NULL,  *((T *)NULL));
23
-        AssertReturn(m.raw != NULL, *(T *)&Zeroes[0]);
24
+        AssertReturn(m.raw != NULL,  *((T *)1));
24
+        AssertReturn(m.raw != NULL,  *((T *)1));
25
         return m.raw[aIdx];
25
         return m.raw[aIdx];
26
 #endif
26
 #endif
27
     }
27
     }
28
@@ -960,7 +960,7 @@ class SafeArray : public Traits (public)
28
@@ -980,7 +980,7 @@
29
 #ifdef VBOX_WITH_XPCOM
29
 #ifdef VBOX_WITH_XPCOM
30
         return m.arr[aIdx];
30
         return m.arr[aIdx];
31
 #else
31
 #else
32
-        AssertReturn(m.raw != NULL,  *((T *)NULL));
32
-        AssertReturn(m.raw != NULL, *(const T *)&Zeroes[0]);
33
+        AssertReturn(m.raw != NULL,  *((T *)1));
33
+         AssertReturn(m.raw != NULL,  *((T *)1));
34
         return m.raw[aIdx];
34
         return m.raw[aIdx];
35
 #endif
35
 #endif
36
     }
36
     }
(-)emulators/virtualbox-ose/files/patch-include_iprt_assertcompile.h (-15 lines)
Lines 1-15 Link Here
1
--- include/iprt/assertcompile.h.orig	2018-01-15 14:49:42 UTC
2
+++ include/iprt/assertcompile.h
3
@@ -104,7 +104,11 @@ RT_C_DECLS_END
4
  * @param   expr    Expression which should be true.
5
  */
6
 #ifdef RTASSERT_HAVE_STATIC_ASSERT
7
-# define AssertCompile(expr)    static_assert(!!(expr), #expr)
8
+#  ifdef __cplusplus
9
+#    define AssertCompile(expr) static_assert(!!(expr), #expr)
10
+#  else
11
+#    define AssertCompile(expr) _Static_assert(!!(expr), #expr)
12
+#  endif
13
 #else
14
 # define AssertCompile(expr)    AssertCompileNS(expr)
15
 #endif
(-)emulators/virtualbox-ose/files/patch-include_iprt_cdefs.h (-39 lines)
Lines 1-39 Link Here
1
--- include/iprt/cdefs.h.orig	2018-10-15 14:24:52 UTC
2
+++ include/iprt/cdefs.h
3
@@ -2611,28 +2611,28 @@
4
 
5
 /** @def RT_BYTE1
6
  * Gets the first byte of something. */
7
-#define RT_BYTE1(a)                             ( (a)         & 0xff )
8
+#define RT_BYTE1(a)                             ( (uint8_t)((a)         & 0xff) )
9
 /** @def RT_BYTE2
10
  * Gets the second byte of something. */
11
-#define RT_BYTE2(a)                             ( ((a) >>  8) & 0xff )
12
+#define RT_BYTE2(a)                             ( (uint8_t)(((a) >>  8) & 0xff) )
13
 /** @def RT_BYTE3
14
  * Gets the second byte of something. */
15
-#define RT_BYTE3(a)                             ( ((a) >> 16) & 0xff )
16
+#define RT_BYTE3(a)                             ( (uint8_t)(((a) >> 16) & 0xff) )
17
 /** @def RT_BYTE4
18
  * Gets the fourth byte of something. */
19
-#define RT_BYTE4(a)                             ( ((a) >> 24) & 0xff )
20
+#define RT_BYTE4(a)                             ( (uint8_t)(((a) >> 24) & 0xff) )
21
 /** @def RT_BYTE5
22
  * Gets the fifth byte of something. */
23
-#define RT_BYTE5(a)                             ( ((a) >> 32) & 0xff )
24
+#define RT_BYTE5(a)                             ( (uint8_t)(((a) >> 32) & 0xff) )
25
 /** @def RT_BYTE6
26
  * Gets the sixth byte of something. */
27
-#define RT_BYTE6(a)                             ( ((a) >> 40) & 0xff )
28
+#define RT_BYTE6(a)                             ( (uint8_t)(((a) >> 40) & 0xff) )
29
 /** @def RT_BYTE7
30
  * Gets the seventh byte of something. */
31
-#define RT_BYTE7(a)                             ( ((a) >> 48) & 0xff )
32
+#define RT_BYTE7(a)                             ( (uint8_t)(((a) >> 48) & 0xff) )
33
 /** @def RT_BYTE8
34
  * Gets the eight byte of something. */
35
-#define RT_BYTE8(a)                             ( ((a) >> 56) & 0xff )
36
+#define RT_BYTE8(a)                             ( (uint8_t)(((a) >> 56) & 0xff) )
37
 
38
 
39
 /** @def RT_LODWORD
(-)emulators/virtualbox-ose/files/patch-include_iprt_types.h (-26 lines)
Lines 1-26 Link Here
1
--- include/iprt/types.h.orig	2018-05-09 16:32:07 UTC
2
+++ include/iprt/types.h
3
@@ -56,22 +56,9 @@ RT_C_DECLS_END
4
 #  include <sys/types.h>
5
 
6
 # elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
7
-    /*
8
-     * Kludge for the FreeBSD kernel:
9
-     *  stddef.h and sys/types.h have slightly different offsetof definitions
10
-     *  when compiling in kernel mode. This is just to make GCC shut up.
11
-     */
12
-#  ifndef _STDDEF_H_
13
-#   undef offsetof
14
-#  endif
15
+
16
 #  include <sys/stddef.h>
17
-#  ifndef _SYS_TYPES_H_
18
-#   undef offsetof
19
-#  endif
20
 #  include <sys/types.h>
21
-#  ifndef offsetof
22
-#   error "offsetof is not defined!"
23
-#  endif
24
 
25
 # elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86)
26
     /*
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (-14 / +32 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig	2020-05-13 19:37:01 UTC
1
--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig	2019-01-25 18:12:28 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
2
+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
3
@@ -102,8 +102,6 @@ struct VBoxGuestDeviceState
3
@@ -45,6 +45,7 @@
4
 #include <sys/uio.h>
5
 #include <sys/bus.h>
6
 #include <sys/poll.h>
7
+#include <sys/proc.h>
8
 #include <sys/selinfo.h>
9
 #include <sys/queue.h>
10
 #include <sys/lock.h>
11
@@ -61,6 +62,7 @@
12
 #include <VBox/version.h>
13
 #include <VBox/log.h>
14
 #include <iprt/assert.h>
15
+#include <iprt/err.h>
16
 #include <iprt/initterm.h>
17
 #include <iprt/process.h>
18
 #include <iprt/string.h>
19
@@ -102,8 +104,6 @@ struct VBoxGuestDeviceState
4
     struct resource   *pIrqRes;
20
     struct resource   *pIrqRes;
5
     /** Pointer to the IRQ handler. */
21
     /** Pointer to the IRQ handler. */
6
     void              *pfnIrqHandler;
22
     void              *pfnIrqHandler;
Lines 9-15 Link Here
9
 };
25
 };
10
 
26
 
11
 
27
 
12
@@ -113,8 +111,7 @@ struct VBoxGuestDeviceState
28
@@ -113,8 +113,7 @@ struct VBoxGuestDeviceState
13
 /*
29
 /*
14
  * Character device file handlers.
30
  * Character device file handlers.
15
  */
31
  */
Lines 19-25 Link Here
19
 static d_ioctl_t  vgdrvFreeBSDIOCtl;
35
 static d_ioctl_t  vgdrvFreeBSDIOCtl;
20
 static int        vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
36
 static int        vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
21
 static d_write_t  vgdrvFreeBSDWrite;
37
 static d_write_t  vgdrvFreeBSDWrite;
22
@@ -145,8 +142,7 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
38
@@ -145,8 +144,7 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
23
 {
39
 {
24
     .d_version =        D_VERSION,
40
     .d_version =        D_VERSION,
25
     .d_flags =          D_TRACKCLOSE | D_NEEDMINOR,
41
     .d_flags =          D_TRACKCLOSE | D_NEEDMINOR,
Lines 29-35 Link Here
29
     .d_ioctl =          vgdrvFreeBSDIOCtl,
45
     .d_ioctl =          vgdrvFreeBSDIOCtl,
30
     .d_read =           vgdrvFreeBSDRead,
46
     .d_read =           vgdrvFreeBSDRead,
31
     .d_write =          vgdrvFreeBSDWrite,
47
     .d_write =          vgdrvFreeBSDWrite,
32
@@ -154,81 +150,28 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
48
@@ -154,81 +152,28 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
33
     .d_name =           "vboxguest"
49
     .d_name =           "vboxguest"
34
 };
50
 };
35
 
51
 
Lines 118-124 Link Here
118
 {
134
 {
119
     int                 rc;
135
     int                 rc;
120
     PVBOXGUESTSESSION   pSession;
136
     PVBOXGUESTSESSION   pSession;
121
@@ -236,25 +179,18 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
137
@@ -240,12 +185,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
122
     LogFlow(("vgdrvFreeBSDOpen:\n"));
138
     LogFlow(("vgdrvFreeBSDOpen:\n"));
123
 
139
 
124
     /*
140
     /*
Lines 130-136 Link Here
130
-    /*
146
-    /*
131
      * Create a new session.
147
      * Create a new session.
132
      */
148
      */
133
     rc = VGDrvCommonCreateUserSession(&g_DevExt, &pSession);
149
     fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN;
150
@@ -262,14 +201,13 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
151
     rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession);
134
     if (RT_SUCCESS(rc))
152
     if (RT_SUCCESS(rc))
135
     {
153
     {
136
-        if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
154
-        if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
Lines 150-156 Link Here
150
     }
168
     }
151
 
169
 
152
     LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
170
     LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
153
@@ -262,33 +198,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
171
@@ -277,33 +215,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
154
 }
172
 }
155
 
173
 
156
 /**
174
 /**
Lines 184-190 Link Here
184
  * I/O control request.
202
  * I/O control request.
185
  *
203
  *
186
  * @returns depends...
204
  * @returns depends...
187
@@ -301,8 +210,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF
205
@@ -316,8 +227,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF
188
 static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
206
 static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
189
 {
207
 {
190
     PVBOXGUESTSESSION pSession;
208
     PVBOXGUESTSESSION pSession;
Lines 198-204 Link Here
198
     /*
216
     /*
199
      * Deal with the fast ioctl path first.
217
      * Deal with the fast ioctl path first.
200
      */
218
      */
201
@@ -497,12 +410,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u
219
@@ -512,12 +427,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u
202
 
220
 
203
 static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
221
 static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
204
 {
222
 {
Lines 216-222 Link Here
216
         Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
234
         Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
217
         return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
235
         return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
218
     }
236
     }
219
@@ -543,11 +458,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice)
237
@@ -558,11 +475,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice)
220
     /*
238
     /*
221
      * Reverse what we did in vgdrvFreeBSDAttach.
239
      * Reverse what we did in vgdrvFreeBSDAttach.
222
      */
240
      */
Lines 229-237 Link Here
229
     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
247
     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
230
 
248
 
231
     if (pState->pVMMDevMemRes)
249
     if (pState->pVMMDevMemRes)
232
@@ -698,18 +610,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice)
250
@@ -727,18 +641,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice)
233
                 if (RT_SUCCESS(rc))
251
                     VGDrvCommonProcessOptionsFromHost(&g_DevExt);
234
                 {
252
 
235
                     /*
253
                     /*
236
-                     * Configure device cloning.
254
-                     * Configure device cloning.
237
+                     * Configure device.
255
+                     * Configure device.
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-Makefile (-2 / +11 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig	2020-05-13 19:37:01 UTC
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/Makefile.orig	2019-04-16 10:09:09 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/Makefile
3
@@ -25,7 +25,7 @@
4
 #
5
 KMOD = vboxguest
6
 
7
-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
8
+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
9
 
10
 .if (${MACHINE_ARCH} == "i386")
11
  CFLAGS += -DRT_ARCH_X86
3
@@ -80,6 +80,7 @@ SRCS += \
12
@@ -80,6 +80,7 @@ SRCS += \
4
 	handletable.c \
13
 	handletable.c \
5
 	handletablectx.c \
14
 	handletablectx.c \
Lines 8-14 Link Here
8
 	thread.c
17
 	thread.c
9
 
18
 
10
 .PATH:	${.CURDIR}/common/string
19
 .PATH:	${.CURDIR}/common/string
11
@@ -139,6 +140,7 @@ SRCS += \
20
@@ -147,6 +148,7 @@ SRCS += \
12
 
21
 
13
 .PATH:	${.CURDIR}/r0drv
22
 .PATH:	${.CURDIR}/r0drv
14
 SRCS += \
23
 SRCS += \
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (-4 / +12 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig	2020-05-13 19:37:01 UTC
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig	2019-01-25 18:12:28 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
3
@@ -109,6 +109,7 @@ FILES_VBOXGUEST_NOBIN=" \
3
@@ -63,6 +63,7 @@ FILES_VBOXGUEST_NOBIN=" \
4
     ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \
5
     ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \
6
     ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \
7
+    ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \
8
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
9
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
10
     ${PATH_ROOT}/include/iprt/crc.h=>include/iprt/crc.h \
11
@@ -111,6 +112,7 @@ FILES_VBOXGUEST_NOBIN=" \
4
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
5
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
Lines 8-14 Link Here
8
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
9
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
11
@@ -171,6 +172,7 @@ FILES_VBOXGUEST_NOBIN=" \
19
@@ -181,6 +183,7 @@ FILES_VBOXGUEST_NOBIN=" \
12
     ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \
20
     ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \
21
     ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \
22
     ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \
Lines 16-22 Link Here
16
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
24
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
25
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
18
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
26
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
19
@@ -197,6 +199,7 @@ FILES_VBOXGUEST_NOBIN=" \
27
@@ -207,6 +210,7 @@ FILES_VBOXGUEST_NOBIN=" \
20
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \
28
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \
21
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \
29
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \
22
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \
30
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig	2020-06-26 09:52:40 UTC
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig	2014-12-19 16:58:04.474417000 -0500
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py	2014-11-21 10:16:35.000000000 -0500
3
@@ -0,0 +1,95 @@
3
@@ -0,0 +1,95 @@
4
+# Copyright (c) 2001, Stanford University
4
+# Copyright (c) 2001, Stanford University
5
+# All rights reserved.
5
+# All rights reserved.
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig	2020-06-26 09:53:28 UTC
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig	2014-12-19 16:58:04.474417000 -0500
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py	2014-11-21 10:16:35.000000000 -0500
3
@@ -0,0 +1,95 @@
3
@@ -0,0 +1,95 @@
4
+# Copyright (c) 2001, Stanford University
4
+# Copyright (c) 2001, Stanford University
5
+# All rights reserved.
5
+# All rights reserved.
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig	2020-06-26 09:53:39 UTC
1
--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig	2014-12-19 16:58:04.474417000 -0500
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py
2
+++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py	2014-11-21 10:16:35.000000000 -0500
3
@@ -0,0 +1,104 @@
3
@@ -0,0 +1,104 @@
4
+"""
4
+"""
5
+Copyright (C) 2009-2012 Oracle Corporation
5
+Copyright (C) 2009-2012 Oracle Corporation
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk (-79 lines)
Lines 1-79 Link Here
1
--- src/VBox/Additions/common/crOpenGL/Makefile.kmk.orig	2020-05-13 19:37:03 UTC
2
+++ src/VBox/Additions/common/crOpenGL/Makefile.kmk
3
@@ -50,9 +50,7 @@ endif
4
 if1of ($(KBUILD_TARGET), linux solaris freebsd)
5
  #VBoxOGL_DRI = 1
6
  DLLS += VBoxEGL
7
- ifn1of ($(KBUILD_TARGET),linux solaris)   # No DRI on Solaris yet
8
-  VBoxOGL_FAKEDRI = 1
9
- endif
10
+ #VBoxOGL_FAKEDRI = 1
11
 
12
  # Only Solaris right now needs C stubs because I can't figure out how to
13
  # generate the GOT based relocation ASM yet.
14
@@ -188,10 +186,12 @@ VBoxOGL_CLEAN.linux        += \
15
 	$(VBOX_PATH_CROGL_GENFILES)/linux_exports.c
16
 VBoxOGL_CLEAN.solaris        += \
17
 	$(VBOX_PATH_CROGL_GENFILES)/solaris_exports.c
18
+VBoxOGL_CLEAN.freebsd  += \
19
+	$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.c
20
 VBoxOGL_CLEAN.win      = \
21
 	$(VBOX_PATH_CROGL_GENFILES)/windows_exports.asm \
22
 	$(VBOX_PATH_CROGL_GENFILES)/cropengl.def
23
-if1of ($(KBUILD_TARGET), linux solaris)
24
+if1of ($(KBUILD_TARGET), linux solaris freebsd)
25
  ifdef VBoxOGL_DRI
26
   VBoxOGL_CLEAN   += \
27
  	$(VBOX_PATH_CROGL_GENFILES)/cr_gl.h \
28
@@ -204,6 +204,8 @@ if1of ($(KBUILD_TARGET), linux solaris)
29
  	$(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm
30
   VBoxOGL_CLEAN.solaris   += \
31
  	$(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm
32
+  VBoxOGL_CLEAN.freebsd += \
33
+ 	$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm
34
  endif
35
 endif
36
 VBoxOGL_LIBS = \
37
@@ -244,6 +246,8 @@ if1of ($(KBUILD_TARGET), linux solaris freebsd)
38
  else
39
   VBoxOGL_SONAME.linux = libGL.so.1
40
   VBoxOGL_LDFLAGS.linux += -Wl,-e,LibMain
41
+  VBoxOGL_SONAME.freebsd = libGL.so.1
42
+  VBoxOGL_LDFLAGS.freebsd += -Wl,-e,LibMain
43
  endif
44
 endif
45
 ifdef VBOX_WITH_CRHGSMI
46
@@ -252,7 +256,7 @@ endif
47
 ifdef VBOX_WITH_WDDM
48
 VBoxOGL_DEFS.win   += VBOX_WITH_WDDM
49
 endif
50
-if1of ($(KBUILD_TARGET), linux)
51
+if1of ($(KBUILD_TARGET), linux freebsd)
52
 VBoxOGL_LDFLAGS += -Wl,-z,nodelete
53
 endif
54
 ifdef VBOX_WITH_WDDM
55
@@ -418,6 +422,16 @@ $(VBOX_PATH_CROGL_GENFILES)/solaris_exports_dri.asm: \
56
 $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm: $(PATH_SUB_CURRENT)/SunOS_i386_glxapi_exports.py | $$(dir $$@)
57
 	$(call MSG_GENERATE,python,$@,$<)
58
 	$(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
59
+   else ifeq ($(KBUILD_TARGET),freebsd)
60
+$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports_dri.asm: \
61
+		$(PATH_SUB_CURRENT)/FreeBSD_i386_exports_dri.py \
62
+		$(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
63
+		| $$(dir $$@)
64
+	$(call MSG_GENERATE,python,$@,$<)
65
+	$(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
66
+$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm: $(PATH_SUB_CURRENT)/FreeBSD_i386_glxapi_exports.py | $$(dir $$@)
67
+	$(call MSG_GENERATE,python,$@,$<)
68
+	$(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
69
 
70
    else
71
 $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \
72
@@ -656,6 +670,7 @@ ifndef VBOX_USE_SYSTEM_GL_HEADERS
73
 endif
74
 VBoxEGL_LIBS           = $(VBOX_LIB_OGL) # $(VBOX_LIB_IPRT_GUEST_R3_SHARED)
75
 VBoxEGL_SONAME.linux   = libEGL.so.1
76
+VBoxEGL_SONAME.freebsd = libEGL.so.1
77
 
78
 include $(FILE_KBUILD_SUB_FOOTER)
79
 
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-98vboxadd-xclient (-9 / +8 lines)
Lines 1-18 Link Here
1
--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig	2020-05-13 19:37:09 UTC
1
--- src/VBox/Additions/x11/Installer/98vboxadd-xclient.orig	2020-06-04 13:22:34.000000000 -0300
2
+++ src/VBox/Additions/x11/Installer/98vboxadd-xclient
2
+++ src/VBox/Additions/x11/Installer/98vboxadd-xclient	2020-06-22 16:31:48.000000000 -0300
3
@@ -30,10 +30,10 @@ elif test -z "${SSH_CONNECTION}"; then
3
@@ -30,9 +30,9 @@
4
    # This script can also be triggered by a connection over SSH, which is not
4
    # This script can also be triggered by a connection over SSH, which is not
5
    # what we had in mind, so we do not start VBoxClient in that case.  We do
5
    # what we had in mind, so we do not start VBoxClient in that case.  We do
6
    # not use "exit" here as this script is "source"d, not executed.
6
    # not use "exit" here as this script is "source"d, not executed.
7
-  /usr/bin/VBoxClient --clipboard
7
-  /usr/bin/VBoxClient --clipboard
8
-  /usr/bin/VBoxClient --checkhostversion
8
-  /usr/bin/VBoxClient --checkhostversion
9
-  /usr/bin/VBoxClient --display
10
-  /usr/bin/VBoxClient --seamless
9
-  /usr/bin/VBoxClient --seamless
11
-  /usr/bin/VBoxClient --draganddrop
10
-  /usr/bin/VBoxClient --draganddrop
11
-  /usr/bin/VBoxClient --vmsvga  # In case VMSVGA emulation is enabled
12
+  /usr/local/bin/VBoxClient --clipboard
12
+  /usr/local/bin/VBoxClient --clipboard
13
+  /usr/local/bin/VBoxClient --checkhostversion
13
+  /usr/localbin/VBoxClient --checkhostversion
14
+  /usr/local/bin/VBoxClient --display
14
+  /usr/localbin/VBoxClient --seamless
15
+  /usr/local/bin/VBoxClient --seamless
15
+  /usr/localbin/VBoxClient --draganddrop
16
+  /usr/local/bin/VBoxClient --draganddrop
16
+  /usr/localbin/VBoxClient --vmsvga  # In case VMSVGA emulation is enabled
17
   /usr/bin/VBoxClient --vmsvga-x11  # In case VMSVGA emulation is enabled
18
 fi
17
 fi
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-x11-Installer-vboxclient.desktop (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig	2020-05-13 19:37:09 UTC
1
--- src/VBox/Additions/x11/Installer/vboxclient.desktop.orig	2009-06-12 12:34:57.000000000 +0000
2
+++ src/VBox/Additions/x11/Installer/vboxclient.desktop
2
+++ src/VBox/Additions/x11/Installer/vboxclient.desktop	2011-01-13 22:07:37.000000000 +0000
3
@@ -8,6 +8,6 @@ Comment[C]=VirtualBox User Session Services
3
@@ -8,6 +8,6 @@
4
 Comment=VirtualBox User Session Services
4
 Comment=VirtualBox User Session Services
5
 Comment[it]=Servizi di sessione utente di VirtualBox
5
 Comment[it]=Servizi di sessione utente di VirtualBox
6
 Comment[pl]=Usługi sesji użytkownika VirtualBox
6
 Comment[pl]=Usługi sesji użytkownika VirtualBox
(-)emulators/virtualbox-ose/files/patch-src-VBox-Devices-Network-slirp-bsd-sys-mbuf.h (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig	2020-05-13 19:42:23 UTC
1
--- src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h.orig	2015-03-02 10:09:19.000000000 -0500
2
+++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h
2
+++ src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h	2015-03-02 19:42:56.808020000 -0500
3
@@ -245,6 +245,9 @@ struct mbuf {
3
@@ -241,6 +241,9 @@
4
 #define	M_FRAG		0x00000800 /* packet is a fragment of a larger packet */
4
 #define	M_FRAG		0x00000800 /* packet is a fragment of a larger packet */
5
 #define	M_FIRSTFRAG	0x00001000 /* packet is first fragment */
5
 #define	M_FIRSTFRAG	0x00001000 /* packet is first fragment */
6
 #define	M_LASTFRAG	0x00002000 /* packet is last fragment */
6
 #define	M_LASTFRAG	0x00002000 /* packet is last fragment */
(-)emulators/virtualbox-ose/files/patch-src-VBox-Devices-PC-ipxe-Makefile.kmk (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig	2020-05-13 19:42:27 UTC
2
+++ src/VBox/Devices/PC/ipxe/Makefile.kmk
3
@@ -35,7 +35,7 @@ iPxeBiosBin_SOURCES  = $(iPxeBiosBin_0_OUTDIR)/iPxeBio
4
 iPxeBiosBin_CLEAN    = \
5
 	$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c \
6
 
7
-if1of ($(KBUILD_TARGET), darwin os2 solaris win)
8
+if1of ($(KBUILD_TARGET), darwin freebsd os2 solaris win)
9
  $$(iPxeBiosBin_0_OUTDIR)/iPxeBiosBin.c: $(PATH_SUB_CURRENT)/iPxeBiosBin.rom $(VBOX_BIN2C) | $$(dir $$@)
10
 	$(call MSG_TOOL,bin2c,iPxeBiosBin,$<,$@)
11
 	$(QUIET)$(VBOX_BIN2C) -min 32 -max 56 -mask 0x1ff -export NetBiosBinary $< $@
(-)emulators/virtualbox-ose/files/patch-src-VBox-Devices-Storage-DrvHostBase-freebsd.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp	2020-09-17 20:17:20 UTC
2
+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp
3
@@ -149,6 +149,8 @@ 
4
         else
5
             rc = RTErrConvertFromErrno(errno);
6
     }
7
+
8
+    return rc;
9
 }
10
 
11
 
(-)emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk (-20 lines)
Lines 1-20 Link Here
1
--- src/VBox/GuestHost/OpenGL/Makefile.kmk.orig	2019-07-12 08:49:27 UTC
2
+++ src/VBox/GuestHost/OpenGL/Makefile.kmk
3
@@ -94,7 +94,7 @@ VBoxOGLcrutil_DEFS.win    += CR_DEBUG_BACKDOOR_ENABLE
4
 VBoxOGLcrutil_INCS.win    += $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
5
 VBoxOGLcrutil_LIBS.win    += $(VBOX_PATH_ADDITIONS_LIB)/VBoxDispMpLogger$(VBOX_SUFF_LIB)
6
 endif
7
-if1of ($(KBUILD_TARGET), linux)
8
+if1of ($(KBUILD_TARGET), linux freebsd)
9
 VBoxOGLcrutil_LDFLAGS += -Wl,-z,nodelete
10
 endif
11
 
12
@@ -140,7 +140,7 @@ VBoxOGLhostcrutil_TEMPLATE = VBOXCROGLR3HOSTLIB
13
 if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_WDDM)
14
  VBoxOGLhostcrutil_INSTTYPE.win = both
15
 endif
16
-if1of ($(KBUILD_TARGET), linux)
17
+if1of ($(KBUILD_TARGET), linux freebsd)
18
 VBoxOGLhostcrutil_LDFLAGS = $(NO_SUCH_VARIABLE)
19
 endif
20
 VBoxOGLhostcrutil_LIBS.win =  \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (-2 / +3 lines)
Lines 1-4 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2020-05-13 19:43:53 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2019-01-25 18:19:55 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
3
@@ -82,6 +82,7 @@ SRCS += \
3
@@ -82,6 +82,7 @@ SRCS += \
4
 	assert.c \
4
 	assert.c \
Lines 8-19 Link Here
8
 	once.c \
8
 	once.c \
9
 	term.c \
9
 	term.c \
10
 	thread.c
10
 	thread.c
11
@@ -94,13 +95,14 @@ SRCS += \
11
@@ -94,14 +95,15 @@ SRCS += \
12
 	RTStrCopy.c \
12
 	RTStrCopy.c \
13
 	RTStrCopyEx.c \
13
 	RTStrCopyEx.c \
14
 	RTStrCopyP.c \
14
 	RTStrCopyP.c \
15
+	memchr.c \
15
+	memchr.c \
16
 	strformat.c \
16
 	strformat.c \
17
 	strformatnum.c \
17
 	strformatrt.c \
18
 	strformatrt.c \
18
 	strformattype.c \
19
 	strformattype.c \
19
+	stringalloc.c \
20
+	stringalloc.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (-3 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig	2020-05-13 19:43:53 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig	2019-01-25 18:19:55 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
2
+++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
3
@@ -118,6 +118,7 @@ FILES_VBOXDRV_NOBIN=" \
3
@@ -119,6 +119,7 @@ FILES_VBOXDRV_NOBIN=" \
4
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \
4
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \
5
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
5
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
Lines 8-19 Link Here
8
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
8
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
9
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \
9
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
11
@@ -127,13 +128,14 @@ FILES_VBOXDRV_NOBIN=" \
11
@@ -128,14 +129,15 @@ FILES_VBOXDRV_NOBIN=" \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \
15
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
15
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
19
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
19
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
20
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-Makefile.kmk (-13 / +8 lines)
Lines 1-25 Link Here
1
Fix kmod panic when VIMAGE is disabled in the kernel and port
1
--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig	2019-05-13 13:33:07 UTC
2
3
Submitted by:	Gleb Kurtsou <gleb@freebsd.org>
4
--- src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk.orig	2020-05-13 19:43:54 UTC
5
+++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk
2
+++ src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk
6
@@ -203,12 +203,15 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
3
@@ -206,10 +206,14 @@ $$(VBoxNetAdp-src_0_OUTDIR)/Makefile: \
7
 		$$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
4
 		$$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
8
 		| $$(dir $$@)
5
 		| $$(dir $$@)
9
 	$(QUIET)$(RM) -f -- $@
6
 	$(QUIET)$(RM) -f -- $@
10
- ifndef VBOX_WITH_HARDENING
7
- ifndef VBOX_WITH_HARDENING
11
-	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
8
-	$(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
12
- else
9
- else
13
 	$(QUIET)$(CP) -f $< $@
10
 	$(QUIET)$(CP) -f $< $@
14
+ ifndef VBOX_WITH_HARDENING
11
+ ifndef VBOX_WITH_HARDENING
15
+	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@
12
+	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@
16
+	${QUIET}$(MV) -f $@.tmp $@
13
+	$(QUIET)$(MV) -f $@.tmp $@
17
  endif
14
+ endif
18
-
19
+ ifndef VBOX_WITH_NETFLT_VIMAGE
15
+ ifndef VBOX_WITH_NETFLT_VIMAGE
20
+	$(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@
16
+	$(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@
21
+	${QUIET}$(MV) -f $@.tmp $@
17
+	$(QUIET)$(MV) -f $@.tmp $@
22
+ endif
18
  endif
19
 
23
 endif # freebsd
20
 endif # freebsd
24
 
25
 include $(FILE_KBUILD_SUB_FOOTER)
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c (-14 lines)
Lines 1-14 Link Here
1
--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c.orig	2020-05-13 19:43:54 UTC
2
+++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c
3
@@ -235,7 +235,11 @@ static void VBoxNetAdpFreeBSDNetstart(struct ifnet *if
4
     ifp->if_drv_flags |= IFF_DRV_OACTIVE;
5
     while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
6
     {
7
+#if __FreeBSD_version >= 1100036
8
+        if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
9
+#else
10
         ifp->if_opackets++;
11
+#endif
12
         IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
13
         BPF_MTAP(ifp, m);
14
         m_freem(m);
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c (-44 / +20 lines)
Lines 1-4 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig	2018-10-15 14:30:58 UTC
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig	2019-04-16 10:16:39 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
3
@@ -52,6 +52,7 @@
3
@@ -52,6 +52,7 @@
4
 #include <net/if_dl.h>
4
 #include <net/if_dl.h>
Lines 16-46 Link Here
16
 
16
 
17
 static int vboxnetflt_modevent(struct module *, int, void *);
17
 static int vboxnetflt_modevent(struct module *, int, void *);
18
 static ng_constructor_t    ng_vboxnetflt_constructor;
18
 static ng_constructor_t    ng_vboxnetflt_constructor;
19
@@ -370,7 +372,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i
19
@@ -436,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
20
         mtx_lock_spin(&pThis->u.s.inq.ifq_mtx);
21
         _IF_ENQUEUE(&pThis->u.s.inq, m);
22
         mtx_unlock_spin(&pThis->u.s.inq.ifq_mtx);
23
+#if __FreeBSD_version >= 1100100
24
+        taskqueue_enqueue(taskqueue_fast, &pThis->u.s.tskin);
25
+#else
26
         taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskin);
27
+#endif
28
     }
29
     /*
30
      * Handle mbufs on the outgoing hook, frames going to the interface
31
@@ -388,7 +394,11 @@ static int ng_vboxnetflt_rcvdata(hook_p hook, item_p i
32
         mtx_lock_spin(&pThis->u.s.outq.ifq_mtx);
33
         _IF_ENQUEUE(&pThis->u.s.outq, m);
34
         mtx_unlock_spin(&pThis->u.s.outq.ifq_mtx);
35
+#if __FreeBSD_version >= 1100100
36
+        taskqueue_enqueue(taskqueue_fast, &pThis->u.s.tskout);
37
+#else
38
         taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskout);
39
+#endif
40
     }
41
     else
42
     {
43
@@ -428,6 +438,8 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
44
     struct ifnet *ifp = pThis->u.s.ifp;
20
     struct ifnet *ifp = pThis->u.s.ifp;
45
     unsigned int cSegs = 0;
21
     unsigned int cSegs = 0;
46
     bool fDropIt = false, fActive;
22
     bool fDropIt = false, fActive;
Lines 49-55 Link Here
49
     PINTNETSG pSG;
25
     PINTNETSG pSG;
50
 
26
 
51
     VBOXCURVNET_SET(ifp->if_vnet);
27
     VBOXCURVNET_SET(ifp->if_vnet);
52
@@ -440,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
28
@@ -448,6 +452,19 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
53
         if (m == NULL)
29
         if (m == NULL)
54
             break;
30
             break;
55
 
31
 
Lines 69-75 Link Here
69
         for (m0 = m; m0 != NULL; m0 = m0->m_next)
45
         for (m0 = m; m0 != NULL; m0 = m0->m_next)
70
             if (m0->m_len > 0)
46
             if (m0->m_len > 0)
71
                 cSegs++;
47
                 cSegs++;
72
@@ -454,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
48
@@ -462,6 +479,27 @@ static void vboxNetFltFreeBSDinput(void *arg, int pend
73
         vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0);
49
         vboxNetFltFreeBSDMBufToSG(pThis, m, pSG, cSegs, 0);
74
         fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE);
50
         fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, INTNETTRUNKDIR_WIRE);
75
         RTMemTmpFree(pSG);
51
         RTMemTmpFree(pSG);
Lines 97-103 Link Here
97
         if (fDropIt)
73
         if (fDropIt)
98
             m_freem(m);
74
             m_freem(m);
99
         else
75
         else
100
@@ -513,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen
76
@@ -521,6 +559,7 @@ static void vboxNetFltFreeBSDoutput(void *arg, int pen
101
  */
77
  */
102
 int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst)
78
 int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *pvIfData, PINTNETSG pSG, uint32_t fDst)
103
 {
79
 {
Lines 105-111 Link Here
105
     NOREF(pvIfData);
81
     NOREF(pvIfData);
106
 
82
 
107
     void (*input_f)(struct ifnet *, struct mbuf *);
83
     void (*input_f)(struct ifnet *, struct mbuf *);
108
@@ -529,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
84
@@ -537,10 +576,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
109
     {
85
     {
110
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
86
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
111
         if (m == NULL)
87
         if (m == NULL)
Lines 122-128 Link Here
122
 
98
 
123
         m->m_flags |= M_PKTHDR;
99
         m->m_flags |= M_PKTHDR;
124
         ether_output_frame(ifp, m);
100
         ether_output_frame(ifp, m);
125
@@ -542,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
101
@@ -550,10 +595,16 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
126
     {
102
     {
127
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
103
         m = vboxNetFltFreeBSDSGMBufFromSG(pThis, pSG);
128
         if (m == NULL)
104
         if (m == NULL)
Lines 139-145 Link Here
139
         /*
115
         /*
140
          * Delivering packets to the host will be captured by the
116
          * Delivering packets to the host will be captured by the
141
          * input hook. Tag the packet with a mbuf tag so that we
117
          * input hook. Tag the packet with a mbuf tag so that we
142
@@ -556,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
118
@@ -564,6 +615,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
143
         if (mtag == NULL)
119
         if (mtag == NULL)
144
         {
120
         {
145
             m_freem(m);
121
             m_freem(m);
Lines 147-153 Link Here
147
             return VERR_NO_MEMORY;
123
             return VERR_NO_MEMORY;
148
         }
124
         }
149
 
125
 
150
@@ -566,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
126
@@ -574,6 +626,7 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS pThis, void *p
151
         ifp->if_input(ifp, m);
127
         ifp->if_input(ifp, m);
152
     }
128
     }
153
     VBOXCURVNET_RESTORE();
129
     VBOXCURVNET_RESTORE();
Lines 155-161 Link Here
155
     return VINF_SUCCESS;
131
     return VINF_SUCCESS;
156
 }
132
 }
157
 
133
 
158
@@ -578,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT
134
@@ -586,6 +639,7 @@ static bool vboxNetFltFreeBsdIsPromiscuous(PVBOXNETFLT
159
 
135
 
160
 int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext)
136
 int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext)
161
 {
137
 {
Lines 163-169 Link Here
163
     char nam[NG_NODESIZ];
139
     char nam[NG_NODESIZ];
164
     struct ifnet *ifp;
140
     struct ifnet *ifp;
165
     node_p node;
141
     node_p node;
166
@@ -586,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
142
@@ -594,7 +648,10 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
167
     NOREF(pvContext);
143
     NOREF(pvContext);
168
     ifp = ifunit(pThis->szName);
144
     ifp = ifunit(pThis->szName);
169
     if (ifp == NULL)
145
     if (ifp == NULL)
Lines 174-180 Link Here
174
 
150
 
175
     /* Create a new netgraph node for this instance */
151
     /* Create a new netgraph node for this instance */
176
     if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0)
152
     if (ng_make_node_common(&ng_vboxnetflt_typestruct, &node) != 0)
177
@@ -630,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
153
@@ -638,12 +695,14 @@ int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, voi
178
         vboxNetFltRelease(pThis, true /*fBusy*/);
154
         vboxNetFltRelease(pThis, true /*fBusy*/);
179
     }
155
     }
180
     VBOXCURVNET_RESTORE();
156
     VBOXCURVNET_RESTORE();
Lines 189-195 Link Here
189
     struct ifnet *ifp, *ifp0;
165
     struct ifnet *ifp, *ifp0;
190
 
166
 
191
     ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *);
167
     ifp = ASMAtomicUoReadPtrT(&pThis->u.s.ifp, struct ifnet *);
192
@@ -652,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
168
@@ -660,6 +719,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
193
         pThis->u.s.node = NULL;
169
         pThis->u.s.node = NULL;
194
     }
170
     }
195
     VBOXCURVNET_RESTORE();
171
     VBOXCURVNET_RESTORE();
Lines 197-203 Link Here
197
 
173
 
198
     if (ifp0 != NULL)
174
     if (ifp0 != NULL)
199
     {
175
     {
200
@@ -664,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
176
@@ -672,6 +732,7 @@ bool vboxNetFltOsMaybeRediscovered(PVBOXNETFLTINS pThi
201
 
177
 
202
 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
178
 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
203
 {
179
 {
Lines 205-211 Link Here
205
 
181
 
206
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin);
182
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskin);
207
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout);
183
     taskqueue_drain(taskqueue_fast, &pThis->u.s.tskout);
208
@@ -676,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
184
@@ -684,6 +745,7 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
209
         ng_rmnode_self(pThis->u.s.node);
185
         ng_rmnode_self(pThis->u.s.node);
210
     VBOXCURVNET_RESTORE();
186
     VBOXCURVNET_RESTORE();
211
     pThis->u.s.node = NULL;
187
     pThis->u.s.node = NULL;
Lines 213-219 Link Here
213
 }
189
 }
214
 
190
 
215
 int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
191
 int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
216
@@ -689,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
192
@@ -697,6 +759,7 @@ int vboxNetFltOsPreInitInstance(PVBOXNETFLTINS pThis)
217
 
193
 
218
 void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive)
194
 void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive)
219
 {
195
 {
Lines 221-227 Link Here
221
     struct ifnet *ifp;
197
     struct ifnet *ifp;
222
     struct ifreq ifreq;
198
     struct ifreq ifreq;
223
     int error;
199
     int error;
224
@@ -722,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
200
@@ -730,7 +793,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
225
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
201
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
226
             sizeof(struct ngm_connect), M_NOWAIT);
202
             sizeof(struct ngm_connect), M_NOWAIT);
227
         if (msg == NULL)
203
         if (msg == NULL)
Lines 232-238 Link Here
232
         con = (struct ngm_connect *)msg->data;
208
         con = (struct ngm_connect *)msg->data;
233
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname);
209
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:", ifp->if_xname);
234
         strlcpy(con->ourhook, "lower", NG_HOOKSIZ);
210
         strlcpy(con->ourhook, "lower", NG_HOOKSIZ);
235
@@ -736,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
211
@@ -744,7 +810,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
236
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
212
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_CONNECT,
237
             sizeof(struct ngm_connect), M_NOWAIT);
213
             sizeof(struct ngm_connect), M_NOWAIT);
238
         if (msg == NULL)
214
         if (msg == NULL)
Lines 243-249 Link Here
243
         con = (struct ngm_connect *)msg->data;
219
         con = (struct ngm_connect *)msg->data;
244
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:",
220
         snprintf(con->path, NG_PATHSIZ, "vboxnetflt_%s:",
245
             ifp->if_xname);
221
             ifp->if_xname);
246
@@ -759,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
222
@@ -767,7 +836,10 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
247
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
223
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
248
             sizeof(struct ngm_rmhook), M_NOWAIT);
224
             sizeof(struct ngm_rmhook), M_NOWAIT);
249
         if (msg == NULL)
225
         if (msg == NULL)
Lines 254-260 Link Here
254
         rm = (struct ngm_rmhook *)msg->data;
230
         rm = (struct ngm_rmhook *)msg->data;
255
         strlcpy(rm->ourhook, "input", NG_HOOKSIZ);
231
         strlcpy(rm->ourhook, "input", NG_HOOKSIZ);
256
         NG_SEND_MSG_PATH(error, node, msg, path, 0);
232
         NG_SEND_MSG_PATH(error, node, msg, path, 0);
257
@@ -770,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
233
@@ -778,12 +850,16 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, b
258
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
234
         NG_MKMESSAGE(msg, NGM_GENERIC_COOKIE, NGM_RMHOOK,
259
             sizeof(struct ngm_rmhook), M_NOWAIT);
235
             sizeof(struct ngm_rmhook), M_NOWAIT);
260
         if (msg == NULL)
236
         if (msg == NULL)
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-Makefile.kmk (-4 / +5 lines)
Lines 1-6 Link Here
1
--- src/VBox/Installer/Makefile.kmk.orig	2020-05-13 19:44:01 UTC
1
--- src/VBox/Installer/Makefile.kmk.orig	2009-10-05 14:31:40.000000000 +0200
2
+++ src/VBox/Installer/Makefile.kmk
2
+++ src/VBox/Installer/Makefile.kmk	2009-10-05 14:32:09.000000000 +0200
3
@@ -41,9 +41,11 @@ ifndef VBOX_ONLY_SDK
3
@@ -38,10 +38,12 @@
4
  if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win"
4
  if "$(KBUILD_TARGET)" == "win" && "$(KBUILD_HOST)" == "win"
5
   include $(PATH_SUB_CURRENT)/win/Makefile.kmk
5
   include $(PATH_SUB_CURRENT)/win/Makefile.kmk
6
  endif
6
  endif
Lines 8-14 Link Here
8
  if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd"
8
  if "$(KBUILD_TARGET)" == "freebsd" && "$(KBUILD_HOST)" == "freebsd"
9
   include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk
9
   include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk
10
  endif
10
  endif
11
 endif
11
+endif
12
+endif
12
 endif
13
 
13
 
14
 include $(PATH_SUB_CURRENT)/common/Makefile.kmk
14
 include $(PATH_SUB_CURRENT)/common/Makefile.kmk
15
 
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh (-1 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/Installer/freebsd/VBox.sh.orig	2016-08-27 05:10:34 UTC
1
--- src/VBox/Installer/freebsd/VBox.sh.orig	2016-08-27 05:10:34 UTC
2
+++ src/VBox/Installer/freebsd/VBox.sh
2
+++ src/VBox/Installer/freebsd/VBox.sh
3
@@ -0,0 +1,64 @@
3
@@ -0,0 +1,67 @@
4
+#!/bin/sh
4
+#!/bin/sh
5
+#
5
+#
6
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
6
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
Lines 38-43 Link Here
38
+    VirtualBox|virtualbox)
38
+    VirtualBox|virtualbox)
39
+        exec "$INSTALL_DIR/VirtualBox" "$@"
39
+        exec "$INSTALL_DIR/VirtualBox" "$@"
40
+        ;;
40
+        ;;
41
+    VirtualBoxVM|virtualboxvm)
42
+        exec "$INSTALL_DIR/VirtualBoxVM" "$@"
43
+        ;;
41
+    VBoxManage|vboxmanage)
44
+    VBoxManage|vboxmanage)
42
+        exec "$INSTALL_DIR/VBoxManage" "$@"
45
+        exec "$INSTALL_DIR/VBoxManage" "$@"
43
+        ;;
46
+        ;;
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-virtualbox.desktop (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Installer/freebsd/virtualbox.desktop.orig	2020-05-13 19:44:01 UTC
1
--- src/VBox/Installer/freebsd/virtualbox.desktop.orig	2010-10-07 10:42:04.000000000 +0200
2
+++ src/VBox/Installer/freebsd/virtualbox.desktop
2
+++ src/VBox/Installer/freebsd/virtualbox.desktop	2010-10-07 10:43:20.000000000 +0200
3
@@ -7,7 +7,6 @@ GenericName=Virtual Machine
3
@@ -7,7 +7,6 @@
4
 Type=Application
4
 Type=Application
5
 Exec=VirtualBox
5
 Exec=VirtualBox
6
 TryExec=VirtualBox
6
 TryExec=VirtualBox
(-)emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-VirtualBoxImpl.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig	2020-05-13 19:44:10 UTC
1
--- src/VBox/Main/src-server/VirtualBoxImpl.cpp.orig	2015-04-01 12:15:14.000000000 -0400
2
+++ src/VBox/Main/src-server/VirtualBoxImpl.cpp
2
+++ src/VBox/Main/src-server/VirtualBoxImpl.cpp	2015-04-07 12:25:59.226583000 -0400
3
@@ -2251,7 +2251,7 @@ int VirtualBox::i_encryptSettingBytes(const uint8_t *a
3
@@ -2172,7 +2172,7 @@
4
     if (aCiphertextSize < 32)
4
     if (aCiphertextSize < 32)
5
         return VERR_INVALID_PARAMETER;
5
         return VERR_INVALID_PARAMETER;
6
 
6
 
(-)emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-HostHardwareFreeBSD.cpp (-14 lines)
Lines 1-14 Link Here
1
--- src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp.orig	2020-05-13 19:44:10 UTC
2
+++ src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
3
@@ -253,8 +253,9 @@ static int getDVDInfoFromCAM(DriveInfoList *pList, boo
4
                         PeriphMatchPattern.pattern.periph_pattern.path_id    = paMatches[i].result.device_result.path_id;
5
                         PeriphMatchPattern.pattern.periph_pattern.target_id  = paMatches[i].result.device_result.target_id;
6
                         PeriphMatchPattern.pattern.periph_pattern.target_lun = paMatches[i].result.device_result.target_lun;
7
-                        PeriphMatchPattern.pattern.periph_pattern.flags      = PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET |
8
-                                                                               PERIPH_MATCH_LUN;
9
+                        PeriphMatchPattern.pattern.periph_pattern.flags      = static_cast<periph_pattern_flags>
10
+                                                                               (PERIPH_MATCH_PATH | PERIPH_MATCH_TARGET |
11
+                                                                               PERIPH_MATCH_LUN);
12
                         PeriphCCB.cdm.num_patterns    = 1;
13
                         PeriphCCB.cdm.pattern_buf_len = sizeof(struct dev_match_result);
14
                         PeriphCCB.cdm.patterns        = &PeriphMatchPattern;
(-)emulators/virtualbox-ose/files/patch-src-VBox-Main-webservice-Makefile.kmk (-4 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/webservice/Makefile.kmk.orig	2020-05-13 19:44:11 UTC
1
--- src/VBox/Main/webservice/Makefile.kmk.orig	2015-10-15 13:59:24 UTC
2
+++ src/VBox/Main/webservice/Makefile.kmk
2
+++ src/VBox/Main/webservice/Makefile.kmk
3
@@ -158,7 +158,6 @@ VBOX_PATH_IDL                 := $(abspath $(PATH_SUB_
3
@@ -159,7 +159,6 @@ VBOX_PATH_IDL                 := $(abspa
4
 RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
4
 RECOMPILE_ON_MAKEFILE_CURRENT := $(MAKEFILE_CURRENT)
5
 
5
 
6
 PATH_TARGET_SOAPDEMOXML       := $(VBOXWEB_OUT_DIR)/demo_soapxml
6
 PATH_TARGET_SOAPDEMOXML       := $(VBOXWEB_OUT_DIR)/demo_soapxml
Lines 8-14 Link Here
8
 PATH_TARGET_SOAPDEMONSMAPS    := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
8
 PATH_TARGET_SOAPDEMONSMAPS    := $(VBOXWEB_OUT_DIR)/demo_namespacemaps
9
 PATH_TARGET_WEBTEST           := $(VBOXWEB_OUT_DIR)/webtest
9
 PATH_TARGET_WEBTEST           := $(VBOXWEB_OUT_DIR)/webtest
10
 
10
 
11
@@ -553,8 +552,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | $$(dir $$@)
11
@@ -515,8 +514,6 @@ $$(VBOX_JWSSRC_JAR): $$(VBOX_JWS_JAR) | 
12
 	$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
12
 	$(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts \
13
 	$(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
13
 	$(wildcard $(PATH_TARGET_SOAPDEMOXML)/*) \
14
 	$(PATH_TARGET_SOAPDEMOXML)/dummy_file \
14
 	$(PATH_TARGET_SOAPDEMOXML)/dummy_file \
Lines 17-23 Link Here
17
 	$(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
17
 	$(wildcard $(PATH_TARGET_SOAPDEMONSMAPS)/*) \
18
 	$(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
18
 	$(PATH_TARGET_SOAPDEMONSMAPS)/dummy_file
19
 
19
 
20
@@ -774,17 +771,14 @@ endif
20
@@ -695,17 +692,14 @@ $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts
21
 # any more. Ignoring the exit code is the simple solution, accepting the error.
21
 # any more. Ignoring the exit code is the simple solution, accepting the error.
22
 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
22
 $(VBOXWEB_OUT_DIR)/gsoap_copy_all_ts: $(VBOXWEB_OUT_DIR)/gsoap_generate_all_ts | $$(dir $$@)
23
 	$(RM) -f $@
23
 	$(RM) -f $@
(-)emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk (-13 / +4 lines)
Lines 1-8 Link Here
1
--- src/VBox/Runtime/Makefile.kmk.orig	2020-07-09 16:57:23 UTC
1
--- src/VBox/Runtime/Makefile.kmk.orig	2014-07-15 13:25:15.000000000 -0400
2
+++ src/VBox/Runtime/Makefile.kmk
2
+++ src/VBox/Runtime/Makefile.kmk	2014-07-16 17:15:58.000000000 -0400
3
@@ -173,6 +173,11 @@ $(IPRT_OUT_DIR)/oiddb.h.ts +| $(IPRT_OUT_DIR)/oiddb.h:
3
@@ -146,6 +146,11 @@
4
 	IPRT_BLDCFG_TYPE=\"$(KBUILD_TYPE)\"
4
 
5
 
5
 
6
 #
6
 #
7
+# Set the defines that utf8-posix.cpp needs. It's used by several targets.
7
+# Set the defines that utf8-posix.cpp needs. It's used by several targets.
8
+#
8
+#
Lines 12-23 Link Here
12
 # Unicode Specification reader used to regenerate unidata-*.cpp.
12
 # Unicode Specification reader used to regenerate unidata-*.cpp.
13
 #
13
 #
14
 uniread_TEMPLATE = VBoxBldProg
14
 uniread_TEMPLATE = VBoxBldProg
15
@@ -1632,7 +1637,7 @@ VBoxRT_SOURCES.solaris        += \
16
 VBoxRT_SOURCES.darwin         += \
17
 	r3/posix/fileaio-posix.cpp
18
 VBoxRT_SOURCES.freebsd        += \
19
-	r3/freebsd/fileaio-freebsd.cpp
20
+	r3/posix/fileaio-posix.cpp
21
 VBoxRT_INCS                   := $(RuntimeR3_INCS)
22
 VBoxRT_INCS.$(KBUILD_TARGET)  := $(RuntimeR3_INCS.$(KBUILD_TARGET))
23
 VBoxRT_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) := $(RuntimeR3_INCS.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH))
(-)emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-sleepqueue-r0drv-freebsd.h (-3 / +3 lines)
Lines 7-15 Link Here
7
what tvtohz does.
7
what tvtohz does.
8
8
9
Submitted by:	Andriy Gapon <avg@FreeBSD.org>
9
Submitted by:	Andriy Gapon <avg@FreeBSD.org>
10
--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig	2020-05-13 19:44:32 UTC
10
--- src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h.orig	2012-12-19 19:27:29.000000000 +0100
11
+++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h
11
+++ src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h	2012-12-20 12:07:48.941861966 +0100
12
@@ -82,6 +82,8 @@ DECLINLINE(uint32_t) rtR0SemBsdWaitUpdateTimeout(PRTR0
12
@@ -82,6 +82,8 @@
13
     uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000));
13
     uint64_t cTicks = ASMMultU64ByU32DivByU32(uTimeout, hz, UINT32_C(1000000000));
14
     if (cTicks >= INT_MAX)
14
     if (cTicks >= INT_MAX)
15
         return RTSEMWAIT_FLAGS_INDEFINITE;
15
         return RTSEMWAIT_FLAGS_INDEFINITE;
(-)emulators/virtualbox-ose/files/patch-src-recompiler-Makefile.kmk (-10 lines)
Lines 1-10 Link Here
1
--- src/recompiler/Makefile.kmk.orig	2020-05-13 19:46:49 UTC
2
+++ src/recompiler/Makefile.kmk
3
@@ -41,6 +41,7 @@ endif
4
 #
5
 ifneq ($(KBUILD_TARGET),win)
6
  VBoxRemPrimary_TEMPLATE       = VBOXR3NP
7
+ VBoxRemPrimary_TOOL.freebsd   = VBoxGccFreeBSD
8
  # workaround the regparm bug in gcc <= 3.3
9
  VBoxRemPrimary_DEFS           = $(if $(VBOX_GCC_BUGGY_REGPARM),GCC_WITH_BUGGY_REGPARM,)
10
 else
(-)emulators/virtualbox-ose/files/patch-src-recompiler-Sun-testmath.c (-22 lines)
Lines 1-22 Link Here
1
--- src/recompiler/Sun/testmath.c.orig	2020-05-13 19:46:49 UTC
2
+++ src/recompiler/Sun/testmath.c
3
@@ -273,8 +273,6 @@ extern int testmath(void)
4
 #endif
5
     set_cw(0x27f);
6
 
7
-    CHECK(logl(2.7182818284590452353602874713526625L), 1.0);
8
-
9
     CHECK(remainderl(1.0L, 1.0L), 0.0);
10
     CHECK(remainderl(1.0L, 1.5L), -0.5);
11
     CHECK(remainderl(42.0L, 34.25L), 7.75);
12
@@ -341,10 +339,6 @@ extern int testmath(void)
13
 
14
     CHECK(tanl(0.0L), 0.0);
15
     CHECK(tanl(0.7853981633974483096156608458198757L), 1.0);
16
-
17
-    CHECK(powl(0.0, 0.0), 1.0);
18
-    CHECK(powl(2.0, 2.0), 4.0);
19
-    CHECK(powl(3.0, 3.0), 27.0);
20
 
21
     return cErrors;
22
 }
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_dri__glx.h (-33 lines)
Lines 1-33 Link Here
1
--- src/VBox/Additions/common/crOpenGL/dri_glx.h.orig	2020-07-09 16:50:09 UTC
2
+++ src/VBox/Additions/common/crOpenGL/dri_glx.h
3
@@ -111,23 +111,23 @@ extern DECLEXPORT(const char *) VBOXGLXTAG(glXQueryExt
4
 extern DECLEXPORT(GLXPbufferSGIX) VBOXGLXTAG(glXCreateGLXPbufferSGIX)
5
 (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
6
 
7
-extern DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)
8
-(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
9
+extern DECLEXPORT(void) VBOXGLXTAG(glXQueryGLXPbufferSGIX)
10
+(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
11
 
12
 extern DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXTAG(glXChooseFBConfigSGIX)
13
 (Display *dpy, int screen, int *attrib_list, int *nelements);
14
 
15
-extern DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf);
16
+extern DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf);
17
 extern DECLEXPORT(void) VBOXGLXTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask);
18
 extern DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
19
 
20
 extern DECLEXPORT(GLXFBConfigSGIX) VBOXGLXTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis);
21
-extern DECLEXPORT(XVisualInfo *) VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config);
22
+extern DECLEXPORT(XVisualInfo *) VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config);
23
 extern DECLEXPORT(GLXContext) VBOXGLXTAG(glXCreateContextWithConfigSGIX)
24
-(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
25
+(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
26
 
27
-extern DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap);
28
-extern DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value);
29
+extern DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
30
+extern DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
31
 
32
 /*
33
  * GLX 1.3 functions
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_fakedri__drv.h (-25 lines)
Lines 1-25 Link Here
1
--- src/VBox/Additions/common/crOpenGL/fakedri_drv.h.orig	2020-07-09 16:50:09 UTC
2
+++ src/VBox/Additions/common/crOpenGL/fakedri_drv.h
3
@@ -80,16 +80,16 @@ extern Bool VBOXGLXENTRYTAG(glXQueryVersion)(Display *
4
 extern XVisualInfo * VBOXGLXENTRYTAG(glXChooseVisual)(Display *dpy, int screen, int *attribList) ;
5
 extern const char * VBOXGLXENTRYTAG(glXQueryExtensionsString)(Display *dpy, int screen) ;
6
 extern GLXPbufferSGIX VBOXGLXENTRYTAG(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
7
-extern int VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
8
+extern void VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
9
 extern GLXFBConfigSGIX * VBOXGLXENTRYTAG(glXChooseFBConfigSGIX)(Display *dpy, int screen, int *attrib_list, int *nelements);
10
-extern void VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf) ;
11
+extern void VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf) ;
12
 extern void VBOXGLXENTRYTAG(glXSelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask) ;
13
 extern void VBOXGLXENTRYTAG(glXGetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask) ;
14
 extern GLXFBConfigSGIX VBOXGLXENTRYTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis) ;
15
-extern XVisualInfo * VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config) ;
16
-extern GLXContext VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
17
-extern GLXPixmap VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap) ;
18
-extern int VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value) ;
19
+extern XVisualInfo * VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config) ;
20
+extern GLXContext VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
21
+extern GLXPixmap VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap) ;
22
+extern int VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value) ;
23
 extern GLXFBConfig * VBOXGLXENTRYTAG(glXChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements) ;
24
 extern GLXPbuffer VBOXGLXENTRYTAG(glXCreatePbuffer)(Display *dpy, GLXFBConfig config, ATTRIB_TYPE *attrib_list) ;
25
 extern GLXPixmap VBOXGLXENTRYTAG(glXCreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const ATTRIB_TYPE *attrib_list) ;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx.c (-58 lines)
Lines 1-58 Link Here
1
--- src/VBox/Additions/common/crOpenGL/glx.c.orig	2020-07-09 16:50:09 UTC
2
+++ src/VBox/Additions/common/crOpenGL/glx.c
3
@@ -742,7 +742,7 @@ VBOXGLXTAG(glXCreateGLXPbufferSGIX)(Display *dpy, GLXF
4
     return 0;
5
 }
6
 
7
-DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf)
8
+DECLEXPORT(void) VBOXGLXTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf)
9
 {
10
     (void) dpy;
11
     (void) pbuf;
12
@@ -763,7 +763,7 @@ DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEventSGIX)(D
13
     (void) mask;
14
 }
15
 
16
-DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf,
17
+DECLEXPORT(void) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf,
18
                                                    int attribute, unsigned int *value)
19
 {
20
     (void) dpy;
21
@@ -771,10 +771,9 @@ DECLEXPORT(int) VBOXGLXTAG(glXQueryGLXPbufferSGIX)(Dis
22
     (void) attribute;
23
     (void) value;
24
     crWarning("glXQueryGLXPbufferSGIX not implemented by Chromium");
25
-    return 0;
26
 }
27
 
28
-DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config,
29
+DECLEXPORT(int) VBOXGLXTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config,
30
                                                      int attribute, int *value)
31
 {
32
     return VBOXGLXTAG(glXGetFBConfigAttrib)(dpy, config, attribute, value);
33
@@ -789,14 +788,14 @@ VBOXGLXTAG(glXChooseFBConfigSGIX)(Display *dpy, int sc
34
 
35
 DECLEXPORT(GLXPixmap)
36
 VBOXGLXTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy,
37
-                                             GLXFBConfig config,
38
+                                             GLXFBConfigSGIX config,
39
                                              Pixmap pixmap)
40
 {
41
     return VBOXGLXTAG(glXCreatePixmap)(dpy, config, pixmap, NULL);
42
 }
43
 
44
 DECLEXPORT(GLXContext)
45
-VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfig config,
46
+VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config,
47
                                            int render_type,
48
                                            GLXContext share_list,
49
                                            Bool direct)
50
@@ -812,7 +811,7 @@ VBOXGLXTAG(glXCreateContextWithConfigSGIX)(Display *dp
51
 
52
 DECLEXPORT(XVisualInfo *)
53
 VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy,
54
-                                         GLXFBConfig config)
55
+                                         GLXFBConfigSGIX config)
56
 {
57
     return visualInfoFromFBConfig(dpy, config);
58
 }
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__c__exports.c (-50 lines)
Lines 1-50 Link Here
1
--- src/VBox/Additions/common/crOpenGL/glx_c_exports.c.orig	2020-10-25 11:52:00 UTC
2
+++ src/VBox/Additions/common/crOpenGL/glx_c_exports.c
3
@@ -213,8 +213,8 @@ DECLEXPORT(GLXPbufferSGIX) VBOXGLXENTRYTAG(glXCreateGL
4
     return glxim.CreateGLXPbufferSGIX(dpy, config, width, height, attrib_list);
5
 }
6
 
7
-DECLEXPORT(int) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)
8
-(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value)
9
+DECLEXPORT(void) VBOXGLXENTRYTAG(glXQueryGLXPbufferSGIX)
10
+(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value)
11
 {
12
     return glxim.QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
13
 }
14
@@ -225,7 +225,7 @@ DECLEXPORT(GLXFBConfigSGIX *) VBOXGLXENTRYTAG(glXChoos
15
     return glxim.ChooseFBConfigSGIX(dpy, screen, attrib_list, nelements);
16
 }
17
 
18
-DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf)
19
+DECLEXPORT(void) VBOXGLXENTRYTAG(glXDestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf)
20
 {
21
     return glxim.DestroyGLXPbufferSGIX(dpy, pbuf);
22
 }
23
@@ -245,23 +245,23 @@ DECLEXPORT(GLXFBConfigSGIX) VBOXGLXENTRYTAG(glXGetFBCo
24
     return glxim.GetFBConfigFromVisualSGIX(dpy, vis);
25
 }
26
 
27
-DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config)
28
+DECLEXPORT(XVisualInfo *) VBOXGLXENTRYTAG(glXGetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config)
29
 {
30
     return glxim.GetVisualFromFBConfigSGIX(dpy, config);
31
 }
32
 
33
 DECLEXPORT(GLXContext) VBOXGLXENTRYTAG(glXCreateContextWithConfigSGIX)
34
-(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct)
35
+(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct)
36
 {
37
     return glxim.CreateContextWithConfigSGIX(dpy, config, render_type, share_list, direct);
38
 }
39
 
40
-DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap)
41
+DECLEXPORT(GLXPixmap) VBOXGLXENTRYTAG(glXCreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap)
42
 {
43
     return glxim.CreateGLXPixmapWithConfigSGIX(dpy, config, pixmap);
44
 }
45
 
46
-DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value)
47
+DECLEXPORT(int) VBOXGLXENTRYTAG(glXGetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value)
48
 {
49
     return glxim.GetFBConfigAttribSGIX(dpy, config, attribute, value);
50
 }
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_glx__proto.h (-33 lines)
Lines 1-33 Link Here
1
--- src/VBox/Additions/common/crOpenGL/glx_proto.h.orig	2020-07-09 16:50:09 UTC
2
+++ src/VBox/Additions/common/crOpenGL/glx_proto.h
3
@@ -95,23 +95,23 @@ typedef const char * (*PGLXFUNC_QueryExtensionsString)
4
 typedef GLXPbufferSGIX (*PGLXFUNC_CreateGLXPbufferSGIX)
5
 (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
6
 
7
-typedef int (*PGLXFUNC_QueryGLXPbufferSGIX)
8
-(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
9
+typedef void (*PGLXFUNC_QueryGLXPbufferSGIX)
10
+(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
11
 
12
 typedef GLXFBConfigSGIX * (*PGLXFUNC_ChooseFBConfigSGIX)
13
 (Display *dpy, int screen, int *attrib_list, int *nelements);
14
 
15
-typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf);
16
+typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX pbuf);
17
 typedef void (*PGLXFUNC_SelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask);
18
 typedef void (*PGLXFUNC_GetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
19
 
20
 typedef GLXFBConfigSGIX (*PGLXFUNC_GetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis);
21
-typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config);
22
+typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfigSGIX config);
23
 typedef GLXContext (*PGLXFUNC_CreateContextWithConfigSGIX)
24
-(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
25
+(Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
26
 
27
-typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap);
28
-typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value);
29
+typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
30
+typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
31
 
32
 /*
33
  * GLX 1.3 functions
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_crOpenGL_stub.h (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Additions/common/crOpenGL/stub.h.orig	2016-07-18 11:50:44 UTC
2
+++ src/VBox/Additions/common/crOpenGL/stub.h
3
@@ -47,7 +47,7 @@
4
 #include <X11/extensions/Xfixes.h>
5
 #endif
6
 
7
-#if defined(WINDOWS) || defined(Linux) || defined(SunOS)
8
+#if defined(WINDOWS) || defined(Linux) || defined(FreeBSD) || defined(SunOS)
9
 # define CR_NEWWINTRACK
10
 #endif
11
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_common_pam_pam__vbox.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig	2020-05-13 19:37:05 UTC
1
--- src/VBox/Additions/common/pam/pam_vbox.cpp.orig	2016-07-18 11:50:44 UTC
2
+++ src/VBox/Additions/common/pam/pam_vbox.cpp
2
+++ src/VBox/Additions/common/pam/pam_vbox.cpp
3
@@ -105,7 +105,7 @@ static void pam_vbox_writesyslog(char *pszBuf)
3
@@ -105,7 +105,7 @@ static void pam_vbox_writesyslog(char *p
4
     openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV);
4
     openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV);
5
     syslog(LOG_ERR, "%s", pszBuf);
5
     syslog(LOG_ERR, "%s", pszBuf);
6
     closelog();
6
     closelog();
Lines 9-15 Link Here
9
     syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf);
9
     syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf);
10
 #endif
10
 #endif
11
 }
11
 }
12
@@ -184,7 +184,7 @@ static int vbox_set_msg(pam_handle_t *hPAM, int iStyle
12
@@ -180,7 +180,7 @@ static int vbox_set_msg(pam_handle_t *hP
13
 
13
 
14
     pam_message msg;
14
     pam_message msg;
15
     msg.msg_style = iStyle;
15
     msg.msg_style = iStyle;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile (-4 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/freebsd/Makefile.orig	2020-05-13 19:37:06 UTC
1
--- src/VBox/Additions/freebsd/Makefile.orig	2017-04-28 16:59:22.000000000 +0200
2
+++ src/VBox/Additions/freebsd/Makefile
2
+++ src/VBox/Additions/freebsd/Makefile	2017-07-13 00:04:11.766870597 +0200
3
@@ -30,6 +30,14 @@ all:
3
@@ -31,6 +31,14 @@
4
 	        cp vboxvfs/vboxvfs.ko .; \
4
 	        cp vboxvfs/vboxvfs.ko .; \
5
 	    fi; \
5
 	    fi; \
6
 	fi
6
 	fi
Lines 15-21 Link Here
15
 
15
 
16
 
16
 
17
 install:
17
 install:
18
@@ -37,13 +45,19 @@ install:
18
@@ -38,13 +46,19 @@
19
 	@if [ -d vboxvfs ]; then \
19
 	@if [ -d vboxvfs ]; then \
20
 	    $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \
20
 	    $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C vboxvfs install; \
21
 	fi
21
 	fi
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_Makefile.kmk (-5 / +6 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/freebsd/Makefile.kmk.orig	2019-07-12 08:42:35 UTC
1
--- src/VBox/Additions/freebsd/Makefile.kmk.orig	2019-11-21 13:54:10.000000000 -0300
2
+++ src/VBox/Additions/freebsd/Makefile.kmk
2
+++ src/VBox/Additions/freebsd/Makefile.kmk
3
@@ -23,8 +23,9 @@ $(error "The FreeBSD guest additions installer can onl
3
@@ -23,8 +23,9 @@
4
 endif
4
 endif
5
 
5
 
6
 # Include sub-makefiles.
6
 # Include sub-makefiles.
Lines 12-22 Link Here
12
 
12
 
13
 #
13
 #
14
 # Globals
14
 # Globals
15
@@ -67,11 +68,13 @@ VBOX_FBSD_ADD_STRIP_BIN = \
15
@@ -66,11 +67,14 @@
16
 	vboxvideo_drv_14.so \
16
 	vboxvideo_drv_15.so \
17
 	vboxvideo_drv_15.so \
17
 	vboxvideo_drv_16.so \
18
 	vboxvideo_drv_16.so \
18
 	vboxvideo_drv_17.so \
19
-	vboxvideo_drv_17.so
19
-	VBoxOGL.so
20
+	vboxvideo_drv_17.so \
20
+	$(if $(VBOX_WITH_PAM),pam_vbox.so,) \
21
+	$(if $(VBOX_WITH_PAM),pam_vbox.so,) \
21
+	VBoxOGL.so \
22
+	VBoxOGL.so \
22
+	mount_vboxvfs
23
+	mount_vboxvfs
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig	2020-05-13 19:37:06 UTC
1
--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig	2017-04-28 16:59:22.000000000 +0200
2
+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk
2
+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk	2017-07-13 00:52:49.020669620 +0200
3
@@ -33,32 +33,36 @@ vboxvfs_INCS          = \
3
@@ -33,32 +33,36 @@
4
        $(vboxvfs_0_OUTDIR)
4
        $(vboxvfs_0_OUTDIR)
5
 vboxvfs_SOURCES       = \
5
 vboxvfs_SOURCES       = \
6
 	vboxvfs_vfsops.c \
6
 	vboxvfs_vfsops.c \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs.h (-46 / +4 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig	2018-06-29 13:08:17 UTC
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h.orig	2019-04-16 10:09:14 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs.h
3
@@ -1,8 +1,3 @@
3
@@ -1,8 +1,3 @@
4
-/* $Id: vboxvfs.h $ */
4
-/* $Id: vboxvfs.h $ */
Lines 7-15 Link Here
7
- */
7
- */
8
-
8
-
9
 /*
9
 /*
10
  * Copyright (C) 2010-2017 Oracle Corporation
10
  * Copyright (C) 2010-2019 Oracle Corporation
11
  *
11
  *
12
@@ -21,72 +16,413 @@
12
@@ -24,72 +19,371 @@
13
 #define VBOXVFS_VFSNAME "vboxvfs"
13
 #define VBOXVFS_VFSNAME "vboxvfs"
14
 #define VBOXVFS_VERSION 1
14
 #define VBOXVFS_VERSION 1
15
 
15
 
Lines 78-84 Link Here
78
+#include "../../../../../include/iprt/err.h"
78
+#include "../../../../../include/iprt/err.h"
79
+#include "../../../../../include/iprt/fs.h"
79
+#include "../../../../../include/iprt/fs.h"
80
+#include "../../../../../include/iprt/log.h"
80
+#include "../../../../../include/iprt/log.h"
81
+#include "../../../../../include/iprt/mangling.h"
82
+#include "../../../../../include/iprt/mem.h"
81
+#include "../../../../../include/iprt/mem.h"
83
+#include "../../../../../include/iprt/param.h"
82
+#include "../../../../../include/iprt/param.h"
84
+#include "../../../../../include/iprt/path.h"
83
+#include "../../../../../include/iprt/path.h"
Lines 89-115 Link Here
89
+#include "../../../../../include/iprt/time.h"
88
+#include "../../../../../include/iprt/time.h"
90
+#include "../../../../../include/iprt/types.h"
89
+#include "../../../../../include/iprt/types.h"
91
+#include "../../../../../include/iprt/uni.h"
90
+#include "../../../../../include/iprt/uni.h"
92
+#include "../../../../../include/iprt/nocrt/limits.h"
93
+#include "../../../../../include/iprt/alloc.h"
94
+#include "../../../../../include/iprt/asm.h"
95
+#include "../../../../../include/iprt/asm-amd64-x86.h"
96
+#include "../../../../../include/iprt/asm-math.h"
97
+#include "../../../../../include/iprt/assert.h"
98
+#include "../../../../../include/iprt/cdefs.h"
99
+#include "../../../../../include/iprt/err.h"
100
+#include "../../../../../include/iprt/fs.h"
101
+#include "../../../../../include/iprt/log.h"
102
+#include "../../../../../include/iprt/mangling.h"
103
+#include "../../../../../include/iprt/mem.h"
104
+#include "../../../../../include/iprt/param.h"
105
+#include "../../../../../include/iprt/path.h"
106
+#include "../../../../../include/iprt/semaphore.h"
107
+#include "../../../../../include/iprt/stdarg.h"
108
+#include "../../../../../include/iprt/stdint.h"
109
+#include "../../../../../include/iprt/string.h"
110
+#include "../../../../../include/iprt/time.h"
111
+#include "../../../../../include/iprt/types.h"
112
+#include "../../../../../include/iprt/uni.h"
113
 
91
 
114
-#include <VBox/VBoxGuestLibSharedFolders.h>
92
-#include <VBox/VBoxGuestLibSharedFolders.h>
115
+#else
93
+#else
Lines 134-159 Link Here
134
+#include "iprt/time.h"
112
+#include "iprt/time.h"
135
+#include "iprt/types.h"
113
+#include "iprt/types.h"
136
+#include "iprt/uni.h"
114
+#include "iprt/uni.h"
137
+#include "iprt/nocrt/limits.h"
138
+#include "iprt/alloc.h"
139
+#include "iprt/asm.h"
140
+#include "iprt/asm-amd64-x86.h"
141
+#include "iprt/asm-math.h"
142
+#include "iprt/assert.h"
143
+#include "iprt/cdefs.h"
144
+#include "iprt/err.h"
145
+#include "iprt/fs.h"
146
+#include "iprt/log.h"
147
+#include "iprt/mem.h"
148
+#include "iprt/param.h"
149
+#include "iprt/path.h"
150
+#include "iprt/semaphore.h"
151
+#include "iprt/stdarg.h"
152
+#include "iprt/stdint.h"
153
+#include "iprt/string.h"
154
+#include "iprt/time.h"
155
+#include "iprt/types.h"
156
+#include "iprt/uni.h"
157
+
115
+
158
+#include "common/VBoxGuestLib/SysHlp.h"
116
+#include "common/VBoxGuestLib/SysHlp.h"
159
+
117
+
Lines 459-463 Link Here
459
+
417
+
460
 #endif  /* KERNEL */
418
 #endif  /* KERNEL */
461
 
419
 
462
 #endif /* !___VBOXVFS_H___ */
420
 #endif /* !GA_INCLUDED_SRC_freebsd_vboxvfs_vboxvfs_h */
463
-
421
-
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__prov.c (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig	2020-06-26 09:59:35 UTC
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c.orig	1970-01-01 01:00:00.000000000 +0100
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_prov.c	2017-07-12 19:24:26.109029000 +0200
3
@@ -0,0 +1,1020 @@
3
@@ -0,0 +1,1020 @@
4
+/*
4
+/*
5
+ * Copyright (C) 2008-2016 Oracle Corporation
5
+ * Copyright (C) 2008-2016 Oracle Corporation
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c (-4 / +4 lines)
Lines 1-4 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig	2020-07-09 16:50:11 UTC
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig	2019-01-25 18:12:34 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c
3
@@ -1,8 +1,3 @@
3
@@ -1,8 +1,3 @@
4
-/* $Id: vboxvfs_vfsops.c $ */
4
-/* $Id: vboxvfs_vfsops.c $ */
Lines 7-13 Link Here
7
- */
7
- */
8
-
8
-
9
 /*
9
 /*
10
  * Copyright (C) 2008-2017 Oracle Corporation
10
  * Copyright (C) 2008-2019 Oracle Corporation
11
  *
11
  *
12
@@ -14,245 +9,478 @@
12
@@ -14,245 +9,478 @@
13
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
Lines 451-458 Link Here
451
+
451
+
452
+	MNT_ILOCK(mp);
452
+	MNT_ILOCK(mp);
453
+	mp->mnt_data = vboxfsmp;
453
+	mp->mnt_data = vboxfsmp;
454
+	mp->mnt_stat.f_fsid.val[0] = fsinfo.serial;
454
+	/* f_fsid is int32_t but serial is uint32_t, convert */
455
+	mp->mnt_stat.f_fsid.val[1] = 0;
455
+	memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, sizeof(mp->mnt_stat.f_fsid));
456
+	mp->mnt_flag |= MNT_LOCAL;
456
+	mp->mnt_flag |= MNT_LOCAL;
457
+	if (readonly != 0)
457
+	if (readonly != 0)
458
+		mp->mnt_flag |= MNT_RDONLY;
458
+		mp->mnt_flag |= MNT_RDONLY;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c (-29 / +4 lines)
Lines 1-18 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2020-07-09 16:50:11 UTC
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2019-01-25 18:12:34 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
3
@@ -1,10 +1,6 @@
3
@@ -14,228 +10,1334 @@
4
-/* $Id: vboxvfs_vnops.c $ */
5
-/** @file
6
- * Description.
7
- */
8
-
9
 /*
10
  * Copyright (C) 2008-2017 Oracle Corporation
11
+ * Copyright (C) 2017 Mahdi Mokhtari
12
  *
13
  * This file is part of VirtualBox Open Source Edition (OSE), as
14
  * available from http://www.virtualbox.org. This file is free software;
15
@@ -14,228 +10,1347 @@
16
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
4
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18
  */
6
  */
Lines 48-57 Link Here
48
 
36
 
49
+#include "vboxvfs.h"
37
+#include "vboxvfs.h"
50
+
38
+
51
+#if __FreeBSD_version < 1300063
52
+#define	VN_IS_DOOMED(vp)	 (((vp)->v_iflag & VI_DOOMED) != 0)
53
+#endif
54
+
55
 /*
39
 /*
56
  * Prototypes for VBOXVFS vnode operations
40
  * Prototypes for VBOXVFS vnode operations
57
  */
41
  */
Lines 254-260 Link Here
254
+		MPASS((node->sf_vpstate & VBOXFS_VNODE_DOOMED) == 0);
238
+		MPASS((node->sf_vpstate & VBOXFS_VNODE_DOOMED) == 0);
255
+		VI_LOCK(vp);
239
+		VI_LOCK(vp);
256
+		if ((node->sf_type == VDIR && node->sf_parent == NULL) ||
240
+		if ((node->sf_type == VDIR && node->sf_parent == NULL) ||
257
+		    (VN_IS_DOOMED(vp) &&
241
+		    ((vp->v_iflag & VI_DOOMED) != 0 &&
258
+		    (lkflag & LK_NOWAIT) != 0)) {
242
+		    (lkflag & LK_NOWAIT) != 0)) {
259
+			VI_UNLOCK(vp);
243
+			VI_UNLOCK(vp);
260
+			VBOXFS_NODE_UNLOCK(node);
244
+			VBOXFS_NODE_UNLOCK(node);
Lines 262-268 Link Here
262
+			vp = NULL;
246
+			vp = NULL;
263
+			goto out;
247
+			goto out;
264
+		}
248
+		}
265
+		if (VN_IS_DOOMED(vp)) {
249
+		if ((vp->v_iflag & VI_DOOMED) != 0) {
266
+			VI_UNLOCK(vp);
250
+			VI_UNLOCK(vp);
267
+			node->sf_vpstate |= VBOXFS_VNODE_WRECLAIM;
251
+			node->sf_vpstate |= VBOXFS_VNODE_WRECLAIM;
268
+			while ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) {
252
+			while ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0) {
Lines 272-282 Link Here
272
+			goto loop1;
256
+			goto loop1;
273
+		}
257
+		}
274
+		VBOXFS_NODE_UNLOCK(node);
258
+		VBOXFS_NODE_UNLOCK(node);
275
+#if __FreeBSD_version < 1300109
276
+		error = vget(vp, lkflag | LK_INTERLOCK, curthread);
259
+		error = vget(vp, lkflag | LK_INTERLOCK, curthread);
277
+#else
278
+		error = vget(vp, lkflag | LK_INTERLOCK);
279
+#endif
280
+		if (error == ENOENT)
260
+		if (error == ENOENT)
281
+			goto loop;
261
+			goto loop;
282
+		if (error != 0) {
262
+		if (error != 0) {
Lines 506-518 Link Here
506
+		error = vsfnode_update_stat_cache(node);
486
+		error = vsfnode_update_stat_cache(node);
507
+	m = (error == 0) ? node->sf_stat.sf_mode : 0;
487
+	m = (error == 0) ? node->sf_stat.sf_mode : 0;
508
+
488
+
509
+#if __FreeBSD_version < 1300105
510
+	return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid,
489
+	return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid,
511
+	    node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL));
490
+	    node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL));
512
+#else
513
+	return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid,
514
+	    node->vboxfsmp->sf_gid, accmode, ap->a_cred));
515
+#endif
516
 }
491
 }
517
 
492
 
518
-static int vboxvfs_link(struct vop_link_args *ap)
493
-static int vboxvfs_link(struct vop_link_args *ap)
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_x11_vboxmouse_Makefile.kmk (-1 / +1 lines)
Lines 13-19 Link Here
13
+  vboxmouse_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
13
+  vboxmouse_drv_system_TEMPLATE = VBOXGUESTR3XORGMOD
14
+  vboxmouse_drv_system_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
14
+  vboxmouse_drv_system_DEFS := $(vboxmouse_drv_70_DEFS) NO_ANSIC
15
+  vboxmouse_drv_system_INCS := \
15
+  vboxmouse_drv_system_INCS := \
16
+	/usr/local/include/pixman-1 \
16
+	$(vboxmouse_xorg_INCS) \
17
+	/usr/local/include/xorg \
17
+	/usr/local/include/xorg \
18
+	$(PATH_SUB_CURRENT)
18
+	$(PATH_SUB_CURRENT)
19
+  vboxmouse_drv_system_SOURCES = \
19
+  vboxmouse_drv_system_SOURCES = \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Debugger_Makefile.kmk (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/Debugger/Makefile.kmk.orig	2020-05-13 19:39:41 UTC
1
--- src/VBox/Debugger/Makefile.kmk.orig	2017-10-18 07:09:03 UTC
2
+++ src/VBox/Debugger/Makefile.kmk
2
+++ src/VBox/Debugger/Makefile.kmk
3
@@ -113,6 +113,7 @@ VBoxDbg_SOURCES = \
3
@@ -109,6 +109,7 @@ VBoxDbg_SOURCES = \
4
 	VBoxDbgBase.cpp \
4
 	VBoxDbgBase.cpp \
5
 	VBoxDbgConsole.cpp \
5
 	VBoxDbgConsole.cpp \
6
 	VBoxDbgStatsQt.cpp
6
 	VBoxDbgStatsQt.cpp
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostALSAAudio.cpp (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig	2020-05-13 19:39:41 UTC
1
--- src/VBox/Devices/Audio/DrvHostALSAAudio.cpp.orig	2017-10-18 07:09:04 UTC
2
+++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
2
+++ src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
3
@@ -819,6 +819,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
3
@@ -1231,6 +1231,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
4
                         continue;
4
                         continue;
5
                     }
5
                     }
6
 
6
 
Lines 8-14 Link Here
8
                     case -ESTRPIPE:
8
                     case -ESTRPIPE:
9
                     {
9
                     {
10
                         /* Stream was suspended and waiting for a recovery. */
10
                         /* Stream was suspended and waiting for a recovery. */
11
@@ -832,6 +833,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
11
@@ -1244,6 +1245,7 @@ static DECLCALLBACK(int) drvHostALSAAudioStreamPlay(PP
12
                         LogFlowFunc(("Resumed suspended output stream\n"));
12
                         LogFlowFunc(("Resumed suspended output stream\n"));
13
                         continue;
13
                         continue;
14
                     }
14
                     }
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Audio_DrvHostOSSAudio.cpp (+31 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Audio/DrvHostOSSAudio.cpp.orig	2019-10-10 21:09:31.000000000 +0300
2
+++ src/VBox/Devices/Audio/DrvHostOSSAudio.cpp	2020-05-24 01:15:17.346032000 +0300
3
@@ -253,10 +253,11 @@
4
 
5
             default:
6
                 rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE;
7
+                iFormat = -1;				
8
                 break;
9
         }
10
 
11
-        if (RT_FAILURE(rc))
12
+        if (RT_UNLIKELY(iFormat == -1))
13
             break;
14
 
15
         if (ioctl(fdFile, SNDCTL_DSP_SAMPLESIZE, &iFormat))
16
@@ -664,6 +665,7 @@
17
 
18
                 pCfgAcq->Backend.cFramesPeriod     = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, ossAcq.cbFragmentSize);
19
                 pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering". */
20
+                pCfgAcq->Backend.cFramesPreBuffering     = pCfgAcq->Backend.cFramesBufferSize;                
21
                 /** @todo Pre-buffering required? */
22
             }
23
         }
24
@@ -782,6 +784,7 @@
25
 #endif
26
             pCfgAcq->Backend.cFramesPeriod     = PDMAUDIOSTREAMCFG_B2F(pCfgAcq, obtStream.cbFragmentSize);
27
             pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * 2; /* Use "double buffering" */
28
+            pCfgAcq->Backend.cFramesPreBuffering     = pCfgAcq->Backend.cFramesBufferSize;            
29
         }
30
 
31
     } while (0);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.cpp (+29 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp.orig	2019-05-13 13:30:56 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
3
@@ -186,7 +186,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
4
     pfn_wglDeleteContext = 0;
5
     pfn_wglMakeCurrent = 0;
6
     pfn_wglShareLists = 0;
7
-#elif defined(RT_OS_LINUX)
8
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
9
     pfn_XConfigureWindow = 0;
10
     pfn_XCloseDisplay = 0;
11
     pfn_XCreateColormap = 0;
12
@@ -276,7 +276,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
13
     GLGETPROC_(wglDeleteContext, "");
14
     GLGETPROC_(wglMakeCurrent, "");
15
     GLGETPROC_(wglShareLists, "");
16
-#elif defined(RT_OS_LINUX)
17
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
18
     X11GETPROC_(XConfigureWindow);
19
     X11GETPROC_(XCloseDisplay);
20
     X11GETPROC_(XCreateColormap);
21
@@ -357,7 +357,7 @@ int glLdrInit(PPDMDEVINS pDevIns)
22
     GLGETPROC_(glVertexPointer, "");
23
     GLGETPROC_(glViewport, "");
24
 
25
-#ifdef RT_OS_LINUX
26
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
27
     XInitThreads();
28
 #endif
29
     return VINF_SUCCESS;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-glLdr.h (+11 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h.orig	2019-05-13 13:30:56 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h
3
@@ -317,7 +317,7 @@ GLPFN BOOL (WINAPI *pfn_wglMakeCurrent)(HDC, HGLRC);
4
 GLPFN BOOL (WINAPI *pfn_wglShareLists)(HGLRC, HGLRC);
5
 #define wglShareLists pfn_wglShareLists
6
 
7
-#elif defined(RT_OS_LINUX)
8
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
9
 /*
10
  * GLX
11
  */
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp (+38 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp.orig	2019-01-25 18:17:47 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
3
@@ -1150,7 +1150,7 @@ int vmsvga3dTerminate(PVGASTATE pThis)
4
     RTSemEventDestroy(pState->WndRequestSem);
5
 #elif defined(RT_OS_DARWIN)
6
 
7
-#elif defined(RT_OS_LINUX)
8
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
9
     /* signal to the thread that it is supposed to exit */
10
     pState->bTerminate = true;
11
     /* wait for it to terminate */
12
@@ -2850,7 +2850,7 @@ int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t 
13
 }
14
 
15
 
16
-#ifdef RT_OS_LINUX
17
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
18
 /**
19
  * X11 event handling thread.
20
  *
21
@@ -2880,7 +2880,7 @@ DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD hThrea
22
     }
23
     return VINF_SUCCESS;
24
 }
25
-#endif // RT_OS_LINUX
26
+#endif // RT_OS_FREEBSD || RT_OS_LINUX
27
 
28
 
29
 /**
30
@@ -3206,7 +3206,7 @@ static int vmsvga3dContextDestroyOgl(PVGASTATE pThis, 
31
     AssertRC(rc);
32
 #elif defined(RT_OS_DARWIN)
33
     vmsvga3dCocoaDestroyViewAndContext(pContext->cocoaView, pContext->cocoaContext);
34
-#elif defined(RT_OS_LINUX)
35
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
36
     glXMakeCurrent(pState->display, None, NULL);
37
     glXDestroyContext(pState->display, pContext->glxContext);
38
     XDestroyWindow(pState->display, pContext->window);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk (+44 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Makefile.kmk.orig	2020-12-12 16:34:56.552096000 +0100
2
+++ src/VBox/Devices/Makefile.kmk	2020-12-12 16:39:22.755713000 +0100
3
@@ -112,6 +112,7 @@
4
   VBoxDDU_LDFLAGS.darwin += -framework IOKit
5
  endif
6
 
7
+ VBoxDDU_LDFLAGS.freebsd  = $(VBOX_GCC_NO_UNDEFINED)
8
  VBoxDDU_LDFLAGS.linux    = $(VBOX_GCC_NO_UNDEFINED)
9
  $(call VBOX_SET_VER_INFO_DLL,VBoxDDU,VirtualBox VMM Devices and Drivers Utilities)
10
 
11
@@ -245,6 +246,7 @@
12
  	-framework SystemConfiguration \
13
  	-framework AVFoundation \
14
  	-framework Foundation
15
+ VBoxDD_LDFLAGS.freebsd  = $(VBOX_GCC_NO_UNDEFINED)
16
  VBoxDD_LDFLAGS.linux    = $(VBOX_GCC_NO_UNDEFINED)
17
 
18
  # --- Tracing bits. ---
19
@@ -287,7 +289,7 @@
20
   VBoxDD_SOURCES        += Graphics/DevVGA-SVGA.cpp
21
  endif
22
  ifdef VBOX_WITH_VMSVGA3D
23
-  if1of ($(KBUILD_TARGET), linux win)
24
+  if1of ($(KBUILD_TARGET), freebsd linux win)
25
 # Dynamically load 3D library (opengl32, libGL).
26
 # This is a temporary solution. In future the 3D backend will be in a separate library.
27
 VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1
28
@@ -329,6 +331,7 @@
29
    VBoxDD_SOURCES       += \
30
    	Graphics/DevVGA-SVGA3d-glLdr.cpp
31
    else
32
+   VBoxDD_LIBS.freebsd  += X11 GL
33
    VBoxDD_LIBS.linux    += X11 GL
34
    VBoxDD_LIBS.win      += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib
35
    endif
36
@@ -1526,6 +1529,8 @@
37
  VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS)
38
  VBoxSVGA3D_INCS.win    := \
39
  	Graphics/shaderlib/libWineStub/include
40
+ VBoxSVGA3D_INCS.freebsd := \
41
+	 Graphics/shaderlib/wine/include
42
  VBoxSVGA3D_INCS.linux  := \
43
  	Graphics/shaderlib/wine/include
44
  VBoxSVGA3D_INCS.darwin := \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_ipxe_Makefile.kmk (+20 lines)
Line 0 Link Here
1
--- src/VBox/Devices/PC/ipxe/Makefile.kmk.orig	2019-11-21 14:00:10.000000000 -0300
2
+++ src/VBox/Devices/PC/ipxe/Makefile.kmk
3
@@ -120,7 +120,7 @@
4
 	-falign-loops=1 \
5
 	-Os \
6
 	-falign-functions=1 \
7
-	-mpreferred-stack-boundary=2 \
8
+	-mstack-alignment=2 \
9
 	-mregparm=3 \
10
 	-mrtd \
11
 	-freg-struct-return \
12
@@ -143,7 +143,7 @@
13
 	-falign-jumps=1 \
14
 	-falign-loops=1 \
15
 	-falign-functions=1 \
16
-	-mpreferred-stack-boundary=2 \
17
+	-mstack-alignment=2 \
18
 	-mregparm=3 \
19
 	-mrtd \
20
 	-freg-struct-return \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_PC_vbox-cpuhotplug.dsl (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Devices/PC/vbox-cpuhotplug.dsl.orig	2020-07-09 16:55:56 UTC
2
+++ src/VBox/Devices/PC/vbox-cpuhotplug.dsl
3
@@ -48,7 +48,7 @@ DefinitionBlock ("SSDT-cpuhotplug.aml", "SSDT", 1, "VB
4
     Device (sck)                                                           \
5
     {                                                                      \
6
         Name (_HID, "ACPI0004")                                            \
7
-        Name (_UID, sckuid)                                                \
8
+        Name (_UID, id)                                                    \
9
                                                                            \
10
         <NL>                                                               \
11
         Processor (cpu, /* Name */                                         \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp.orig	2017-10-18 07:11:48 UTC
2
+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp
3
@@ -24,6 +24,7 @@
4
 #include <cam/scsi/scsi_message.h>
5
 #include <cam/scsi/scsi_pass.h>
6
 #include <VBox/scsi.h>
7
+#include <iprt/file.h>
8
 #include <iprt/log.h>
9
 
10
 /** Maximum buffer size supported by the CAM subsystem. */
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp (-6 / +15 lines)
Lines 1-6 Link Here
1
--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig	2020-05-13 19:43:27 UTC
1
--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig	2019-01-25 18:19:18 UTC
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
3
@@ -622,7 +622,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub
3
@@ -641,7 +641,7 @@
4
                      "                                             file <file>|\n"
5
                      "                                             <devicename>]\n"
6
                      "                            [--uarttype<1-N> 16450|16550A|16750]\n"
7
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
8
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
9
                      "                            [--lpt<1-N> off|<I/O base> <IRQ>]\n"
10
                      "                            [--lptmode<1-N> <devicename>]\n"
11
 #endif
12
@@ -656,7 +656,7 @@
4
             RTStrmPrintf(pStrm, "|dsound");
13
             RTStrmPrintf(pStrm, "|dsound");
5
 #endif
14
 #endif
6
         }
15
         }
Lines 9-19 Link Here
9
         {
18
         {
10
             RTStrmPrintf(pStrm, ""
19
             RTStrmPrintf(pStrm, ""
11
 #ifdef VBOX_WITH_AUDIO_OSS
20
 #ifdef VBOX_WITH_AUDIO_OSS
12
@@ -635,22 +635,6 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub
21
@@ -670,22 +670,6 @@
13
                                 "|pulse"
14
 #endif
22
 #endif
15
                         );
23
                         );
16
-        }
24
         }
17
-        if (fFreeBSD)
25
-        if (fFreeBSD)
18
-        {
26
-        {
19
-#ifdef VBOX_WITH_AUDIO_OSS
27
-#ifdef VBOX_WITH_AUDIO_OSS
Lines 29-34 Link Here
29
-#ifdef VBOX_WITH_AUDIO_PULSE
37
-#ifdef VBOX_WITH_AUDIO_PULSE
30
-            RTStrmPrintf(pStrm, "|pulse");
38
-            RTStrmPrintf(pStrm, "|pulse");
31
-#endif
39
-#endif
32
         }
40
-        }
33
         if (fDarwin)
41
         if (fDarwin)
34
         {
42
         {
43
             RTStrmPrintf(pStrm, "|coreaudio");
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp (+29 lines)
Line 0 Link Here
1
--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig	2019-01-25 18:19:18.000000000 +0000
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	2019-02-01 06:06:37.701231000 +0000
3
@@ -150,7 +150,7 @@ enum
4
     MODIFYVM_UARTMODE,
5
     MODIFYVM_UARTTYPE,
6
     MODIFYVM_UART,
7
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
8
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
9
     MODIFYVM_LPTMODE,
10
     MODIFYVM_LPT,
11
 #endif
12
@@ -341,7 +341,7 @@ static const RTGETOPTDEF g_aModifyVMOptions[] =
13
     { "--uartmode",                 MODIFYVM_UARTMODE,                  RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
14
     { "--uarttype",                 MODIFYVM_UARTTYPE,                  RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
15
     { "--uart",                     MODIFYVM_UART,                      RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
16
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
17
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
18
     { "--lptmode",                  MODIFYVM_LPTMODE,                   RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
19
     { "--lpt",                      MODIFYVM_LPT,                       RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
20
 #endif
21
@@ -2224,7 +2224,7 @@ RTEXITCODE handleModifyVM(HandlerArg *a)
22
                 break;
23
             }
24
 
25
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
26
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
27
             case MODIFYVM_LPTMODE:
28
             {
29
                 ComPtr<IParallelPort> lpt;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_Makefile.kmk (-3 / +3 lines)
Lines 1-6 Link Here
1
--- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig	2020-05-13 19:43:28 UTC
1
--- src/VBox/Frontends/VirtualBox/Makefile.kmk.orig	2017-10-18 07:12:20 UTC
2
+++ src/VBox/Frontends/VirtualBox/Makefile.kmk
2
+++ src/VBox/Frontends/VirtualBox/Makefile.kmk
3
@@ -897,6 +897,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI
3
@@ -895,6 +895,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI
4
  VirtualBox_SOURCES += \
4
  VirtualBox_SOURCES += \
5
 	src/VBoxFBOverlay.cpp \
5
 	src/VBoxFBOverlay.cpp \
6
 	src/VBoxGLSupportInfo.cpp
6
 	src/VBoxGLSupportInfo.cpp
Lines 8-14 Link Here
8
 endif
8
 endif
9
 
9
 
10
 #
10
 #
11
@@ -1220,6 +1221,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL)
11
@@ -1217,6 +1218,7 @@ if defined(VBOX_WITH_VIDEOHWACCEL)
12
   VBoxOGL2D_SOURCES = \
12
   VBoxOGL2D_SOURCES = \
13
 	src/VBoxGLSupportInfo.cpp
13
 	src/VBoxGLSupportInfo.cpp
14
   VBoxOGL2D_INCS = include
14
   VBoxOGL2D_INCS = include
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_globals_UIImageTools.cpp (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp.orig	2020-05-18 14:44:12 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/globals/UIImageTools.cpp
3
@@ -24,6 +24,7 @@
4
 
5
 /* Qt includes */
6
 # include <QPainter>
7
+# include <QPainterPath>
8
 
9
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
10
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMenuToolBar.cpp (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp.orig	2020-05-18 15:10:10 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/widgets/UIMenuToolBar.cpp
3
@@ -23,6 +23,7 @@
4
 # include <QApplication>
5
 # include <QHBoxLayout>
6
 # include <QPainter>
7
+# include <QPainterPath>
8
 # include <QStyle>
9
 # include <QToolButton>
10
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIMiniToolBar.cpp (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp.orig	2020-05-18 15:15:26 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
3
@@ -28,6 +28,7 @@
4
 # include <QToolButton>
5
 # include <QStateMachine>
6
 # include <QPainter>
7
+# include <QPainterPath>
8
 # include <QWindow>
9
 # ifdef VBOX_WS_X11
10
 #  include <QWindowStateChangeEvent>
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VirtualBox_src_widgets_UIPopupBox.h (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h.orig	2020-05-18 14:53:03 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h
3
@@ -20,6 +20,7 @@
4
 
5
 /* Global includes: */
6
 #include <QIcon>
7
+#include <QPainterPath>
8
 #include <QWidget>
9
 
10
 /* Forward declarations: */
(-)emulators/virtualbox-ose/files/patch-src_VBox_GuestHost_OpenGL_include_chromium.h (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/GuestHost/OpenGL/include/chromium.h.orig	2018-05-09 16:38:12 UTC
2
+++ src/VBox/GuestHost/OpenGL/include/chromium.h
3
@@ -63,7 +63,7 @@
4
 #include <GL/gl.h>
5
 /* Quick fix so as not to update the version of glext.h we provide. */
6
 #ifdef GL_GLEXT_PROTOTYPES
7
-# if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
8
+# if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
9
 GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint);
10
 GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
11
 GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum);
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrv.cpp (-2 / +2 lines)
Lines 4-11 Link Here
4
 /** @def SUPDRV_CHECK_SMAP_CHECK
4
 /** @def SUPDRV_CHECK_SMAP_CHECK
5
  * Checks that the AC flag is set if SMAP is enabled.  If AC is not set, it
5
  * Checks that the AC flag is set if SMAP is enabled.  If AC is not set, it
6
  * will be logged and @a a_BadExpr is executed. */
6
  * will be logged and @a a_BadExpr is executed. */
7
-#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)
7
-#if (defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)) && !defined(VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV)
8
+#if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
8
+#if (defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)) && !defined(VBOX_WITHOUT_EFLAGS_AC_SET_IN_VBOXDRV)
9
 # define SUPDRV_CHECK_SMAP_SETUP() uint32_t const fKernelFeatures = SUPR0GetKernelFeatures()
9
 # define SUPDRV_CHECK_SMAP_SETUP() uint32_t const fKernelFeatures = SUPR0GetKernelFeatures()
10
 # define SUPDRV_CHECK_SMAP_CHECK(a_pDevExt, a_BadExpr) \
10
 # define SUPDRV_CHECK_SMAP_CHECK(a_pDevExt, a_BadExpr) \
11
     do { \
11
     do { \
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_SUPDrvInternal.h (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig	2020-05-13 19:43:52 UTC
1
--- src/VBox/HostDrivers/Support/SUPDrvInternal.h.orig	2016-07-18 11:56:19 UTC
2
+++ src/VBox/HostDrivers/Support/SUPDrvInternal.h
2
+++ src/VBox/HostDrivers/Support/SUPDrvInternal.h
3
@@ -208,7 +208,7 @@
3
@@ -235,7 +235,7 @@
4
 # define SUPDRV_WITHOUT_MSR_PROBER
4
 # define SUPDRV_WITHOUT_MSR_PROBER
5
 #endif
5
 #endif
6
 
6
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (-35 / +16 lines)
Lines 1-7 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2020-05-13 19:43:53 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2020-10-16 13:37:29.000000000 -0300
2
+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
2
+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c	2021-02-10 14:26:13.552617000 -0300
3
@@ -46,6 +46,7 @@
3
@@ -44,8 +44,10 @@
4
 #include <sys/fcntl.h>
5
 #include <sys/conf.h>
4
 #include <sys/uio.h>
6
 #include <sys/uio.h>
7
+#include <sys/mutex.h>
5
 
8
 
6
 #include "../SUPDrvInternal.h"
9
 #include "../SUPDrvInternal.h"
7
+#include "freebsd/the-freebsd-kernel.h"
10
+#include "freebsd/the-freebsd-kernel.h"
Lines 8-14 Link Here
8
 #include <VBox/version.h>
11
 #include <VBox/version.h>
9
 #include <iprt/initterm.h>
12
 #include <iprt/initterm.h>
10
 #include <iprt/string.h>
13
 #include <iprt/string.h>
11
@@ -57,7 +58,14 @@
14
@@ -57,7 +59,14 @@
12
 #include <iprt/alloc.h>
15
 #include <iprt/alloc.h>
13
 #include <iprt/err.h>
16
 #include <iprt/err.h>
14
 #include <iprt/asm.h>
17
 #include <iprt/asm.h>
Lines 23-29 Link Here
23
 #ifdef VBOX_WITH_HARDENING
26
 #ifdef VBOX_WITH_HARDENING
24
 # define VBOXDRV_PERM 0600
27
 # define VBOXDRV_PERM 0600
25
 #else
28
 #else
26
@@ -76,7 +84,9 @@ static d_open_t     VBoxDrvFreeBSDOpenUsr;
29
@@ -76,7 +85,9 @@
27
 static d_open_t     VBoxDrvFreeBSDOpenSys;
30
 static d_open_t     VBoxDrvFreeBSDOpenSys;
28
 static void         vboxdrvFreeBSDDtr(void *pvData);
31
 static void         vboxdrvFreeBSDDtr(void *pvData);
29
 static d_ioctl_t    VBoxDrvFreeBSDIOCtl;
32
 static d_ioctl_t    VBoxDrvFreeBSDIOCtl;
Lines 33-39 Link Here
33
 
36
 
34
 
37
 
35
 /*********************************************************************************************************************************
38
 /*********************************************************************************************************************************
36
@@ -182,6 +192,13 @@ static int VBoxDrvFreeBSDLoad(void)
39
@@ -182,6 +193,13 @@
37
         rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION));
40
         rc = supdrvInitDevExt(&g_VBoxDrvFreeBSDDevExt, sizeof(SUPDRVSESSION));
38
         if (RT_SUCCESS(rc))
41
         if (RT_SUCCESS(rc))
39
         {
42
         {
Lines 47-77 Link Here
47
             /*
50
             /*
48
              * Configure character devices. Add symbolic links for compatibility.
51
              * Configure character devices. Add symbolic links for compatibility.
49
              */
52
              */
50
@@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo
53
@@ -324,6 +342,45 @@
51
     PSUPDRVSESSION pSession;
52
     devfs_get_cdevpriv((void **)&pSession);
53
 
54
 
54
+#ifdef VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV
55
     /*
56
+     * Refuse all I/O control calls if we've ever detected EFLAGS.AC being cleared.
57
+     *
58
+     * This isn't a problem, as there is absolutely nothing in the kernel context that
59
+     * depend on user context triggering cleanups.  That would be pretty wild, right?
60
+     */
61
+    if (RT_UNLIKELY(g_VBoxDrvFreeBSDDevExt.cBadContextCalls > 0))
62
+    {
63
+        SUPR0Printf("VBoxDrvFreBSDIOCtl: EFLAGS.AC=0 detected %u times, refusing all I/O controls!\n", g_VBoxDrvFreeBSDDevExt.cBadContextCalls);
64
+        return ESPIPE;
65
+    }
66
+#endif
67
+
68
+    /*
69
      * Deal with the fast ioctl path first.
70
      */
71
     if (   (   ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN
72
@@ -325,6 +356,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo
73
 
55
 
74
 
75
 /**
56
 /**
76
+ * Alternative Device I/O Control entry point on hosts with SMAP support.
57
+ * Alternative Device I/O Control entry point on hosts with SMAP support.
77
+ *
58
+ *
Lines 115-121 Link Here
115
  * Deal with the 'slow' I/O control requests.
96
  * Deal with the 'slow' I/O control requests.
116
  *
97
  *
117
  * @returns 0 on success, appropriate errno on failure.
98
  * @returns 0 on success, appropriate errno on failure.
118
@@ -373,11 +443,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
99
@@ -372,11 +429,10 @@
119
          */
100
          */
120
         SUPREQHDR Hdr;
101
         SUPREQHDR Hdr;
121
         pvUser = *(void **)pvData;
102
         pvUser = *(void **)pvData;
Lines 130-136 Link Here
130
         }
111
         }
131
         if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
112
         if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
132
         {
113
         {
133
@@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
114
@@ -401,13 +457,12 @@
134
             OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd));
115
             OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd));
135
             return ENOMEM;
116
             return ENOMEM;
136
         }
117
         }
Lines 148-154 Link Here
148
         }
129
         }
149
         if (Hdr.cbIn < cbReq)
130
         if (Hdr.cbIn < cbReq)
150
             RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn);
131
             RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn);
151
@@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
132
@@ -435,9 +490,8 @@
152
                 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd));
133
                 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd));
153
                 cbOut = cbReq;
134
                 cbOut = cbReq;
154
             }
135
             }
Lines 160-166 Link Here
160
 
141
 
161
             Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));
142
             Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));
162
 
143
 
163
@@ -541,8 +608,7 @@ bool VBOXCALL  supdrvOSGetForcedAsyncTscMode(PSUPDRVDE
144
@@ -540,8 +594,7 @@
164
 
145
 
165
 bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
146
 bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
166
 {
147
 {
Lines 170-176 Link Here
170
 }
151
 }
171
 
152
 
172
 
153
 
173
@@ -625,11 +691,25 @@ int VBOXCALL    supdrvOSMsrProberModify(RTCPUID idCpu,
154
@@ -624,11 +677,25 @@
174
 #endif /* SUPDRV_WITH_MSR_PROBER */
155
 #endif /* SUPDRV_WITH_MSR_PROBER */
175
 
156
 
176
 
157
 
Lines 196-202 Link Here
196
 
177
 
197
     va_start(va, pszFormat);
178
     va_start(va, pszFormat);
198
     cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
179
     cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
199
@@ -637,12 +717,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
180
@@ -636,12 +703,19 @@
200
 
181
 
201
     printf("%s", szMsg);
182
     printf("%s", szMsg);
202
 
183
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetAdp_freebsd_Makefile (+11 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile.orig	2019-05-13 13:33:07 UTC
2
+++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile
3
@@ -26,7 +26,7 @@
4
 
5
 KMOD = vboxnetadp
6
 
7
-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE
8
+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
9
 
10
 .if (${MACHINE_ARCH} == "i386")
11
  CFLAGS += -DRT_ARCH_X86
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_Makefile.kmk (+11 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk.orig	2019-05-13 13:33:07 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
3
@@ -565,7 +565,7 @@ $(PATH_OUT)/opt_netgraph.h:
4
 	$(QUIET)$(RM) -f -- $@
5
 	$(QUIET)$(CP) -f $< $@
6
  ifndef VBOX_WITH_HARDENING
7
-	$(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@.tmp $@
8
+	$(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@
9
 	${QUIET}$(MV) -f $@.tmp $@
10
  endif
11
  ifndef VBOX_WITH_NETFLT_VIMAGE
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_Makefile (+11 lines)
Line 0 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile.orig	2019-05-13 13:33:07 UTC
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/Makefile
3
@@ -26,7 +26,7 @@
4
 
5
 KMOD = vboxnetflt
6
 
7
-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE
8
+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
9
 
10
 .if (${MACHINE_ARCH} == "i386")
11
  CFLAGS += -DRT_ARCH_X86
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c (-34 lines)
Lines 1-34 Link Here
1
--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c.orig	2020-07-28 21:59:30.107638000 -0700
2
+++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c	2020-07-28 22:00:37.858885000 -0700
3
@@ -361,7 +361,14 @@
4
     {
5
         if (mtag != NULL || !fActive)
6
         {
7
+#if __FreeBSD_version >= 1300049
8
+            struct epoch_tracker et;
9
+            NET_EPOCH_ENTER(et);
10
+#endif
11
             ether_demux(ifp, m);
12
+#if __FreeBSD_version >= 1300049
13
+            NET_EPOCH_EXIT(et);
14
+#endif
15
             if (fActive)
16
                 vboxNetFltRelease(pThis, true /*fBusy*/);
17
             VBOXCURVNET_RESTORE();
18
@@ -457,7 +464,16 @@
19
         if (fDropIt)
20
             m_freem(m);
21
         else
22
+        {
23
+#if __FreeBSD_version >= 1300049
24
+            struct epoch_tracker et;
25
+            NET_EPOCH_ENTER(et);
26
+#endif
27
             ether_demux(ifp, m);
28
+#if __FreeBSD_version >= 1300049
29
+            NET_EPOCH_EXIT(et);
30
+#endif
31
+        }
32
     }
33
     vboxNetFltRelease(pThis, true /* fBusy */);
34
     VBOXCURVNET_RESTORE();
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostServices_SharedOpenGL_Makefile.kmk (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/HostServices/SharedOpenGL/Makefile.kmk.orig	2020-05-13 19:43:59 UTC
2
+++ src/VBox/HostServices/SharedOpenGL/Makefile.kmk
3
@@ -335,6 +335,7 @@ if (   defined(VBOX_WITH_QTGUI) \
4
     $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
5
     $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,)
6
   ifdef VBOX_WITH_VIDEOHWACCEL
7
+   VBoxTestOGL_CXXFLAGS.freebsd += -std=c++11
8
    VBoxTestOGL_QT_MODULES   += Core Gui OpenGL Widgets
9
    VBoxTestOGL_LIBS.linux   += xcb
10
    VBoxTestOGL_LIBS.solaris += xcb
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_Makefile.kmk (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/Makefile.kmk.orig	2020-05-13 19:44:04 UTC
1
--- src/VBox/Main/Makefile.kmk.orig	2017-03-08 17:20:11 UTC
2
+++ src/VBox/Main/Makefile.kmk
2
+++ src/VBox/Main/Makefile.kmk
3
@@ -526,6 +526,7 @@ VBoxSVC_SOURCES.os2 = \
3
@@ -445,6 +445,7 @@ VBoxSVC_SOURCES.os2 = \
4
 
4
 
5
 VBoxSVC_SOURCES.freebsd = \
5
 VBoxSVC_SOURCES.freebsd = \
6
 	src-server/freebsd/HostHardwareFreeBSD.cpp \
6
 	src-server/freebsd/HostHardwareFreeBSD.cpp \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_include_USBProxyBackend.h (-17 lines)
Lines 1-17 Link Here
1
--- src/VBox/Main/include/USBProxyBackend.h.orig	2020-05-13 19:44:06 UTC
2
+++ src/VBox/Main/include/USBProxyBackend.h
3
@@ -365,13 +365,10 @@ class USBProxyBackendFreeBSD : public USBProxyBackend 
4
     virtual int releaseDevice(HostUSBDevice *aDevice);
5
 
6
 protected:
7
-    int initUsbfs(void);
8
-    int initSysfs(void);
9
     virtual int wait(RTMSINTERVAL aMillies);
10
     virtual int interruptWait(void);
11
     virtual PUSBDEVICE getDevices(void);
12
-    int addDeviceToChain(PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, int rc);
13
-    virtual void deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice);
14
+    virtual bool isFakeUpdateRequired();
15
 
16
 private:
17
     RTSEMEVENT mNotifyEventSem;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_src-client_ConsoleImpl2.cpp (-20 lines)
Lines 1-20 Link Here
1
--- src/VBox/Main/src-client/ConsoleImpl2.cpp.orig	2020-05-13 19:44:07 UTC
2
+++ src/VBox/Main/src-client/ConsoleImpl2.cpp
3
@@ -5265,7 +5265,7 @@ int Console::i_configNetwork(const char *pszDevice,
4
                 {
5
                     switch (hrc)
6
                     {
7
-                        case VERR_ACCESS_DENIED:
8
+                        case (HRESULT)VERR_ACCESS_DENIED:
9
                             return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,  N_(
10
                                             "Failed to open '/dev/net/tun' for read/write access. Please check the "
11
                                             "permissions of that node. Either run 'chmod 0666 /dev/net/tun' or "
12
@@ -5467,7 +5467,7 @@ int Console::i_configNetwork(const char *pszDevice,
13
                     {
14
                         switch (hrc)
15
                         {
16
-                            case VERR_ACCESS_DENIED:
17
+                            case (HRESULT)VERR_ACCESS_DENIED:
18
                                 return VMSetError(VMR3GetVM(mpUVM), VERR_HOSTIF_INIT_FAILED, RT_SRC_POS,  N_(
19
                                                 "Failed to open '/dev/%s' for read/write access.  Please check the "
20
                                                 "permissions of that node, and that the net.link.tap.user_open "
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_HostImpl.cpp (-2 / +2 lines)
Lines 1-6 Link Here
1
--- src/VBox/Main/src-server/HostImpl.cpp.orig	2020-05-13 19:44:09 UTC
1
--- src/VBox/Main/src-server/HostImpl.cpp.orig	2017-03-08 17:20:14 UTC
2
+++ src/VBox/Main/src-server/HostImpl.cpp
2
+++ src/VBox/Main/src-server/HostImpl.cpp
3
@@ -284,7 +284,7 @@ HRESULT Host::init(VirtualBox *aParent)
3
@@ -293,7 +293,7 @@ HRESULT Host::init(VirtualBox *aParent)
4
 
4
 
5
 #if defined(RT_OS_WINDOWS)
5
 #if defined(RT_OS_WINDOWS)
6
     m->pHostPowerService = new HostPowerServiceWin(m->pParent);
6
     m->pHostPowerService = new HostPowerServiceWin(m->pParent);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Main_src-server_freebsd_NetIf-freebsd.cpp (-19 lines)
Lines 1-19 Link Here
1
--- src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp.orig	2017-10-18 07:12:58 UTC
2
+++ src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
3
@@ -43,6 +43,7 @@
4
 
5
 #include <net/if_dl.h>
6
 #include <netinet/in.h>
7
+#include <net80211/ieee80211_ioctl.h>
8
 
9
 #include <stdlib.h>
10
 #include <stdio.h>
11
@@ -311,7 +312,7 @@ int NetIfList(std::list <ComObjPtr<HostNetworkInterfac
12
             else
13
                 enmType = HostNetworkInterfaceType_HostOnly;
14
 
15
-            pNew->wireless = isWireless(pNew->szName);
16
+            pNew->fWireless = isWireless(pNew->szName);
17
 
18
             ComObjPtr<HostNetworkInterface> IfObj;
19
             IfObj.createObject();
(-)emulators/virtualbox-ose/files/patch-src_VBox_RDP-client-1.8.4-Makefile.kmk (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/RDP/client-1.8.4/Makefile.kmk.orig	2019-10-10 18:14:11 UTC
2
+++ src/VBox/RDP/client-1.8.4/Makefile.kmk
3
@@ -117,7 +117,6 @@ rdesktop-vrdp_SOURCES.solaris = \
4
 rdesktop-vrdp_SOURCES.freebsd = \
5
 	rdpsnd_oss.c
6
 rdesktop-vrdp_LIBPATH = \
7
-	/usr/lib \
8
 	$(VBOX_LIBPATH_X11)
9
 rdesktop-vrdp_LIBS = \
10
 	X11 \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_common_err_RTErrConvertFromErrno.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp.orig	2018-01-15 14:56:07 UTC
2
+++ src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp
3
@@ -302,7 +302,7 @@ RTDECL(int)  RTErrConvertFromErrno(unsigned uNativeCod
4
         case EILSEQ:            return VERR_NO_TRANSLATION;
5
 #endif
6
 #ifdef ERESTART
7
-        case ERESTART:          return VERR_INTERRUPTED;/** @todo fix duplicate error?*/
8
+        case (unsigned)ERESTART: return VERR_INTERRUPTED;/** @todo fix duplicate error?*/
9
 #endif
10
 #ifdef ESTRPIPE
11
         //case ESTRPIPE 86      /* Streams pipe error */
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c (-131 / +50 lines)
Lines 1-6 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2020-07-09 16:57:38 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2020-10-16 16:38:10 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
3
@@ -105,6 +105,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap(PRTR0MEMOBJINT
3
@@ -129,6 +129,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap(PRTR0MEMOBJINT
4
 
4
 
5
 DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
5
 DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
6
 {
6
 {
Lines 8-14 Link Here
8
     PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)pMem;
8
     PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)pMem;
9
     int rc;
9
     int rc;
10
 
10
 
11
@@ -121,16 +122,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
11
@@ -145,16 +146,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
12
 
12
 
13
         case RTR0MEMOBJTYPE_LOCK:
13
         case RTR0MEMOBJTYPE_LOCK:
14
         {
14
         {
Lines 30-36 Link Here
30
             break;
30
             break;
31
         }
31
         }
32
 
32
 
33
@@ -194,6 +194,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
33
@@ -210,6 +210,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
34
             return VERR_INTERNAL_ERROR;
34
             return VERR_INTERNAL_ERROR;
35
     }
35
     }
36
 
36
 
Lines 38-130 Link Here
38
     return VINF_SUCCESS;
38
     return VINF_SUCCESS;
39
 }
39
 }
40
 
40
 
41
@@ -224,18 +225,23 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe
41
@@ -320,7 +321,8 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE
42
 #else
43
         VM_OBJECT_UNLOCK(pObject);
44
 #endif
45
-        if (pPages)
46
+        if (pPages || cTries >= 1)
47
             break;
48
+#if __FreeBSD_version >= 1100092
49
+        if (!vm_page_reclaim_contig(fFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0))
50
+             break;
51
+#elif __FreeBSD_version >= 1000015
52
         vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh);
53
+#else
54
+        vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
55
+#endif
56
         cTries++;
57
     }
58
-
59
-    return pPages;
60
 #else
61
-    while (cTries <= 1)
62
+    while (1)
63
     {
64
         pPages = vm_phys_alloc_contig(cPages, 0, VmPhysAddrHigh, uAlignment, 0);
65
-        if (pPages)
66
+        if (pPages || cTries >= 1)
67
             break;
68
         vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
69
         cTries++;
70
@@ -243,11 +249,8 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe
71
 
72
     if (!pPages)
73
         return pPages;
74
-#if __FreeBSD_version >= 1000030
75
-    VM_OBJECT_WLOCK(pObject);
76
-#else
77
+
78
     VM_OBJECT_LOCK(pObject);
79
-#endif
80
     for (vm_pindex_t iPage = 0; iPage < cPages; iPage++)
81
     {
82
         vm_page_t pPage = pPages + iPage;
83
@@ -259,13 +262,9 @@ static vm_page_t rtR0MemObjFreeBSDContigPhysAllocHelpe
84
             atomic_add_int(&cnt.v_wire_count, 1);
85
         }
86
     }
87
-#if __FreeBSD_version >= 1000030
88
-    VM_OBJECT_WUNLOCK(pObject);
89
-#else
90
     VM_OBJECT_UNLOCK(pObject);
91
 #endif
92
     return pPages;
93
-#endif
94
 }
95
 
96
 static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages,
97
@@ -292,16 +291,17 @@ static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_
98
 #else
99
             VM_OBJECT_LOCK(pObject);
100
 #endif
101
+
102
             while (iPage-- > 0)
103
             {
104
                 pPage = vm_page_lookup(pObject, iPage);
105
-#if __FreeBSD_version < 1000000
106
+#if __FreeBSD_version < 900000
107
                 vm_page_lock_queues();
108
 #endif
109
                 if (fWire)
110
                     vm_page_unwire(pPage, 0);
111
                 vm_page_free(pPage);
112
-#if __FreeBSD_version < 1000000
113
+#if __FreeBSD_version < 900000
114
                 vm_page_unlock_queues();
115
 #endif
116
             }
117
@@ -323,7 +323,8 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE
118
     size_t      cPages = atop(pMemFreeBSD->Core.cb);
42
     size_t      cPages = atop(pMemFreeBSD->Core.cb);
119
     int         rc;
43
     int         rc;
120
 
44
 
121
-    pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages);
45
-    pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, cPages);
122
+    pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL,
46
+    pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL,
123
+        pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred);
47
+            pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred);
124
 
48
 
125
     /* No additional object reference for auto-deallocation upon unmapping. */
49
     /* No additional object reference for auto-deallocation upon unmapping. */
126
 #if __FreeBSD_version >= 1000055
50
 #if __FreeBSD_version >= 1000055
127
@@ -364,58 +365,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE
51
@@ -361,58 +363,77 @@ static int rtR0MemObjFreeBSDAllocHelper(PRTR0MEMOBJFRE
128
 }
52
 }
129
 DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
53
 DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
130
 {
54
 {
Lines 202-208 Link Here
202
     return rc;
126
     return rc;
203
 }
127
 }
204
 
128
 
205
@@ -425,6 +445,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB
129
@@ -422,6 +443,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB
206
                                            RTHCPHYS PhysHighest, size_t uAlignment,
130
                                            RTHCPHYS PhysHighest, size_t uAlignment,
207
                                            bool fContiguous, int rcNoMem)
131
                                            bool fContiguous, int rcNoMem)
208
 {
132
 {
Lines 210-216 Link Here
210
     uint32_t   cPages = atop(cb);
134
     uint32_t   cPages = atop(cb);
211
     vm_paddr_t VmPhysAddrHigh;
135
     vm_paddr_t VmPhysAddrHigh;
212
 
136
 
213
@@ -432,9 +453,13 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB
137
@@ -429,9 +451,13 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB
214
     PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD),
138
     PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD),
215
                                                                        enmType, NULL, cb);
139
                                                                        enmType, NULL, cb);
216
     if (!pMemFreeBSD)
140
     if (!pMemFreeBSD)
Lines 221-231 Link Here
221
 
145
 
222
-    pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb));
146
-    pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb));
223
+    pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL,
147
+    pMemFreeBSD->pObject = vm_pager_allocate(OBJT_PHYS, NULL,
224
+        pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred);
148
+            pMemFreeBSD->Core.cb, VM_PROT_ALL, 0, curthread->td_ucred);
225
 
149
 
226
     if (PhysHighest != NIL_RTHCPHYS)
150
     if (PhysHighest != NIL_RTHCPHYS)
227
         VmPhysAddrHigh = PhysHighest;
151
         VmPhysAddrHigh = PhysHighest;
228
@@ -470,6 +495,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB
152
@@ -459,6 +485,7 @@ static int rtR0MemObjFreeBSDAllocPhysPages(PPRTR0MEMOB
229
         rtR0MemObjDelete(&pMemFreeBSD->Core);
153
         rtR0MemObjDelete(&pMemFreeBSD->Core);
230
     }
154
     }
231
 
155
 
Lines 233-239 Link Here
233
     return rc;
157
     return rc;
234
 }
158
 }
235
 
159
 
236
@@ -489,17 +515,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMO
160
@@ -478,17 +505,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMO
237
 DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy)
161
 DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy)
238
 {
162
 {
239
     AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED);
163
     AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED);
Lines 256-262 Link Here
256
     return VINF_SUCCESS;
180
     return VINF_SUCCESS;
257
 }
181
 }
258
 
182
 
259
@@ -511,6 +542,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER
183
@@ -500,6 +532,7 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER
260
                                      vm_offset_t AddrStart, size_t cb, uint32_t fAccess,
184
                                      vm_offset_t AddrStart, size_t cb, uint32_t fAccess,
261
                                      RTR0PROCESS R0Process, int fFlags)
185
                                      RTR0PROCESS R0Process, int fFlags)
262
 {
186
 {
Lines 264-270 Link Here
264
     int rc;
188
     int rc;
265
     NOREF(fAccess);
189
     NOREF(fAccess);
266
 
190
 
267
@@ -519,21 +551,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER
191
@@ -508,21 +541,28 @@ static int rtR0MemObjNativeLockInMap(PPRTR0MEMOBJINTER
268
     if (!pMemFreeBSD)
192
     if (!pMemFreeBSD)
269
         return VERR_NO_MEMORY;
193
         return VERR_NO_MEMORY;
270
 
194
 
Lines 301-307 Link Here
301
     return VERR_NO_MEMORY;/** @todo fix mach -> vbox error conversion for freebsd. */
225
     return VERR_NO_MEMORY;/** @todo fix mach -> vbox error conversion for freebsd. */
302
 }
226
 }
303
 
227
 
304
@@ -569,6 +608,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOB
228
@@ -558,6 +598,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKernel(PPRTR0MEMOB
305
  */
229
  */
306
 static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, vm_map_t pMap)
230
 static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, vm_map_t pMap)
307
 {
231
 {
Lines 309-315 Link Here
309
     int rc;
233
     int rc;
310
 
234
 
311
     /*
235
     /*
312
@@ -626,11 +666,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN
236
@@ -615,11 +656,13 @@ static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJIN
313
         pMemFreeBSD->Core.pv = (void *)MapAddress;
237
         pMemFreeBSD->Core.pv = (void *)MapAddress;
314
         pMemFreeBSD->Core.u.ResVirt.R0Process = R0Process;
238
         pMemFreeBSD->Core.u.ResVirt.R0Process = R0Process;
315
         *ppMem = &pMemFreeBSD->Core;
239
         *ppMem = &pMemFreeBSD->Core;
Lines 323-329 Link Here
323
     return rc;
247
     return rc;
324
 
248
 
325
 }
249
 }
326
@@ -652,6 +694,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveUser(PPRTR0MEMO
250
@@ -641,6 +684,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveUser(PPRTR0MEMO
327
 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
251
 DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
328
                                           unsigned fProt, size_t offSub, size_t cbSub)
252
                                           unsigned fProt, size_t offSub, size_t cbSub)
329
 {
253
 {
Lines 332-338 Link Here
332
 //  AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED);
256
 //  AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED);
333
     AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED);
257
     AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED);
334
 
258
 
335
@@ -707,6 +751,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ
259
@@ -697,6 +742,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ
336
             Assert((vm_offset_t)pMemFreeBSD->Core.pv == Addr);
260
             Assert((vm_offset_t)pMemFreeBSD->Core.pv == Addr);
337
             pMemFreeBSD->Core.u.Mapping.R0Process = NIL_RTR0PROCESS;
261
             pMemFreeBSD->Core.u.Mapping.R0Process = NIL_RTR0PROCESS;
338
             *ppMem = &pMemFreeBSD->Core;
262
             *ppMem = &pMemFreeBSD->Core;
Lines 340-346 Link Here
340
             return VINF_SUCCESS;
264
             return VINF_SUCCESS;
341
         }
265
         }
342
         rc = vm_map_remove(kernel_map, Addr, Addr + cbSub);
266
         rc = vm_map_remove(kernel_map, Addr, Addr + cbSub);
343
@@ -715,6 +760,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ
267
@@ -705,6 +751,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ
344
     else
268
     else
345
         vm_object_deallocate(pMemToMapFreeBSD->pObject);
269
         vm_object_deallocate(pMemToMapFreeBSD->pObject);
346
 
270
 
Lines 348-356 Link Here
348
     return VERR_NO_MEMORY;
272
     return VERR_NO_MEMORY;
349
 }
273
 }
350
 
274
 
351
@@ -722,6 +768,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ
275
@@ -712,6 +759,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJ
352
 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
276
 DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment,
353
                                         unsigned fProt, RTR0PROCESS R0Process)
277
                                         unsigned fProt, RTR0PROCESS R0Process, size_t offSub, size_t cbSub)
354
 {
278
 {
355
+    IPRT_FREEBSD_SAVE_EFL_AC();
279
+    IPRT_FREEBSD_SAVE_EFL_AC();
356
+
280
+
Lines 357-390 Link Here
357
     /*
281
     /*
358
      * Check for unsupported stuff.
282
      * Check for unsupported stuff.
359
      */
283
      */
360
@@ -751,7 +799,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN
284
@@ -768,47 +817,53 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN
361
     {
362
         /** @todo is this needed?. */
363
         PROC_LOCK(pProc);
364
-        AddrR3 = round_page((vm_offset_t)pProc->p_vmspace->vm_daddr + lim_max(pProc, RLIMIT_DATA));
365
+        AddrR3 = round_page((vm_offset_t)pProc->p_vmspace->vm_daddr +
366
+#if __FreeBSD_version >= 1100077
367
+                            lim_max_proc(pProc, RLIMIT_DATA));
368
+#else
369
+                            lim_max(pProc, RLIMIT_DATA));
370
+#endif
371
         PROC_UNLOCK(pProc);
372
     }
373
     else
374
@@ -774,10 +827,9 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN
375
                      0);                    /* copy-on-write and similar flags */
285
                      0);                    /* copy-on-write and similar flags */
376
 
286
 
377
     if (rc == KERN_SUCCESS)
287
     if (rc == KERN_SUCCESS)
378
-    {
288
+        rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + cbSub, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES);
379
         rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES);
380
-        AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc));
381
-
382
+    if (rc == KERN_SUCCESS)
289
+    if (rc == KERN_SUCCESS)
383
+    {
290
     {
384
         rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_INHERIT_SHARE);
291
-        rc = vm_map_wire(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES);
292
+        rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + cbSub, VM_INHERIT_SHARE);
385
         AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc));
293
         AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc));
386
 
294
 
387
@@ -793,6 +845,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN
295
-        rc = vm_map_inherit(pProcMap, AddrR3, AddrR3 + pMemToMap->cb, VM_INHERIT_SHARE);
296
-        AssertMsg(rc == KERN_SUCCESS, ("%#x\n", rc));
297
-
298
         /*
299
          * Create a mapping object for it.
300
          */
301
         PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(RTR0MEMOBJFREEBSD),
302
                                                                            RTR0MEMOBJTYPE_MAPPING,
303
                                                                            (void *)AddrR3,
304
-                                                                           pMemToMap->cb);
305
+                                                                           cbSub);
306
         if (pMemFreeBSD)
307
         {
388
             Assert((vm_offset_t)pMemFreeBSD->Core.pv == AddrR3);
308
             Assert((vm_offset_t)pMemFreeBSD->Core.pv == AddrR3);
389
             pMemFreeBSD->Core.u.Mapping.R0Process = R0Process;
309
             pMemFreeBSD->Core.u.Mapping.R0Process = R0Process;
390
             *ppMem = &pMemFreeBSD->Core;
310
             *ppMem = &pMemFreeBSD->Core;
Lines 392-398 Link Here
392
             return VINF_SUCCESS;
312
             return VINF_SUCCESS;
393
         }
313
         }
394
 
314
 
395
@@ -802,19 +855,25 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJIN
315
-        rc = vm_map_remove(pProcMap, AddrR3, AddrR3 + pMemToMap->cb);
316
+        rc = vm_map_remove(pProcMap, AddrR3, AddrR3 + cbSub /* XXX pMemToMap->cb*/ );
317
         AssertMsg(rc == KERN_SUCCESS, ("Deleting mapping failed\n"));
318
     }
396
     else
319
     else
397
         vm_object_deallocate(pMemToMapFreeBSD->pObject);
320
         vm_object_deallocate(pMemToMapFreeBSD->pObject);
398
 
321
 
Lines 418-424 Link Here
418
 
341
 
419
     if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE)
342
     if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE)
420
         ProtectionFlags = VM_PROT_NONE;
343
         ProtectionFlags = VM_PROT_NONE;
421
@@ -825,7 +884,12 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT
344
@@ -819,7 +874,12 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINT
422
     if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC)
345
     if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC)
423
         ProtectionFlags |= VM_PROT_EXECUTE;
346
         ProtectionFlags |= VM_PROT_EXECUTE;
424
 
347
 
Lines 431-437 Link Here
431
     if (krc == KERN_SUCCESS)
354
     if (krc == KERN_SUCCESS)
432
         return VINF_SUCCESS;
355
         return VINF_SUCCESS;
433
 
356
 
434
@@ -850,11 +914,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
357
@@ -844,11 +904,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
435
 
358
 
436
             vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage);
359
             vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage);
437
 
360
 
Lines 455-461 Link Here
455
         }
378
         }
456
 
379
 
457
         case RTR0MEMOBJTYPE_MAPPING:
380
         case RTR0MEMOBJTYPE_MAPPING:
458
@@ -863,11 +935,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
381
@@ -857,11 +925,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
459
 
382
 
460
             if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS)
383
             if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS)
461
             {
384
             {
Lines 472-489 Link Here
472
             }
395
             }
473
             return vtophys(pb);
396
             return vtophys(pb);
474
         }
397
         }
475
@@ -877,6 +953,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
398
@@ -872,9 +944,11 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
476
         case RTR0MEMOBJTYPE_PHYS_NC:
477
         {
399
         {
478
             RTHCPHYS addr;
400
             RTHCPHYS addr;
401
 
479
+            IPRT_FREEBSD_SAVE_EFL_AC();
402
+            IPRT_FREEBSD_SAVE_EFL_AC();
480
 #if __FreeBSD_version >= 1000030
481
             VM_OBJECT_WLOCK(pMemFreeBSD->pObject);
403
             VM_OBJECT_WLOCK(pMemFreeBSD->pObject);
482
 #else
404
             addr = VM_PAGE_TO_PHYS(vm_page_lookup(pMemFreeBSD->pObject, iPage));
483
@@ -888,6 +965,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGetPagePhysAddr(P
405
             VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject);
484
 #else
485
             VM_OBJECT_UNLOCK(pMemFreeBSD->pObject);
486
 #endif
487
+            IPRT_FREEBSD_RESTORE_EFL_AC();
406
+            IPRT_FREEBSD_RESTORE_EFL_AC();
488
             return addr;
407
             return addr;
489
         }
408
         }
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r0drv_freebsd_mp-r0drv-freebsd.c (-88 / +21 lines)
Lines 1-22 Link Here
1
--- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig	2018-10-15 14:31:31 UTC
1
--- src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c.orig	2019-04-16 10:17:21 UTC
2
+++ src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c
2
+++ src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c
3
@@ -36,6 +36,15 @@
3
@@ -147,7 +147,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void)
4
 #include <iprt/cpuset.h>
5
 #include "r0drv/mp-r0drv.h"
6
 
7
+#if __FreeBSD_version >= 700000 && __FreeBSD_version < 900000
8
+#define cpuset_t            cpumask_t
9
+#define all_cpus            (~(cpumask_t)0)
10
+#define CPU_CLR(n, p)       do { *(p) &= ~((cpumask_t)1 << (n)); } while (0)
11
+#define CPU_SETOF(n, p)     do { *(p) = (cpumask_t)1 << (n); } while (0)
12
+#endif
13
+#if __FreeBSD_version < 1200028
14
+#define smp_no_rendezvous_barrier   smp_no_rendevous_barrier
15
+#endif
16
 
17
 RTDECL(RTCPUID) RTMpCpuId(void)
18
 {
19
@@ -143,7 +152,9 @@ RTDECL(RTCPUID) RTMpGetOnlineCount(void)
20
 static void rtmpOnAllFreeBSDWrapper(void *pvArg)
4
 static void rtmpOnAllFreeBSDWrapper(void *pvArg)
21
 {
5
 {
22
     PRTMPARGS pArgs = (PRTMPARGS)pvArg;
6
     PRTMPARGS pArgs = (PRTMPARGS)pvArg;
Lines 26-43 Link Here
26
 }
10
 }
27
 
11
 
28
 
12
 
29
@@ -155,7 +166,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p
13
@@ -159,7 +161,9 @@ RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *p
30
     Args.pvUser2 = pvUser2;
14
     Args.pvUser2 = pvUser2;
31
     Args.idCpu = NIL_RTCPUID;
15
     Args.idCpu = NIL_RTCPUID;
32
     Args.cHits = 0;
16
     Args.cHits = 0;
33
-    smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendevous_barrier, &Args);
34
+    IPRT_FREEBSD_SAVE_EFL_AC();
17
+    IPRT_FREEBSD_SAVE_EFL_AC();
35
+    smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args);
18
     smp_rendezvous(NULL, rtmpOnAllFreeBSDWrapper, smp_no_rendezvous_barrier, &Args);
36
+    IPRT_FREEBSD_RESTORE_EFL_AC();
19
+    IPRT_FREEBSD_RESTORE_EFL_AC();
37
     return VINF_SUCCESS;
20
     return VINF_SUCCESS;
38
 }
21
 }
39
 
22
 
40
@@ -171,7 +184,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg)
23
@@ -175,7 +179,11 @@ static void rtmpOnOthersFreeBSDWrapper(void *pvArg)
41
     PRTMPARGS pArgs = (PRTMPARGS)pvArg;
24
     PRTMPARGS pArgs = (PRTMPARGS)pvArg;
42
     RTCPUID idCpu = curcpu;
25
     RTCPUID idCpu = curcpu;
43
     if (pArgs->idCpu != idCpu)
26
     if (pArgs->idCpu != idCpu)
Lines 49-83 Link Here
49
 }
32
 }
50
 
33
 
51
 
34
 
52
@@ -180,10 +197,8 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void
35
@@ -196,6 +204,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void
53
     /* Will panic if no rendezvousing cpus, so check up front. */
54
     if (RTMpGetOnlineCount() > 1)
55
     {
56
-#if __FreeBSD_version >= 900000
57
-        cpuset_t    Mask;
58
-#elif  __FreeBSD_version >= 700000
59
-        cpumask_t   Mask;
60
+#if __FreeBSD_version >= 700000
61
+        cpuset_t    Cpus;
62
 #endif
63
         RTMPARGS    Args;
64
 
65
@@ -192,17 +207,15 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void
66
         Args.pvUser2 = pvUser2;
36
         Args.pvUser2 = pvUser2;
67
         Args.idCpu = RTMpCpuId();
37
         Args.idCpu = RTMpCpuId();
68
         Args.cHits = 0;
38
         Args.cHits = 0;
69
+        IPRT_FREEBSD_SAVE_EFL_AC();
39
+        IPRT_FREEBSD_SAVE_EFL_AC();
70
 #if __FreeBSD_version >= 700000
40
 #if __FreeBSD_version >= 700000
71
-# if __FreeBSD_version >= 900000
41
 # if __FreeBSD_version >= 900000
72
-    Mask = all_cpus;
42
         Mask = all_cpus;
73
-    CPU_CLR(curcpu, &Mask);
43
@@ -207,6 +216,7 @@ RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void
74
-# else
75
-    Mask = ~(cpumask_t)curcpu;
76
-# endif
77
-        smp_rendezvous_cpus(Mask, NULL, rtmpOnOthersFreeBSDWrapper, smp_no_rendevous_barrier, &Args);
78
+        Cpus = all_cpus;
79
+        CPU_CLR(curcpu, &Cpus);
80
+        smp_rendezvous_cpus(Cpus, NULL, rtmpOnOthersFreeBSDWrapper, smp_no_rendezvous_barrier, &Args);
81
 #else
44
 #else
82
         smp_rendezvous(NULL, rtmpOnOthersFreeBSDWrapper, NULL, &Args);
45
         smp_rendezvous(NULL, rtmpOnOthersFreeBSDWrapper, NULL, &Args);
83
 #endif
46
 #endif
Lines 85-91 Link Here
85
     }
48
     }
86
     return VINF_SUCCESS;
49
     return VINF_SUCCESS;
87
 }
50
 }
88
@@ -220,18 +233,18 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg)
51
@@ -224,8 +234,10 @@ static void rtmpOnSpecificFreeBSDWrapper(void *pvArg)
89
     RTCPUID     idCpu = curcpu;
52
     RTCPUID     idCpu = curcpu;
90
     if (pArgs->idCpu == idCpu)
53
     if (pArgs->idCpu == idCpu)
91
     {
54
     {
Lines 96-127 Link Here
96
     }
59
     }
97
 }
60
 }
98
 
61
 
99
 
62
@@ -248,6 +260,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE
100
 RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
101
 {
102
-#if __FreeBSD_version >= 900000
103
-    cpuset_t    Mask;
104
-#elif  __FreeBSD_version >= 700000
105
-    cpumask_t   Mask;
106
+#if __FreeBSD_version >= 700000
107
+    cpuset_t    Cpus;
108
 #endif
109
     RTMPARGS    Args;
110
 
111
@@ -244,16 +257,14 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE
112
     Args.pvUser2 = pvUser2;
63
     Args.pvUser2 = pvUser2;
113
     Args.idCpu = idCpu;
64
     Args.idCpu = idCpu;
114
     Args.cHits = 0;
65
     Args.cHits = 0;
115
+    IPRT_FREEBSD_SAVE_EFL_AC();
66
+    IPRT_FREEBSD_SAVE_EFL_AC();
116
 #if __FreeBSD_version >= 700000
67
 #if __FreeBSD_version >= 700000
117
-# if __FreeBSD_version >= 900000
68
 # if __FreeBSD_version >= 900000
118
-    CPU_SETOF(idCpu, &Mask);
69
     CPU_SETOF(idCpu, &Mask);
119
-# else
70
@@ -258,6 +271,7 @@ RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKE
120
-    Mask = (cpumask_t)1 << idCpu;
121
-# endif
122
-    smp_rendezvous_cpus(Mask, NULL, rtmpOnSpecificFreeBSDWrapper, smp_no_rendevous_barrier, &Args);
123
+    CPU_SETOF(idCpu, &Cpus);
124
+    smp_rendezvous_cpus(Cpus, NULL, rtmpOnSpecificFreeBSDWrapper, smp_no_rendezvous_barrier, &Args);
125
 #else
71
 #else
126
     smp_rendezvous(NULL, rtmpOnSpecificFreeBSDWrapper, NULL, &Args);
72
     smp_rendezvous(NULL, rtmpOnSpecificFreeBSDWrapper, NULL, &Args);
127
 #endif
73
 #endif
Lines 129-158 Link Here
129
     return Args.cHits == 1
75
     return Args.cHits == 1
130
          ? VINF_SUCCESS
76
          ? VINF_SUCCESS
131
          : VERR_CPU_NOT_FOUND;
77
          : VERR_CPU_NOT_FOUND;
132
@@ -273,22 +284,16 @@ static void rtmpFreeBSDPokeCallback(void *pvArg)
78
@@ -287,12 +301,14 @@ RTDECL(int) RTMpPokeCpu(RTCPUID idCpu)
133
 
134
 RTDECL(int) RTMpPokeCpu(RTCPUID idCpu)
135
 {
136
-#if __FreeBSD_version >= 900000
137
-    cpuset_t    Mask;
138
-#elif  __FreeBSD_version >= 700000
139
-    cpumask_t   Mask;
140
-#endif
141
+    cpuset_t    Cpus;
142
 
143
     /* Will panic if no rendezvousing cpus, so make sure the cpu is online. */
144
     if (!RTMpIsCpuOnline(idCpu))
79
     if (!RTMpIsCpuOnline(idCpu))
145
         return VERR_CPU_NOT_FOUND;
80
         return VERR_CPU_NOT_FOUND;
146
 
81
 
147
-# if __FreeBSD_version >= 900000
148
-    CPU_SETOF(idCpu, &Mask);
149
-# else
150
-    Mask = (cpumask_t)1 << idCpu;
151
-# endif
152
-    smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendevous_barrier, NULL);
153
+    IPRT_FREEBSD_SAVE_EFL_AC();
82
+    IPRT_FREEBSD_SAVE_EFL_AC();
154
+    CPU_SETOF(idCpu, &Cpus);
83
 # if __FreeBSD_version >= 900000
155
+    smp_rendezvous_cpus(Cpus, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL);
84
     CPU_SETOF(idCpu, &Mask);
85
 # else
86
     Mask = (cpumask_t)1 << idCpu;
87
 # endif
88
     smp_rendezvous_cpus(Mask, NULL, rtmpFreeBSDPokeCallback, smp_no_rendezvous_barrier, NULL);
156
+    IPRT_FREEBSD_RESTORE_EFL_AC();
89
+    IPRT_FREEBSD_RESTORE_EFL_AC();
157
 
90
 
158
     return VINF_SUCCESS;
91
     return VINF_SUCCESS;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Runtime_r3_posix_process-creation-posix.cpp (+29 lines)
Line 0 Link Here
1
--- src/VBox/Runtime/r3/posix/process-creation-posix.cpp.orig	2019-09-14 04:31:25.372784000 +0800
2
+++ src/VBox/Runtime/r3/posix/process-creation-posix.cpp	2019-09-14 05:18:04.495025000 +0800
3
@@ -30,7 +30,7 @@
4
 *********************************************************************************************************************************/
5
 #define LOG_GROUP RTLOGGROUP_PROCESS
6
 #include <iprt/cdefs.h>
7
-#ifdef RT_OS_LINUX
8
+#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
9
 # define IPRT_WITH_DYNAMIC_CRYPT_R
10
 #endif
11
 #if (defined(RT_OS_LINUX) || defined(RT_OS_OS2)) && !defined(_GNU_SOURCE)
12
@@ -64,7 +64,7 @@
13
 # include <shadow.h>
14
 #endif
15
 
16
-#if defined(RT_OS_LINUX) || defined(RT_OS_OS2)
17
+#if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD)
18
 /* While Solaris has posix_spawn() of course we don't want to use it as
19
  * we need to have the child in a different process contract, no matter
20
  * whether it is started detached or not. */
21
@@ -363,7 +363,7 @@
22
     if (pPwd->pw_passwd && *pPwd->pw_passwd)
23
 # endif
24
     {
25
-# if defined(RT_OS_LINUX) || defined(RT_OS_OS2)
26
+# if defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD)
27
 #  ifdef IPRT_WITH_DYNAMIC_CRYPT_R
28
         size_t const       cbCryptData = RT_MAX(sizeof(struct crypt_data) * 2, _256K);
29
 #  else
(-)emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR0_GVMMR0.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/VMM/VMMR0/GVMMR0.cpp.orig	2020-05-13 19:44:47 UTC
2
+++ src/VBox/VMM/VMMR0/GVMMR0.cpp
3
@@ -1243,7 +1243,7 @@ static void gvmmR0CleanupVM(PGVM pGVM)
4
 
5
     GMMR0CleanupVM(pGVM);
6
 
7
-    AssertCompile((uintptr_t)NIL_RTTHREADCTXHOOK == 0); /* Depends on zero initialized memory working for NIL at the moment. */
8
+    AssertCompile(NIL_RTTHREADCTXHOOK == (RTTHREADCTXHOOK)0); /* Depends on zero initialized memory working for NIL at the moment. */
9
     for (VMCPUID idCpu = 0; idCpu < pGVM->cCpus; idCpu++)
10
     {
11
         /** @todo Can we busy wait here for all thread-context hooks to be
(-)emulators/virtualbox-ose/files/patch-src_VBox_VMM_VMMR3_VMReq.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/VMM/VMMR3/VMReq.cpp.orig	2018-01-15 14:56:37 UTC
2
+++ src/VBox/VMM/VMMR3/VMReq.cpp
3
@@ -669,7 +669,7 @@ VMMR3DECL(int) VMR3ReqAlloc(PUVM pUVM, PVMREQ *ppReq, 
4
             Assert(pReq->enmType == VMREQTYPE_INVALID);
5
             Assert(pReq->enmState == VMREQSTATE_FREE);
6
             Assert(pReq->pUVM == pUVM);
7
-            ASMAtomicXchgSize(&pReq->pNext, NULL);
8
+            ASMAtomicXchgSize(&pReq->pNext, (uintptr_t)NULL);
9
             pReq->enmState = VMREQSTATE_ALLOCATED;
10
             pReq->iStatus  = VERR_VM_REQUEST_STATUS_STILL_PENDING;
11
             pReq->fFlags   = VMREQFLAGS_VBOX_STATUS;
(-)emulators/virtualbox-ose/files/patch-src_VBox_VMM_include_IEMInternal.h (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/VMM/include/IEMInternal.h.orig	2020-04-14 19:58:48 UTC
2
+++ src/VBox/VMM/include/IEMInternal.h
3
@@ -1082,7 +1082,7 @@ typedef enum IEMACCESSCRX
4
 
5
 #if defined(__GNUC__) && defined(RT_ARCH_X86)
6
 # define IEM_DECL_IMPL_TYPE(a_RetType, a_Name, a_ArgList) \
7
-    __attribute__((__fastcall__)) a_RetType (a_Name) a_ArgList
8
+    __attribute__((__fastcall__, __nothrow__)) a_RetType (a_Name) a_ArgList
9
 # define IEM_DECL_IMPL_DEF(a_RetType, a_Name, a_ArgList) \
10
     __attribute__((__fastcall__, __nothrow__)) a_RetType a_Name a_ArgList
11
 
(-)emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c (-5 / +3 lines)
Lines 1-4 Link Here
1
--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig	2020-05-13 19:46:23 UTC
1
--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig	2019-04-16 10:18:41 UTC
2
+++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c
2
+++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c
3
@@ -49,6 +49,9 @@
3
@@ -49,6 +49,9 @@
4
 #include <string.h>
4
 #include <string.h>
Lines 10-22 Link Here
10
 
10
 
11
 static pthread_mutexattr_t _pt_mattr;
11
 static pthread_mutexattr_t _pt_mattr;
12
 static pthread_condattr_t _pt_cvar_attr;
12
 static pthread_condattr_t _pt_cvar_attr;
13
@@ -798,7 +801,8 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char *
13
@@ -798,6 +801,7 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char *
14
  * From the semctl(2) man page in glibc 2.0
14
  * From the semctl(2) man page in glibc 2.0
15
  */
15
  */
16
 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
16
 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
17
-    || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI)
18
+    || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
17
+    || (defined(FREEBSD) && __FreeBSD_version < 1200059) \
19
+    || defined(OPENBSD) || defined(BSDI)
18
     || defined(OPENBSD) || defined(BSDI)
20
 /* union semun is defined by including <sys/sem.h> */
19
 /* union semun is defined by including <sys/sem.h> */
21
 #else
20
 #else
22
 /* according to X/OPEN we have to define it ourselves */
(-)emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_io_nsLocalFileUnix.h (-2 / +2 lines)
Lines 1-5 Link Here
1
--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig	2020-05-13 19:46:34 UTC
1
--- src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h.orig	2017-03-08 17:21:24.000000000 +0000
2
+++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h
2
+++ src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h	2017-03-08 22:53:39.572250000 +0000
3
@@ -72,14 +72,6 @@
3
@@ -72,14 +72,6 @@
4
     #define STATFS statfs
4
     #define STATFS statfs
5
 #endif
5
 #endif
(-)emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp (-38 lines)
Lines 1-38 Link Here
1
--- src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp.orig	2019-10-10 18:15:53 UTC
2
+++ src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp
3
@@ -143,11 +143,22 @@ XPTC_InvokeByIndex(nsISupports * that, PRUint32 method
4
     if (nr_stack)
5
         nr_stack = (nr_stack + 1) & ~1;
6
 
7
+#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__)
8
     // Load parameters to stack, if necessary
9
     PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8);
10
+#else
11
+    typedef struct { PRUint64 stack[20]; } methodStack;
12
+    if (nr_stack > 20)
13
+        return NS_ERROR_CALL_FAILED;
14
+    methodStack stack;
15
+#endif
16
     PRUint64 gpregs[GPR_COUNT];
17
     double fpregs[FPR_COUNT];
18
+#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__)
19
     invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs);
20
+#else
21
+    invoke_copy_to_stack(stack.stack, paramCount, params, gpregs, fpregs);
22
+#endif
23
 
24
     // Load FPR registers from fpregs[]
25
     register double d0 asm("xmm0");
26
@@ -205,7 +216,12 @@ XPTC_InvokeByIndex(nsISupports * that, PRUint32 method
27
     methodAddress += 8 * methodIndex;
28
     methodAddress = *((PRUint64 *)methodAddress);
29
     
30
+#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__)
31
     typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64);
32
     PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5);
33
+#else
34
+    typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, methodStack);
35
+    PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5, stack);
36
+#endif
37
     return result;
38
 }
(-)emulators/virtualbox-ose/files/patch-src_recompiler_Makefile.kmk (-12 lines)
Lines 1-12 Link Here
1
--- src/recompiler/Makefile.kmk.orig	2019-01-25 18:33:40 UTC
2
+++ src/recompiler/Makefile.kmk
3
@@ -63,6 +63,9 @@ else
4
  # Missing fpclassify. Is there a better define or flag for this?
5
  VBoxRemPrimary_DEFS.solaris  += __C99FEATURES__
6
 endif # win
7
+# XXX Work around a linker issue with GCC 8.x & LLD:
8
+# ld: error: translate.c:(.debug_loc+0xA40FD): has non-ABS relocation R_386_GOTOFF against symbol 'cpu_regs'
9
+VBoxRemPrimary_CFLAGS.freebsd.x86 += -g0
10
 VBoxRemPrimary_DEFS           += IN_REM_R3 REM_INCLUDE_CPU_H NEED_CPU_H
11
 #VBoxRemPrimary_DEFS           += REM_PHYS_ADDR_IN_TLB
12
 #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.
(-)emulators/virtualbox-ose/pkg-plist (-6 / +7 lines)
Lines 6-11 Link Here
6
%%X11%%bin/VBoxSDL
6
%%X11%%bin/VBoxSDL
7
bin/VBoxVRDP
7
bin/VBoxVRDP
8
%%QT%%bin/VirtualBox
8
%%QT%%bin/VirtualBox
9
%%QT%%bin/VirtualBoxVM
9
bin/vboxautostart
10
bin/vboxautostart
10
bin/vboxballoonctrl
11
bin/vboxballoonctrl
11
bin/vboxbugreport
12
bin/vboxbugreport
Lines 14-19 Link Here
14
%%X11%%bin/vboxsdl
15
%%X11%%bin/vboxsdl
15
%%WEBSERVICE%%bin/vboxwebsrv
16
%%WEBSERVICE%%bin/vboxwebsrv
16
%%QT%%bin/virtualbox
17
%%QT%%bin/virtualbox
18
%%QT%%bin/virtualboxvm
17
include/virtualbox/VirtualBox_XPCOM.h
19
include/virtualbox/VirtualBox_XPCOM.h
18
include/virtualbox/ipcIClientObserver.h
20
include/virtualbox/ipcIClientObserver.h
19
include/virtualbox/ipcIDConnectService.h
21
include/virtualbox/ipcIDConnectService.h
Lines 378-385 Link Here
378
lib/virtualbox/VBoxDD.so
380
lib/virtualbox/VBoxDD.so
379
lib/virtualbox/VBoxDD2.so
381
lib/virtualbox/VBoxDD2.so
380
lib/virtualbox/VBoxDDR0.r0
382
lib/virtualbox/VBoxDDR0.r0
381
lib/virtualbox/VBoxDDRC.rc
382
lib/virtualbox/VBoxDDU.so
383
lib/virtualbox/VBoxDDU.so
384
%%QT%%lib/virtualbox/UICommon.so
383
%%QT%%lib/virtualbox/VBoxDbg.so
385
%%QT%%lib/virtualbox/VBoxDbg.so
384
%%QT%%lib/virtualbox/VBoxDragAndDropSvc.so
386
%%QT%%lib/virtualbox/VBoxDragAndDropSvc.so
385
lib/virtualbox/VBoxEFI32.fd
387
lib/virtualbox/VBoxEFI32.fd
Lines 399-405 Link Here
399
lib/virtualbox/VBoxNetNAT.so
401
lib/virtualbox/VBoxNetNAT.so
400
%%PYTHON%%lib/virtualbox/VBoxPython.so
402
%%PYTHON%%lib/virtualbox/VBoxPython.so
401
%%PYTHON%%lib/virtualbox/VBoxPython%%PYTHON_VERU%%.so
403
%%PYTHON%%lib/virtualbox/VBoxPython%%PYTHON_VERU%%.so
402
lib/virtualbox/VBoxREM.so
403
%%I386%%lib/virtualbox/VBoxREM32.so
404
%%I386%%lib/virtualbox/VBoxREM32.so
404
%%I386%%lib/virtualbox/VBoxREM64.so
405
%%I386%%lib/virtualbox/VBoxREM64.so
405
lib/virtualbox/VBoxRT.so
406
lib/virtualbox/VBoxRT.so
Lines 406-413 Link Here
406
%%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL
407
%%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL
407
%%X11%%lib/virtualbox/VBoxSDL.so
408
%%X11%%lib/virtualbox/VBoxSDL.so
408
lib/virtualbox/VBoxSVC
409
lib/virtualbox/VBoxSVC
410
%%X11%%lib/virtualbox/VBoxSVGA3D.so
409
%%X11%%lib/virtualbox/VBoxSharedClipboard.so
411
%%X11%%lib/virtualbox/VBoxSharedClipboard.so
410
%%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so
411
lib/virtualbox/VBoxSharedFolders.so
412
lib/virtualbox/VBoxSharedFolders.so
412
%%QT%%lib/virtualbox/VBoxTestOGL
413
%%QT%%lib/virtualbox/VBoxTestOGL
413
lib/virtualbox/VBoxVMM.so
414
lib/virtualbox/VBoxVMM.so
Lines 416-424 Link Here
416
lib/virtualbox/VBoxXPCOMC.so
417
lib/virtualbox/VBoxXPCOMC.so
417
lib/virtualbox/VBoxXPCOMIPCD
418
lib/virtualbox/VBoxXPCOMIPCD
418
lib/virtualbox/VMMR0.r0
419
lib/virtualbox/VMMR0.r0
419
lib/virtualbox/VMMRC.rc
420
%%QT%%lib/virtualbox/VirtualBox
420
%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBox
421
%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM
421
%%QT%%lib/virtualbox/VirtualBox.so
422
%%QT%%lib/virtualbox/VirtualBoxVM.so
422
%%SDK%%lib/virtualbox/sdk
423
%%SDK%%lib/virtualbox/sdk
423
%%WEBSERVICE%%lib/virtualbox/vboxwebsrv
424
%%WEBSERVICE%%lib/virtualbox/vboxwebsrv
424
%%WEBSERVICE%%lib/virtualbox/webtest
425
%%WEBSERVICE%%lib/virtualbox/webtest
(-)emulators/virtualbox-ose-additions/Makefile (-13 / +3 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.44
5
PORTVERSION=	6.1.18
6
PORTREVISION=	3
7
CATEGORIES=	emulators
6
CATEGORIES=	emulators
8
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.com/virtualbox/${PORTVERSION}/
9
PKGNAMESUFFIX?=	-additions
8
PKGNAMESUFFIX?=	-additions
10
DISTNAME=	VirtualBox-${PORTVERSION}
9
DISTNAME=	VirtualBox-${PORTVERSION}
11
10
Lines 26-32 Link Here
26
CPE_VENDOR=	oracle
25
CPE_VENDOR=	oracle
27
CPE_PRODUCT=	vm_virtualbox
26
CPE_PRODUCT=	vm_virtualbox
28
27
29
PATCHDIR=	${.CURDIR}/../${PORTNAME}/files
28
PATCHDIR=	${.CURDIR}/../${PORTNAME}/fileo
30
WRKSRC=		${WRKDIR}/VirtualBox-${PORTVERSION}
29
WRKSRC=		${WRKDIR}/VirtualBox-${PORTVERSION}
31
MAKE_JOBS_UNSAFE=	yes
30
MAKE_JOBS_UNSAFE=	yes
32
31
Lines 91-102 Link Here
91
90
92
.include <bsd.port.pre.mk>
91
.include <bsd.port.pre.mk>
93
92
94
.if ${COMPILER_TYPE} == clang
95
.if ${COMPILER_FEATURES:Mlibc++}
96
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefile.kmk
97
.endif
98
.endif
99
100
post-patch:
93
post-patch:
101
	@${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk
94
	@${ECHO_CMD} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk
102
	@${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_X11}' >> \
95
	@${ECHO_CMD} 'VBOX_WITH_DRAG_AND_DROP = ${VBOX_WITH_X11}' >> \
Lines 111-123 Link Here
111
	    -e 's| -fno-merge-constants||' \
104
	    -e 's| -fno-merge-constants||' \
112
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
105
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
113
.endif
106
.endif
114
	@${REINPLACE_CMD} -e 's|/usr/X11|${LOCALBASE}|g' \
115
	    ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/display.cpp
116
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
107
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
117
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
108
	    ${WRKSRC}/Config.kmk ${WRKSRC}/configure \
118
	    ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
109
	    ${WRKSRC}/kBuild/header.kmk ${WRKSRC}/kBuild/units/qt4.kmk \
119
	    ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
110
	    ${WRKSRC}/kBuild/units/qt5.kmk ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
120
	    ${WRKSRC}/src/VBox/Additions/common/crOpenGL/load.c \
121
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
111
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
122
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
112
	    ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
123
	    ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \
113
	    ${WRKSRC}/src/VBox/Additions/x11/vboxmouse/Makefile.kmk \
(-)emulators/virtualbox-ose-additions/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1594821235
1
TIMESTAMP = 1613903085
2
SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e
2
SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40
3
SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934
3
SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486
(-)emulators/virtualbox-ose-kmod/Makefile (-4 / +4 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.44
5
PORTVERSION=	6.1.18
6
PORTREVISION=	4
7
CATEGORIES=	emulators
6
CATEGORIES=	emulators
8
MASTER_SITES=	https://download.oracle.com/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
9
PKGNAMESUFFIX=	-kmod
8
PKGNAMESUFFIX=	-kmod
10
DISTNAME=	VirtualBox-${PORTVERSION}
9
DISTNAME=	VirtualBox-${PORTVERSION}
11
10
Lines 63-69 Link Here
63
.if ${PORT_OPTIONS:MDEBUG}
62
.if ${PORT_OPTIONS:MDEBUG}
64
KMK_FLAGS+=	BUILD_TYPE=debug
63
KMK_FLAGS+=	BUILD_TYPE=debug
65
KMK_BUILDTYPE=	debug
64
KMK_BUILDTYPE=	debug
66
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile
65
EXTRA_PATCHES+=	${PATCHDIR}/extrapatch-Config.kmk \
66
		${PATCHDIR}/extrapatch-src-VBox-HostDrivers-Support-freebsd-Makefile
67
MAKE_ARGS+=	DEBUG_FLAGS="-O1 -g"
67
MAKE_ARGS+=	DEBUG_FLAGS="-O1 -g"
68
.endif
68
.endif
69
69
(-)emulators/virtualbox-ose-kmod/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1594821147
1
TIMESTAMP = 1613865409
2
SHA256 (VirtualBox-5.2.44.tar.bz2) = ad83b11cfae2734f7d6f619dd2f8bdada7d33492cd7682fab98cb4053122295e
2
SHA256 (VirtualBox-6.1.18.tar.bz2) = 108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40
3
SIZE (VirtualBox-5.2.44.tar.bz2) = 124016934
3
SIZE (VirtualBox-6.1.18.tar.bz2) = 165507486

Return to bug 234878