aboutsummaryrefslogtreecommitdiff
path: root/emulators/virtualbox-ose
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2020-04-14 13:47:51 +0000
committerKyle Evans <kevans@FreeBSD.org>2020-04-14 13:47:51 +0000
commita714a89d7837edf7a1303c2121d82247cc226632 (patch)
tree5cef4a1e41f270086e621026762793da5b2e3ff0 /emulators/virtualbox-ose
parentcbe65e3acf5f85894095286fea759df844761ed2 (diff)
downloadports-a714a89d7837edf7a1303c2121d82247cc226632.tar.gz
ports-a714a89d7837edf7a1303c2121d82247cc226632.zip
Notes
Diffstat (limited to 'emulators/virtualbox-ose')
-rw-r--r--emulators/virtualbox-ose/Makefile9
-rw-r--r--emulators/virtualbox-ose/files/patch-Config.kmk11
-rw-r--r--emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp38
3 files changed, 51 insertions, 7 deletions
diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile
index c70cc14c5db1..16a413cdca27 100644
--- a/emulators/virtualbox-ose/Makefile
+++ b/emulators/virtualbox-ose/Makefile
@@ -3,7 +3,7 @@
PORTNAME= virtualbox-ose
PORTVERSION= 5.2.34
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= emulators
MASTER_SITES= https://download.oracle.com/virtualbox/${PORTVERSION}/
DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
@@ -30,13 +30,8 @@ CPE_PRODUCT= vm_virtualbox
WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION}
ONLY_FOR_ARCHS= i386 amd64
-USES= cpe gnome iconv pkgconfig ssl tar:bzip2
+USES= compiler:c++14-lang cpe gnome iconv pkgconfig ssl tar:bzip2
USE_GNOME= libidl libxml2
-# machine/atomic.h may use features that are only available in GCC9. This is
-# a workaround, anyways- we should be expressing USES= compiler:c++14-lang, but
-# contemporary clang miscompiles virtualbox in some fashion and yields runtime
-# breakage.
-USE_GCC= any
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --disable-java --passive-mesa
diff --git a/emulators/virtualbox-ose/files/patch-Config.kmk b/emulators/virtualbox-ose/files/patch-Config.kmk
index c660803fc82e..e7f6573d7a28 100644
--- a/emulators/virtualbox-ose/files/patch-Config.kmk
+++ b/emulators/virtualbox-ose/files/patch-Config.kmk
@@ -74,6 +74,17 @@
# branding
VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html
VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf
+@@ -2538,6 +2534,10 @@ ifeq ($(KBUILD_HOST),win) ## @todo can drop this now,
+ # This isn't important (yet) on windows, so cook the result until
+ # cygwin is feeling better.
+ VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 3), $(int-mul 100, 3), 3)
++else ifeq($(KBUILD_HOST,freebsd))
++ # At a minimum, we'll be building with GCC 4.2 on FreeBSD. LLVM will always
++ # pose as GCC 4.2 anyways, so this seems safe.
++ VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 4), $(int-mul 100, 2), 0)
+ else
+ # This is kind of bad, the returned string needs to be re-evaluated before use.
+ # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)).
@@ -4158,6 +4154,7 @@ ifdef VBOX_WITH_RAW_MODE
TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL)
TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
diff --git a/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp
new file mode 100644
index 000000000000..f1cc9961e1f5
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_xpcom_reflect_xptcall_src_md_unix_xptcinvoke__x86__64__linux.cpp
@@ -0,0 +1,38 @@
+--- src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp.orig 2019-10-10 18:15:53 UTC
++++ src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp
+@@ -143,11 +143,22 @@ XPTC_InvokeByIndex(nsISupports * that, PRUint32 method
+ if (nr_stack)
+ nr_stack = (nr_stack + 1) & ~1;
+
++#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__)
+ // Load parameters to stack, if necessary
+ PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8);
++#else
++ typedef struct { PRUint64 stack[20]; } methodStack;
++ if (nr_stack > 20)
++ return NS_ERROR_CALL_FAILED;
++ methodStack stack;
++#endif
+ PRUint64 gpregs[GPR_COUNT];
+ double fpregs[FPR_COUNT];
++#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__)
+ invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs);
++#else
++ invoke_copy_to_stack(stack.stack, paramCount, params, gpregs, fpregs);
++#endif
+
+ // Load FPR registers from fpregs[]
+ register double d0 asm("xmm0");
+@@ -205,7 +216,12 @@ XPTC_InvokeByIndex(nsISupports * that, PRUint32 method
+ methodAddress += 8 * methodIndex;
+ methodAddress = *((PRUint64 *)methodAddress);
+
++#if !defined(VBOX_WITH_GCC_SANITIZER) && !defined(__clang__)
+ typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64);
+ PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5);
++#else
++ typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, methodStack);
++ PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5, stack);
++#endif
+ return result;
+ }