diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -211,10 +211,16 @@ .include +.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 --- /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 *