aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emulators/virtualbox-ose/Makefile8
-rw-r--r--emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_DevFwCommon.cpp14
2 files changed, 21 insertions, 1 deletions
diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile
index 82c5fc047dd6..cda9d742e9eb 100644
--- a/emulators/virtualbox-ose/Makefile
+++ b/emulators/virtualbox-ose/Makefile
@@ -211,10 +211,16 @@ KMK_FLAGS+= -j${MAKE_JOBS_NUMBER}
.include <bsd.port.pre.mk>
+.if ${OPSYS} == FreeBSD && \
+ (${OSVERSION} < 1300513 || ${OSVERSION} >= 1400000 && ${OSVERSION} < 1400026)
+EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src_VBox_Devices_PC_DevFwCommon.cpp
+.endif
+
.if ${CHOSEN_COMPILER_TYPE} == clang
# llvm10 in FreeBSD before r364284 miscompiles virtualbox 6.1 causing errors.
# force llvm11 from ports
-.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1300109
+.if ${OPSYS} == FreeBSD && \
+ (${OSVERSION} < 1203502 || ${OSVERSION} >= 1300000 && ${OSVERSION} < 1300109)
BUILD_DEPENDS+= clang${VBOX_LLVM_VER}:devel/llvm${VBOX_LLVM_VER}
CC= clang${VBOX_LLVM_VER}
CXX= clang++${VBOX_LLVM_VER}
diff --git a/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_DevFwCommon.cpp b/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_DevFwCommon.cpp
new file mode 100644
index 000000000000..2ee34f889bb6
--- /dev/null
+++ b/emulators/virtualbox-ose/files/extrapatch-src_VBox_Devices_PC_DevFwCommon.cpp
@@ -0,0 +1,14 @@
+--- src/VBox/Devices/PC/DevFwCommon.cpp.orig
++++ src/VBox/Devices/PC/DevFwCommon.cpp
+@@ -40,6 +40,11 @@
+ #include "VBoxDD2.h"
+ #include "DevFwCommon.h"
+
++static inline void *
++mempcpy(void *__restrict dst, const void *__restrict src, size_t len)
++{
++ return ((char *)memcpy(dst, src, len) + len);
++}
+
+ /*********************************************************************************************************************************
+ * Defined Constants And Macros *