summaryrefslogtreecommitdiff
path: root/app-emulation
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/virtualbox-extpack-oracle/Manifest2
-rw-r--r--app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.2.4.119785.ebuild (renamed from app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.1.28.117968-r1710.ebuild)2
-rw-r--r--app-emulation/virtualbox-guest-additions/Manifest3
-rw-r--r--app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig30
-rw-r--r--app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.4.ebuild (renamed from app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.1.28-r1710.ebuild)36
-rw-r--r--app-emulation/virtualbox-modules/Manifest1
-rwxr-xr-xapp-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh29
-rw-r--r--app-emulation/virtualbox-modules/virtualbox-modules-5.2.4.ebuild (renamed from app-emulation/virtualbox-modules/virtualbox-modules-5.1.28-r1710.ebuild)2
-rw-r--r--app-emulation/virtualbox/Manifest4
-rw-r--r--app-emulation/virtualbox/files/050_virtualbox-5.1.24-nopie.patch158
-rw-r--r--app-emulation/virtualbox/files/vboxwebsrv-confd1
-rw-r--r--app-emulation/virtualbox/files/vboxwebsrv-initd1
-rw-r--r--app-emulation/virtualbox/files/virtualbox-4-localconfig45
-rw-r--r--app-emulation/virtualbox/files/virtualbox-5.1.22-opengl_dlopen_fix.patch167
-rw-r--r--app-emulation/virtualbox/files/virtualbox-5.1.4-paxmark-bldprogs.patch59
-rw-r--r--app-emulation/virtualbox/files/virtualbox-ose-3-config1
-rw-r--r--app-emulation/virtualbox/files/virtualbox-ose-3-wrapper104
-rw-r--r--app-emulation/virtualbox/virtualbox-5.2.4.ebuild (renamed from app-emulation/virtualbox/virtualbox-5.1.28-r1710.ebuild)18
18 files changed, 254 insertions, 409 deletions
diff --git a/app-emulation/virtualbox-extpack-oracle/Manifest b/app-emulation/virtualbox-extpack-oracle/Manifest
index d778d08c..3b03dfeb 100644
--- a/app-emulation/virtualbox-extpack-oracle/Manifest
+++ b/app-emulation/virtualbox-extpack-oracle/Manifest
@@ -1 +1 @@
-DIST Oracle_VM_VirtualBox_Extension_Pack-5.1.28-117968.tar.gz 19626161 SHA256 1a2551b204bd53a252a75a4653b983427bb15d473bc77b14149c7870ce049871 SHA512 71c6ce267c14303bbd9e386ea849d37aeb569afff848054deced4c74fd6fffca83c96b392d066f684b7101a786cc7d24cf9308114c08cbb77b26bb07bf23fcf8 WHIRLPOOL c6fd42f422dca4db4165ff18da0054aff5c0d275850dec4002fb70e8e4248f8f5cffc87697b0802343ebff29cf62938f298df365f9ce19523092d418206deff9
+DIST Oracle_VM_VirtualBox_Extension_Pack-5.2.4-119785.tar.gz 19465971 SHA256 98e9df4f23212c3de827af9d770b391cf2dba8d21f4de597145512c1479302cd SHA512 97f496c9e3ef63a513c6fc31127459136b2bbef885a277d30c832831f079e3fbe8c6900b1799db1a4497a32b116cafb2fe982bd28a201da8d6f4222f70c548d8 WHIRLPOOL c0150bbd51725760cb68a39af3963a1113afd1d00ab5deb2c95800035068ae659328bb2f01088a5f406d4ea8392ba43bbd5913b99b73e8a1399d6a8a8802f718
diff --git a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.1.28.117968-r1710.ebuild b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.2.4.119785.ebuild
index 3c6c739d..1c8dbec2 100644
--- a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.1.28.117968-r1710.ebuild
+++ b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.2.4.119785.ebuild
@@ -25,7 +25,7 @@ SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.vbox-extpack
LICENSE="PUEL"
SLOT="0"
-KEYWORDS="amd64 x86"
+KEYWORDS="amd64 ~x86"
IUSE=""
RESTRICT="mirror strip"
diff --git a/app-emulation/virtualbox-guest-additions/Manifest b/app-emulation/virtualbox-guest-additions/Manifest
index 05a3b09f..c4c2a6e6 100644
--- a/app-emulation/virtualbox-guest-additions/Manifest
+++ b/app-emulation/virtualbox-guest-additions/Manifest
@@ -1 +1,2 @@
-DIST VirtualBox-5.1.28.tar.bz2 116427658 SHA256 ce7d4bf6535f70e3214abeb4866f7a8634aa3c7b6dedf8825e6ad80bd821398d SHA512 5c21fd535424d7fd9adbb51894ec6d37ecf00a63a850362bd7b61fedca5031e096641814130a97ad839c0bd7089dc3dc465509615aab2af3c5735ff71005670a WHIRLPOOL 2e3fbeb39083c2e69fb23200570781a8845780a6295553af48fa9155db132e37d0fc2fb26e8a45c52864f69f02e8a0d0cbd4c895e5fbb87ab9a51dd60c7c7904
+DIST VirtualBox-5.2.4.tar.bz2 118481693 SHA256 c9a060bd99168e05587f1ba74b54e9c1f709734bdfc956b0242fe63e81bb7d14 SHA512 19cb168393098fd28ab2017a27d09a558721d57b31c5d3610deb68a17dfa7fd7ffe9ad7be18714a314724ab5ecb54e7ab5fb76183e8e89afbed2da79649e2798 WHIRLPOOL 3000c4e01ccc0fe09734892b8ed7a69b6f836d6dce8993a8b4049be56b73ce1a318843d27dbb174e92fbdfc25ee10e6c081cb2c3193912b7ec577c9fac619cda
+DIST virtualbox-5.1.30-patches-02.tar.xz 2608 SHA256 25922641e19911fe41d63a348702ed2dcab2ef79379ea236c5da6c36f77a75a5 SHA512 8a490f7cc44e40262fc47819736251c177adb635256794e9500f52729197c85211d5b0c0d000268089953a4c185872a8ba03c5d42df6b80f05eac8b81335320a WHIRLPOOL 3a7ebadf5cc8ba71fe4e4fe43d529ce72dbe95c40838d66112418ad335cb1b1cf7b6aa37fa71ccc6d50044486cb0eef52e59567530935e5a0ed83e9c3f67ec36
diff --git a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig b/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig
deleted file mode 100644
index aeea54d6..00000000
--- a/app-emulation/virtualbox-guest-additions/files/virtualbox-guest-additions-3-localconfig
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Makefile -*-
-#
-# Overwrite some default kBuild settings
-#
-
-#
-# Copyright (C) 2006-2008 Sun Microsystems, Inc.
-#
-# This file is part of VirtualBox Open Source Edition (OSE), as
-# available from http://www.virtualbox.org. This file is free software;
-# you can redistribute it and/or modify it under the terms of the GNU
-# General Public License as published by the Free Software Foundation,
-# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
-# distribution. VirtualBox OSE is distributed in the hope that it will
-# be useful, but WITHOUT ANY WARRANTY of any kind.
-#
-
-# don't build testcases to save time, they are not needed for the package
-VBOX_WITH_TESTCASES :=
-VBOX_WITH_TESTSUITE :=
-
-KBUILD_MSG_STYLE := brief
-
-## paths, origin, hardening
-VBOX_WITH_HARDENING := 2
-VBOX_WITH_ORIGIN :=
-VBOX_ONLY_ADDITIONS := 1
-
-## don't build with -Werror
-VBOX_WITH_WARNINGS_AS_ERRORS :=
diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.1.28-r1710.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.4.ebuild
index 34fbf5cf..91b07ca6 100644
--- a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.1.28-r1710.ebuild
+++ b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.2.4.ebuild
@@ -10,14 +10,16 @@ MY_PV="${MY_PV/rc/RC}"
MY_P=VirtualBox-${MY_PV}
DESCRIPTION="VirtualBox kernel modules and user-space tools for Gentoo guests"
HOMEPAGE="http://www.virtualbox.org/"
-SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
+ https://dev.gentoo.org/~polynomial-c/virtualbox/patchsets/virtualbox-5.1.30-patches-02.tar.xz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 x86"
+KEYWORDS="amd64 ~x86"
IUSE="X"
-RDEPEND="X? ( x11-apps/xrandr
+RDEPEND="
+ X? ( x11-apps/xrandr
x11-apps/xrefresh
x11-libs/libXmu
x11-libs/libX11
@@ -30,19 +32,22 @@ RDEPEND="X? ( x11-apps/xrandr
x11-proto/glproto )
sys-apps/dbus
~sys-kernel/virtualbox-guest-dkms-${PV}
- !!x11-drivers/xf86-input-virtualbox"
-DEPEND="${RDEPEND}
- >=dev-util/kbuild-0.1.9998_pre20131130
+ !!x11-drivers/xf86-input-virtualbox
+ !x11-drivers/xf86-video-virtualbox
+"
+DEPEND="
+ ${RDEPEND}
+ >=dev-util/kbuild-0.1.9998.3127
>=dev-lang/yasm-0.6.2
sys-devel/bin86
sys-libs/pam
sys-power/iasl
X? ( x11-proto/renderproto )
- !X? ( x11-proto/xproto )"
-PDEPEND="X? ( ~x11-drivers/xf86-video-virtualbox-${PV} )"
-
-BUILD_TARGETS="all"
-BUILD_TARGET_ARCH="${ARCH}"
+ !X? ( x11-proto/xproto )
+"
+PDEPEND="
+ X? ( x11-drivers/xf86-video-vboxvideo )
+"
S="${WORKDIR}/${MY_P}"
@@ -55,9 +60,6 @@ pkg_setup() {
src_unpack() {
unpack ${A}
- "${S}"/src/VBox/Additions/linux/export_modules "${WORKDIR}/vbox-kmod.tar.gz"
- unpack ./vbox-kmod.tar.gz
-
cd "${S}"
rm -rf kBuild/bin tools
}
@@ -79,6 +81,9 @@ src_prepare() {
sed -e '/^check_gcc$/d' -i configure || die
+ rm "${WORKDIR}/patches/011_virtualbox-5.1.30-sysmacros.patch" || die
+ eapply "${WORKDIR}/patches"
+
eapply_user
}
@@ -105,7 +110,8 @@ src_configure() {
src_compile() {
MAKE="kmk" \
emake TOOL_YASM_AS=yasm \
- VBOX_ONLY_ADDITIONS=1
+ VBOX_ONLY_ADDITIONS=1 \
+ KBUILD_VERBOSE=2
}
src_install() {
diff --git a/app-emulation/virtualbox-modules/Manifest b/app-emulation/virtualbox-modules/Manifest
deleted file mode 100644
index f5626a46..00000000
--- a/app-emulation/virtualbox-modules/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST vbox-kernel-module-src-5.1.28.tar.xz 625464 SHA256 d6f3b7afa98d2b526d8da3c8906addc307eea069db371d012ebbffc1ccdf9dd2 SHA512 c8ae6c065ad42e57eee9a54f288ba60fd9b32efe18cb74c8a035d547b30e7d857c9091307485a8dfc77eec45de29d3217c6871140e167e2438759c314c47680a WHIRLPOOL c6508d63cacfcd3ac901f276cd793dc83c595bc73965518baa544b5cf5157ea52363b759f03586f743d6c2e0fda7252b98136c96cef28ecfb31f6915d4ce5709
diff --git a/app-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh b/app-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh
deleted file mode 100755
index 756d2435..00000000
--- a/app-emulation/virtualbox-modules/files/create_vbox_modules_tarball.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-# Create a virtualbox modules tarball from a VirtualBox binary package.
-# We cannot download the package by this script because of the unpredictable
-# build number being in the filename.
-#
-# usage: create_vbox_modules_tarball.sh VirtualBox-4.1.18-78361-Linux_amd64.run
-
-[ -f "$1" ] || exit 1
-
-VBOX_PACKAGE="$1"
-VERSION_SUFFIX=""
-
-if [[ ${VBOX_PACKAGE} = *_BETA* ]] || [[ ${VBOX_PACKAGE} = *_RC* ]] ; then
- VERSION_SUFFIX="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-[[:digit:]\.]\+\(_[[:alpha:]]\+[[:digit:]]\).*@\L\1@')"
-
-fi
-
-VBOX_VER="$(echo ${VBOX_PACKAGE} | sed 's@.*VirtualBox-\([[:digit:]\.]\+\).*@\1@')${VERSION_SUFFIX}"
-
-
-sh ${VBOX_PACKAGE} --noexec --keep --nox11 || exit 2
-cd install || exit 3
-tar -xaf VirtualBox.tar.bz2 || exit 4
-cd src/vboxhost || exit 5
-tar -cvJf ../../../vbox-kernel-module-src-${VBOX_VER}.tar.xz . || exit 6
-cd ../../.. && rm install -rf
-
-exit 0
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-5.1.28-r1710.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-5.2.4.ebuild
index 41d58d9d..d420616a 100644
--- a/app-emulation/virtualbox-modules/virtualbox-modules-5.1.28-r1710.ebuild
+++ b/app-emulation/virtualbox-modules/virtualbox-modules-5.2.4.ebuild
@@ -9,7 +9,7 @@ inherit eutils user
MY_P=vbox-kernel-module-src-${PV}
DESCRIPTION="Kernel Modules for Virtualbox"
HOMEPAGE="http://www.virtualbox.org/"
-SRC_URI="https://dev.gentoo.org/~polynomial-c/virtualbox/${MY_P}.tar.xz"
+SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
diff --git a/app-emulation/virtualbox/Manifest b/app-emulation/virtualbox/Manifest
index a4d028e0..5c90cbae 100644
--- a/app-emulation/virtualbox/Manifest
+++ b/app-emulation/virtualbox/Manifest
@@ -1,2 +1,2 @@
-DIST VirtualBox-5.1.28.tar.bz2 116427658 SHA256 ce7d4bf6535f70e3214abeb4866f7a8634aa3c7b6dedf8825e6ad80bd821398d SHA512 5c21fd535424d7fd9adbb51894ec6d37ecf00a63a850362bd7b61fedca5031e096641814130a97ad839c0bd7089dc3dc465509615aab2af3c5735ff71005670a WHIRLPOOL 2e3fbeb39083c2e69fb23200570781a8845780a6295553af48fa9155db132e37d0fc2fb26e8a45c52864f69f02e8a0d0cbd4c895e5fbb87ab9a51dd60c7c7904
-DIST virtualbox-5.1.18-patches-01.tar.xz 4512 SHA256 1aa525a8230f77abc672e61bea76af9ddfbb8f22acf21ef382b7a0a88de92764 SHA512 f1c88dd9b7fbafb9764df0a88dc5615aa78a01408d0a14c0dae33e3a53bd75c191c0181934848e17f5fd77784f9e01bf44b444f1485fc302cb1538c2e8ddac95 WHIRLPOOL c11adda0297cc18f0ac614a3492c411413bf640090c9cdb4c5382c4da0391734c479d92c2933e46e0dc8ccf59e155ce35e72182abcb5015a7e03ec33d51c1ab0
+DIST VirtualBox-5.2.4.tar.bz2 118481693 SHA256 c9a060bd99168e05587f1ba74b54e9c1f709734bdfc956b0242fe63e81bb7d14 SHA512 19cb168393098fd28ab2017a27d09a558721d57b31c5d3610deb68a17dfa7fd7ffe9ad7be18714a314724ab5ecb54e7ab5fb76183e8e89afbed2da79649e2798 WHIRLPOOL 3000c4e01ccc0fe09734892b8ed7a69b6f836d6dce8993a8b4049be56b73ce1a318843d27dbb174e92fbdfc25ee10e6c081cb2c3193912b7ec577c9fac619cda
+DIST virtualbox-5.2.0-patches-01.tar.xz 2460 SHA256 8487fce158d5f582cb298608bbfff1b6ac0bad531fc27fbc49cf80d201f1165f SHA512 b91278dd81a50e412f5a281c72949f591a1c53303080549b74b28763cab9e3948948afb0256e0453d17736683cca3372a8e9c6d63f02f3eff3ef92c2a1ea332b WHIRLPOOL ba508ce9493723e0f7d43d176e69d459c970ca532d19085be83d1c34d8fac8f30501718d3bd69ca09d453b51cfb5b31d563f238affbfd7551a3f7fd80d1765ba
diff --git a/app-emulation/virtualbox/files/050_virtualbox-5.1.24-nopie.patch b/app-emulation/virtualbox/files/050_virtualbox-5.1.24-nopie.patch
new file mode 100644
index 00000000..73c377a6
--- /dev/null
+++ b/app-emulation/virtualbox/files/050_virtualbox-5.1.24-nopie.patch
@@ -0,0 +1,158 @@
+diff -Naur VirtualBox-5.1.24/Config.kmk VirtualBox-5.1.24/Config.kmk
+--- VirtualBox-5.1.24/Config.kmk 2017-07-26 13:55:27.803972185 -0400
++++ VirtualBox-5.1.24/Config.kmk 2017-07-26 13:53:10.700974328 -0400
+@@ -2601,6 +2601,7 @@
+ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-overlength-strings?= $(call VBOX_GCC_CHECK_CC,-Wno-overlength-strings,)'
+ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-overloaded-virtual?= $(call VBOX_GCC_CHECK_CXX,-Wno-overloaded-virtual,)'
+ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_fno-stack-protector ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)'
++ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_nopie ?= $(call VBOX_GCC_CHECK_CC,-nopie,)'
+ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_fno-dwarf2-cfi-asm ?= $(call VBOX_GCC_CHECK_CC,-fno-dwarf2-cfi-asm,)'
+ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_m64 ?= $(call VBOX_GCC_CHECK_CC,-m64,)'
+ $(QUIET)$(APPEND) '$@' 'VBOX_GCC_no-pie ?= $(call VBOX_GCC_CHECK_CC,-no-pie,)'
+@@ -3843,8 +3844,8 @@
+
+ ifeq ($(VBOX_LDR_FMT32),elf)
+ TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL)
+- TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
+- TEMPLATE_VBoxRc_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK)
++ TEMPLATE_VBoxRc_CXXFLAGS = -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_nopie) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
++ TEMPLATE_VBoxRc_CFLAGS = -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_nopie) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK)
+ ifeq ($(KBUILD_TARGET),solaris)
+ TEMPLATE_VBoxRc_LDFLAGS = -r
+ else
+@@ -3864,8 +3865,8 @@
+ ifeq ($(VBOX_LDR_FMT32),macho)
+ TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC_TOOL)
+ TEMPLATE_VBoxRc_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS)
+- TEMPLATE_VBoxRc_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -m32 -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-common -msoft-float -static $(VBOX_GCC_fno-stack-protector) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing -fno-rtti
+- TEMPLATE_VBoxRc_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -m32 -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-common -msoft-float -static $(VBOX_GCC_fno-stack-protector) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
++ TEMPLATE_VBoxRc_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -m32 -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-common -msoft-float -static $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing -fno-rtti
++ TEMPLATE_VBoxRc_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -m32 -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-common -msoft-float -static $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
+ TEMPLATE_VBoxRc_LDFLAGS = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -m32 -nostdlib
+ #TEMPLATE_VBoxRc_LDFLAGS.release = -Wl,-S ???
+ endif
+@@ -3903,9 +3904,9 @@
+ endif
+
+ ifeq ($(VBOX_LDR_FMT32),elf)
+- TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS)) -O0
+- TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS)) -O0
+- TEMPLATE_VBoxRcExe_LDFLAGS = -g
++ TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS)) -O0 $(VBOX_GCC_nopie)
++ TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS)) -O0 $(VBOX_GCC_nopie)
++ TEMPLATE_VBoxRcExe_LDFLAGS = -g $(VBOX_GCC_nopie)
+ TEMPLATE_VBoxRcExe_LDFLAGS.dbgopt = -g
+ TEMPLATE_VBoxRcExe_LDFLAGS.strict = -g
+ TEMPLATE_VBoxRcExe_LDFLAGS.release = -g
+@@ -3984,8 +3985,8 @@
+
+ ifeq ($(VBOX_LDR_FMT),elf)
+ TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL)
+-TEMPLATE_VBoxR0_CFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
+-TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
++TEMPLATE_VBoxR0_CFLAGS = -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) $(VBOX_GCC_nopie) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
++TEMPLATE_VBoxR0_CXXFLAGS = -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) $(VBOX_GCC_nopie) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
+ TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
+ TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
+ ifeq ($(KBUILD_TARGET),solaris)
+@@ -4018,12 +4019,12 @@
+ TEMPLATE_VBoxR0_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS)
+ TEMPLATE_VBoxR0_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) \
+ -fno-common -msoft-float -static -fno-rtti -fno-exceptions $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing \
+- -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
++ -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie)
+ TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -fno-unwind-tables
+ TEMPLATE_VBoxR0_CXXFLAGS.x86 = -m32
+ TEMPLATE_VBoxR0_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) \
+ -fno-common -msoft-float -static -fno-exceptions $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing \
+- -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
++ -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie)
+ TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -fno-unwind-tables
+ TEMPLATE_VBoxR0_CFLAGS.x86 = -m32
+ TEMPLATE_VBoxR0_LDFLAGS = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -nostdlib
+@@ -4259,7 +4260,7 @@
+ -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \
+ -Wimplicit-function-declaration -Werror-implicit-function-declaration \
+ -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
+- $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
++ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
+ -nostdinc -std=c99
+ TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
+ TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \
+@@ -4268,7 +4269,7 @@
+ TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \
+ $(VBOX_GCC_WARN) -Wpointer-arith -Winline \
+ -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \
+- $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
++ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
+ -nostdinc
+ TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86)
+ TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64)
+@@ -4341,7 +4342,7 @@
+ -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \
+ -Wimplicit-function-declaration -Werror-implicit-function-declaration \
+ -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
+- $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
++ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
+ -nostdinc -std=c99 -msoft-float
+ TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 \
+ -mpreferred-stack-boundary=2 -mno-mmx -mno-sse -mno-avx \
+@@ -4353,7 +4354,7 @@
+ TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \
+ $(VBOX_GCC_WARN) -Wpointer-arith -Winline \
+ -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \
+- $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
++ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
+ -nostdinc -msoft-float
+ TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86)
+ TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64)
+@@ -4394,7 +4395,7 @@
+ TEMPLATE_VBOXR0DRV_LDFLAGS = -shared -no-undefined -dc -dy -lroot -rpath-link /boot/system/develop/lib/x86 --no-add-needed /boot/system/develop/lib/_KERNEL_ --no-add-needed /boot/system/develop/lib/haiku_version_glue.o
+ TEMPLATE_VBOXR0DRV_CFLAGS = -fno-PIC \
+ $(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare \
+- $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
++ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
+ TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
+ TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
+ TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
+@@ -5210,8 +5211,8 @@
+ TEMPLATE_VBoxNoCrtGccLib_TOOL = $(VBOX_GCC_TOOL)
+ TEMPLATE_VBoxNoCrtGccLib_ASTOOL = $(VBOX_ASTOOL)
+ TEMPLATE_VBoxNoCrtGccLib_ASFLAGS = $(VBOX_ASFLAGS)
+- TEMPLATE_VBoxNoCrtGccLib_CFLAGS += $(VBOX_GCC_fno-stack-protector)
+- TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS += $(VBOX_GCC_fno-stack-protector)
++ TEMPLATE_VBoxNoCrtGccLib_CFLAGS += $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie)
++ TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS += $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie)
+ ifeq ($(KBUILD_TARGET_ARCH),amd64)
+ # in 64-bit mode we'll build a sys-module (VBoxREM2).
+ if1of ($(KBUILD_TARGET), darwin solaris)
+@@ -6467,8 +6468,8 @@
+ TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fno-pie -fno-merge-constants -std=c99 -ffreestanding
+ TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-pie -fno-merge-constants -ffreestanding
+ ifndef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE
+- TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS += $(VBOX_GCC_fno-stack-protector)
+- TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS += $(VBOX_GCC_fno-stack-protector)
++ TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS += $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie)
++ TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS += $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_nopie)
+ endif
+ TEMPLATE_VBOXGUESTR3XF86MOD_SYSSUFF = .o
+ TEMPLATE_VBOXGUESTR3XF86MOD_LIBS = \
+diff -Naur VirtualBox-5.1.24/src/VBox/Devices/PC/ipxe/Makefile.kmk VirtualBox-5.1.24/src/VBox/Devices/PC/ipxe/Makefile.kmk
+--- VirtualBox-5.1.24/src/VBox/Devices/PC/ipxe/Makefile.kmk 2017-07-26 13:55:27.746972186 -0400
++++ VirtualBox-5.1.24/src/VBox/Devices/PC/ipxe/Makefile.kmk 2017-07-26 13:53:10.641974329 -0400
+@@ -132,6 +132,7 @@
+ -W \
+ -Wformat-nonliteral \
+ $(VBOX_GCC_fno-stack-protector) \
++ $(VBOX_GCC_nopie) \
+ $(VBOX_GCC_fno-dwarf2-cfi-asm) \
+ $(VBOX_GCC_Wno-address)
+ TEMPLATE_iPxe_ASFLAGS = \
+@@ -155,6 +156,7 @@
+ -W \
+ -Wformat-nonliteral \
+ $(VBOX_GCC_fno-stack-protector) \
++ $(VBOX_GCC_nopie) \
+ $(VBOX_GCC_fno-dwarf2-cfi-asm) \
+ $(VBOX_GCC_Wno-address) \
+ -DASSEMBLY
diff --git a/app-emulation/virtualbox/files/vboxwebsrv-confd b/app-emulation/virtualbox/files/vboxwebsrv-confd
index 447348e9..fdcd17e9 100644
--- a/app-emulation/virtualbox/files/vboxwebsrv-confd
+++ b/app-emulation/virtualbox/files/vboxwebsrv-confd
@@ -1,6 +1,5 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id$
# The host to bind to (defaults to "localhost").
VBOXWEBSRV_HOST="localhost"
diff --git a/app-emulation/virtualbox/files/vboxwebsrv-initd b/app-emulation/virtualbox/files/vboxwebsrv-initd
index d9544962..f50c3ec0 100644
--- a/app-emulation/virtualbox/files/vboxwebsrv-initd
+++ b/app-emulation/virtualbox/files/vboxwebsrv-initd
@@ -1,7 +1,6 @@
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id$
depend() {
need net
diff --git a/app-emulation/virtualbox/files/virtualbox-4-localconfig b/app-emulation/virtualbox/files/virtualbox-4-localconfig
deleted file mode 100644
index 5138d925..00000000
--- a/app-emulation/virtualbox/files/virtualbox-4-localconfig
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- Makefile -*-
-#
-# Overwrite some default kBuild settings
-#
-
-#
-# Copyright (C) 2006-2008 Sun Microsystems, Inc.
-#
-# This file is part of VirtualBox Open Source Edition (OSE), as
-# available from http://www.virtualbox.org. This file is free software;
-# you can redistribute it and/or modify it under the terms of the GNU
-# General Public License as published by the Free Software Foundation,
-# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
-# distribution. VirtualBox OSE is distributed in the hope that it will
-# be useful, but WITHOUT ANY WARRANTY of any kind.
-#
-
-# shut up wine complaining about unknown locale
-EXEC_X86_WIN32 := wine
-
-# don't build testcases to save time, they are not needed for the package
-VBOX_WITH_TESTCASES :=
-VBOX_WITH_TESTSUITE :=
-VBOX_DOCBOOK_WITH_LATEX := 1
-
-KBUILD_MSG_STYLE := brief
-
-## paths, origin, hardening
-VBOX_WITH_HARDENING := 1
-VBOX_WITH_ORIGIN :=
-VBOX_PATH_APP_PRIVATE_ARCH := /usr/MY_LIBDIR/virtualbox
-VBOX_PATH_SHARED_LIBS := $(VBOX_PATH_APP_PRIVATE_ARCH)
-VBOX_WITH_RUNPATH := $(VBOX_PATH_APP_PRIVATE_ARCH)
-VBOX_PATH_APP_PRIVATE := /usr/share/virtualbox
-VBOX_PATH_APP_DOCS = $(VBOX_PATH_PACKAGE_DOCS)
-
-## don't build unwanted/splitted stuff
-VBOX_WITHOUT_ADDITIONS := 1
-VBOX_WITH_VBOXDRV :=
-VBOX_WITH_VBOXBFE :=
-VBOX_WITH_KCHMVIEWER :=
-
-## don't build with -Werror
-VBOX_WITH_WARNINGS_AS_ERRORS :=
-
diff --git a/app-emulation/virtualbox/files/virtualbox-5.1.22-opengl_dlopen_fix.patch b/app-emulation/virtualbox/files/virtualbox-5.1.22-opengl_dlopen_fix.patch
deleted file mode 100644
index 71fa978c..00000000
--- a/app-emulation/virtualbox/files/virtualbox-5.1.22-opengl_dlopen_fix.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-Index: VirtualBox-5.1.22/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp
-===================================================================
---- VirtualBox-5.1.22/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp (revision 115126)
-+++ VirtualBox-5.1.22/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp (revision 115307)
-@@ -341,6 +341,7 @@
- * Patch 64-bit hosts.
- */
- uint32_t cRipRelMovs = 0;
-+ uint32_t cRelCalls = 0;
-
- /* Just use the disassembler to skip 12 bytes or more, we might need to
- rewrite mov instructions using RIP relative addressing. */
-@@ -349,7 +350,8 @@
- cbInstr = 1;
- int rc = DISInstr(pbTarget + offJmpBack, DISCPUMODE_64BIT, &Dis, &cbInstr);
- if ( RT_FAILURE(rc)
-- || (Dis.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW)
-+ || ( Dis.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW
-+ && Dis.pCurInstr->uOpcode != OP_CALL)
- || ( Dis.ModRM.Bits.Mod == 0
- && Dis.ModRM.Bits.Rm == 5 /* wrt RIP */
- && Dis.pCurInstr->uOpcode != OP_MOV))
-@@ -357,15 +359,23 @@
-
- if (Dis.ModRM.Bits.Mod == 0 && Dis.ModRM.Bits.Rm == 5 /* wrt RIP */)
- cRipRelMovs++;
-+ if ( Dis.pCurInstr->uOpcode == OP_CALL
-+ && (Dis.pCurInstr->fOpType & DISOPTYPE_RELATIVE_CONTROLFLOW))
-+ cRelCalls++;
-
- offJmpBack += cbInstr;
- cbPatchMem += cbInstr;
- }
-
-+ /*
-+ * Each relative call requires extra bytes as it is converted to a pushq imm32
-+ * + mov [RSP+4], imm32 + a jmp qword [$+8 wrt RIP] to avoid clobbering registers.
-+ */
-+ cbPatchMem += cRelCalls * RT_ALIGN_32(13 + 6 + 8, 8);
- cbPatchMem += 14; /* jmp qword [$+8 wrt RIP] + 8 byte address to jump to. */
- cbPatchMem = RT_ALIGN_32(cbPatchMem, 8);
-
-- /* Allocate suitable exectuable memory available. */
-+ /* Allocate suitable executable memory available. */
- bool fConvRipRelMovs = false;
- uint8_t *pbPatchMem = supR3HardenedMainPosixExecMemAlloc(cbPatchMem, pbTarget, cRipRelMovs > 0);
- if (!pbPatchMem)
-@@ -396,7 +406,8 @@
- cbInstr = 1;
- int rc = DISInstr(pbTarget + offInsn, DISCPUMODE_64BIT, &Dis, &cbInstr);
- if ( RT_FAILURE(rc)
-- || (Dis.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW))
-+ || ( Dis.pCurInstr->fOpType & DISOPTYPE_CONTROLFLOW
-+ && Dis.pCurInstr->uOpcode != OP_CALL))
- return VERR_SUPLIB_UNEXPECTED_INSTRUCTION;
-
- if ( Dis.ModRM.Bits.Mod == 0
-@@ -439,6 +450,34 @@
- pbPatchMem += sizeof(int32_t);
- }
- }
-+ else if ( Dis.pCurInstr->uOpcode == OP_CALL
-+ && (Dis.pCurInstr->fOpType & DISOPTYPE_RELATIVE_CONTROLFLOW))
-+ {
-+ /* Convert to absolute jump. */
-+ uintptr_t uAddr = (uintptr_t)&pbTarget[offInsn + cbInstr] + (intptr_t)Dis.Param1.uValue;
-+
-+ /* Skip the push instructions till the return address is known. */
-+ uint8_t *pbPatchMemPush = pbPatchMem;
-+ pbPatchMem += 13;
-+
-+ *pbPatchMem++ = 0xff; /* jmp qword [$+8 wrt RIP] */
-+ *pbPatchMem++ = 0x25;
-+ *(uint32_t *)pbPatchMem = (uint32_t)(RT_ALIGN_PT(pbPatchMem + 4, 8, uint8_t *) - (pbPatchMem + 4));
-+ pbPatchMem = RT_ALIGN_PT(pbPatchMem + 4, 8, uint8_t *);
-+ *(uint64_t *)pbPatchMem = uAddr;
-+ pbPatchMem += sizeof(uint64_t);
-+
-+ /* Push the return address onto stack. Difficult on amd64 without clobbering registers... */
-+ uintptr_t uAddrReturn = (uintptr_t)pbPatchMem;
-+ *pbPatchMemPush++ = 0x68; /* push imm32 sign-extended as 64-bit*/
-+ *(uint32_t *)pbPatchMemPush = RT_LO_U32(uAddrReturn);
-+ pbPatchMemPush += sizeof(uint32_t);
-+ *pbPatchMemPush++ = 0xc7;
-+ *pbPatchMemPush++ = 0x44;
-+ *pbPatchMemPush++ = 0x24;
-+ *pbPatchMemPush++ = 0x04; /* movl [RSP+4], imm32 */
-+ *(uint32_t *)pbPatchMemPush = RT_HI_U32(uAddrReturn);
-+ }
- else
- {
- memcpy(pbPatchMem, pbTarget + offInsn, cbInstr);
-Index: VirtualBox-5.1.22/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
-===================================================================
---- VirtualBox-5.1.22/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp (revision 115126)
-+++ VirtualBox-5.1.22/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp (revision 115307)
-@@ -86,6 +86,9 @@
- /** The max path length acceptable for a trusted path. */
- #define SUPR3HARDENED_MAX_PATH 260U
-
-+/** Enable to resolve symlinks using realpath() instead of cooking our own stuff. */
-+#define SUP_HARDENED_VERIFY_FOLLOW_SYMLINKS_USE_REALPATH 1
-+
- #ifdef RT_OS_SOLARIS
- # define dirfd(d) ((d)->d_fd)
- #endif
-@@ -1091,7 +1094,8 @@
- #endif
-
-
--#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)
-+#ifndef SUP_HARDENED_VERIFY_FOLLOW_SYMLINKS_USE_REALPATH
-+# if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)
- /**
- * Copies the error message to the error buffer and returns @a rc.
- *
-@@ -1104,6 +1108,7 @@
- {
- return supR3HardenedSetErrorN(rc, pErrInfo, 1, pszMsg);
- }
-+# endif
- #endif
-
-
-@@ -1893,7 +1898,9 @@
- /*
- * Verify each component from the root up.
- */
-+#ifndef SUP_HARDENED_VERIFY_FOLLOW_SYMLINKS_USE_REALPATH
- uint32_t iLoops = 0;
-+#endif
- SUPR3HARDENEDFSOBJSTATE FsObjState;
- uint32_t iComponent = 0;
- while (iComponent < Info.cComponents)
-@@ -1915,6 +1922,24 @@
- if ( RT_SUCCESS(rc)
- && S_ISLNK(FsObjState.Stat.st_mode))
- {
-+#if SUP_HARDENED_VERIFY_FOLLOW_SYMLINKS_USE_REALPATH /* Another approach using realpath() and verifying the result when encountering a symlink. */
-+ char *pszFilenameResolved = realpath(pszFilename, NULL);
-+ if (pszFilenameResolved)
-+ {
-+ rc = supR3HardenedVerifyFile(pszFilenameResolved, hNativeFile, fMaybe3rdParty, pErrInfo);
-+ free(pszFilenameResolved);
-+ return rc;
-+ }
-+ else
-+ {
-+ int iErr = errno;
-+ supR3HardenedError(VERR_ACCESS_DENIED, false /*fFatal*/,
-+ "supR3HardenedVerifyFileFollowSymlinks: Failed to resolve the real path '%s': %s (%d)\n",
-+ pszFilename, strerror(iErr), iErr);
-+ return supR3HardenedSetError4(VERR_ACCESS_DENIED, pErrInfo,
-+ "realpath failed for '", pszFilename, "': ", strerror(iErr));
-+ }
-+#else
- /* Don't loop forever. */
- iLoops++;
- if (iLoops < 8)
-@@ -1989,6 +2014,7 @@
- else
- return supR3HardenedSetError3(VERR_TOO_MANY_SYMLINKS, pErrInfo,
- "Too many symbolic links: '", pszFilename, "'");
-+#endif
- }
- }
- if (RT_FAILURE(rc))
diff --git a/app-emulation/virtualbox/files/virtualbox-5.1.4-paxmark-bldprogs.patch b/app-emulation/virtualbox/files/virtualbox-5.1.4-paxmark-bldprogs.patch
new file mode 100644
index 00000000..50fa306d
--- /dev/null
+++ b/app-emulation/virtualbox/files/virtualbox-5.1.4-paxmark-bldprogs.patch
@@ -0,0 +1,59 @@
+2017-02-20 Quentin Minster <quentin@minster.io>
+
+ #https://bugs.gentoo.org/show_bug.cgi?id=591582
+ * Config.kmk: add paxmark befor VBOX_VBOXTPG get run.
+ * src/VBox/VMM/Makefile.kmk: add paxmark befor VBOX_VBOXCPP get run.
+ * src/VBox/Main/Makefile.kmk: add paxmark befor USBIdDatabaseGenerator_1_TARGET get run.
+
+--- a/Config.kmk
++++ b/Config.kmk 2016-09-21 02:22:28
+@@ -3719,11 +3719,13 @@
+ $(if-expr $(intersects $(KBUILD_TARGET_ARCH),$(KBUILD_ARCHES_64)),-64,-32) \
+ -h --host-$(VBOX_HC_ARCH_BITS)-bit #-vvv
+ define TOOL_VBoxTpG_DTRACE_HDR_CMDS
++ $(QUIET)paxmark.sh -m "$(VBOX_VBOXTPG)"
+ $(QUIET)$(VBOX_VBOXTPG) $(flags) -o "$(out)" -s "$(source)"
+ endef
+ TOOL_VBoxTpG_DTRACE_OBJ_NOT_NEEDED :=
+ TOOL_VBoxTpG_DTRACE_OBJ_FLAGS := -G --host-$(VBOX_HC_ARCH_BITS)-bit #-vvv
+ define TOOL_VBoxTpG_DTRACE_OBJ_CMDS
++ $(QUIET)paxmark.sh -m "$(VBOX_VBOXTPG)"
+ $(QUIET)$(VBOX_VBOXTPG) \
+ $(if-expr $(intersects $(bld_trg_arch),$(KBUILD_ARCHES_64)),-64,-32) \
+ $(flags) \
+@@ -3738,6 +3740,7 @@
+ TOOL_VBoxTpG-Disabled_DTRACE_DEPORD = $(VBOX_VBOXTPG)
+ TOOL_VBoxTpG-Disabled_DTRACE_HDR_FLAGS := -h
+ define TOOL_VBoxTpG-Disabled_DTRACE_HDR_CMDS
++ $(QUIET)paxmark.sh -m "$(VBOX_VBOXTPG)"
+ $(QUIET)$(VBOX_VBOXTPG) $(flags) -o "$(out)" -s "$(source)"
+ endef
+ TOOL_VBoxTpG-Disabled_DTRACE_OBJ_NOT_NEEDED := $(KBUILD_OSES)
+@@ -3752,6 +3755,7 @@
+ TOOL_DTraceAndVBoxTpG_DTRACE_HDR_CMDS =
+ define TOOL_DTraceAndVBoxTpG_DTRACE_HDR_CMDS
+ $(TOOL_StandardDTrace_DTRACE_HDR_CMDS)
++ $(QUIET)paxmark.sh -m "$(VBOX_VBOXTPG)"
+ $(QUIET)$(VBOX_VBOXTPG) --generate-wrapper-header --host-$(VBOX_HC_ARCH_BITS)-bit --ring-3-context \
+ $(filter-out -C, $(filter-out -h,$(flags))) \
+ -o "$(out).tmp" -s "$(source)"
+--- a/src/VBox/VMM/Makefile.kmk
++++ b/src/VBox/VMM/Makefile.kmk 2016-09-21 02:26:11
+@@ -795,6 +795,7 @@
+ define def_vmm_lib_dtrace_preprocess
+ $$$$(VMMLibDTrace_0_OUTDIR)/$1: $2 $$(VBOX_VBOXCPP) | $$$$(dir $$$$@)
+ $$(QUIET)$$(call MSG_GENERATE,VMMLibDTrace,$$@,$$<)
++ $$(QUIET)paxmark.sh -m "$(VBOX_VBOXCPP)"
+ $$(QUIET)$(VBOX_VBOXCPP) -d \
+ -D VBOX_FOR_DTRACE_LIB \
+ -D VBOX_FOR_DTRACE_LIB_$(toupper $(KBUILD_TARGET_ARCH)) \
+--- a/src/VBox/Main/Makefile.kmk
++++ b/src/VBox/Main/Makefile.kmk 2016-09-21 02:31:23
+@@ -522,6 +522,7 @@
+ $$(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp: $$(USBIdDatabaseGenerator_1_TARGET) \
+ $(PATH_SUB_CURRENT)/src-server/usb.ids $(PATH_SUB_CURRENT)/src-server/custom.ids | $$(dir $$@)
+ $(call MSG_GENERATE,USBIdDatabase,$@,$<)
++ $(QUIET)paxmark.sh -m "$(USBIdDatabaseGenerator_1_TARGET)"
+ $(QUIET)$(USBIdDatabaseGenerator_1_TARGET) -o "$@" $(filter %.ids,$^)
+
+ BLDPROGS += USBIdDatabaseGenerator
diff --git a/app-emulation/virtualbox/files/virtualbox-ose-3-config b/app-emulation/virtualbox/files/virtualbox-ose-3-config
deleted file mode 100644
index af782214..00000000
--- a/app-emulation/virtualbox/files/virtualbox-ose-3-config
+++ /dev/null
@@ -1 +0,0 @@
-INSTALL_DIR=/usr/MY_LIBDIR/virtualbox
diff --git a/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper b/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper
deleted file mode 100644
index 6f2da490..00000000
--- a/app-emulation/virtualbox/files/virtualbox-ose-3-wrapper
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/sh
-#
-# Sun VirtualBox
-#
-# Copyright (C) 2006-2009 Sun Microsystems, Inc.
-#
-# This file is part of VirtualBox Open Source Edition (OSE), as
-# available from http://www.virtualbox.org. This file is free software;
-# you can redistribute it and/or modify it under the terms of the GNU
-# General Public License (GPL) as published by the Free Software
-# Foundation, in version 2 as it comes in the "COPYING" file of the
-# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-#
-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
-# Clara, CA 95054 USA or visit http://www.sun.com if you need
-# additional information or have any questions.
-#
-
-PATH="/usr/bin:/bin:/usr/sbin:/sbin"
-CONFIG="/etc/vbox/vbox.cfg"
-
-if [ ! -r "$CONFIG" ]; then
- echo "Could not find VirtualBox installation. Please reinstall."
- exit 1
-fi
-
-. "$CONFIG"
-
-# Note: This script must not fail if the module was not successfully installed
-# because the user might not want to run a VM but only change VM params!
-
-if [ "$1" = "shutdown" ]; then
- SHUTDOWN="true"
-elif ! lsmod|grep -q vboxdrv; then
- cat << EOF
-WARNING: The VirtualBox kernel modules are not loaded.
- Please load all the needed kernel modules by:
-
- for m in vbox{drv,netadp,netflt}; do modprobe \$m; done
-
- You will not be able to start VMs until this problem is fixed.
-EOF
-elif [ ! -c /dev/vboxdrv ]; then
- cat << EOF
-WARNING: The character device /dev/vboxdrv does not exist.
- Please try to reload all the needed kernel modules by:
-
- for m in vbox{netflt,netadp,drv}; do rmmod \$m; done
- for m in vbox{drv,netadp,netflt}; do modprobe \$m; done
-
- and if that is not successful, try to re-install the package by:
-
- emerge -1av app-emulation/virtualbox-modules
-
- You will not be able to start VMs until this problem is fixed.
-EOF
-fi
-
-SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'`
-if [ -z "$SERVER_PID" ]; then
- # Server not running yet/anymore, cleanup socket path.
- # See IPC_GetDefaultSocketPath()!
- if [ -n "$LOGNAME" ]; then
- rm -rf /tmp/.vbox-$LOGNAME-ipc > /dev/null 2>&1
- else
- rm -rf /tmp/.vbox-$USER-ipc > /dev/null 2>&1
- fi
-fi
-
-if [ "$SHUTDOWN" = "true" ]; then
- if [ -n "$SERVER_PID" ]; then
- kill -TERM $SERVER_PID
- sleep 2
- fi
- exit 0
-fi
-
-APP=`which $0`
-APP=`basename $APP`
-APP=${APP##/*/}
-case "$APP" in
- VirtualBox)
- exec "$INSTALL_DIR/VirtualBox" "$@"
- ;;
- VBoxManage)
- exec "$INSTALL_DIR/VBoxManage" "$@"
- ;;
- VBoxSDL)
- exec "$INSTALL_DIR/VBoxSDL" "$@"
- ;;
- VBoxVRDP)
- exec "$INSTALL_DIR/VBoxHeadless" "$@"
- ;;
- VBoxHeadless)
- exec "$INSTALL_DIR/VBoxHeadless" "$@"
- ;;
- vboxwebsrv)
- exec "$INSTALL_DIR/vboxwebsrv" "$@"
- ;;
- *)
- echo "Unknown application - $APP"
- ;;
-esac
diff --git a/app-emulation/virtualbox/virtualbox-5.1.28-r1710.ebuild b/app-emulation/virtualbox/virtualbox-5.2.4.ebuild
index 35574cec..d64c9f56 100644
--- a/app-emulation/virtualbox/virtualbox-5.1.28-r1710.ebuild
+++ b/app-emulation/virtualbox/virtualbox-5.2.4.ebuild
@@ -4,13 +4,13 @@
EAPI=6
PYTHON_COMPAT=( python2_7 )
-inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 toolchain-funcs udev
+inherit eutils flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 toolchain-funcs udev xdg-utils
MY_PV="${PV/beta/BETA}"
MY_PV="${MY_PV/rc/RC}"
MY_P=VirtualBox-${MY_PV}
SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
- https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.1.18-patches-01.tar.xz"
+ https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.2.0-patches-01.tar.xz"
S="${WORKDIR}/${MY_P}"
DESCRIPTION="Family of powerful x86 virtualization products for enterprise and home use"
@@ -18,7 +18,7 @@ HOMEPAGE="http://www.virtualbox.org/"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="amd64 x86"
+KEYWORDS="amd64 ~x86"
IUSE="alsa debug doc headless java libressl lvm pam pax_kernel pulseaudio +opengl python +qt5 +sdk +udev vboxwebsrv vnc"
RDEPEND="!app-emulation/virtualbox-bin
@@ -55,7 +55,7 @@ RDEPEND="!app-emulation/virtualbox-bin
udev? ( >=virtual/udev-171 )
vnc? ( >=net-libs/libvncserver-0.9.9 )"
DEPEND="${RDEPEND}
- >=dev-util/kbuild-0.1.9998_pre20131130-r1
+ >=dev-util/kbuild-0.1.9998.3127
>=dev-lang/yasm-0.6.2
sys-devel/bin86
sys-libs/libcap
@@ -182,13 +182,13 @@ src_prepare() {
fi
# Only add nopie patch when we're on hardened
- if ! gcc-specs-pie ; then
- rm "${WORKDIR}"/patches/050_${PN}-*-nopie.patch || die
+ if gcc-specs-pie ; then
+ eapply "${FILESDIR}/050_virtualbox-5.1.24-nopie.patch"
fi
# Only add paxmark patch when we're on pax_kernel
if use pax_kernel ; then
- epatch "${FILESDIR}"/virtualbox-5.1.4-paxmark-bldprogs.patch || die
+ eapply "${FILESDIR}"/virtualbox-5.1.4-paxmark-bldprogs.patch
fi
eapply "${WORKDIR}/patches"
@@ -410,7 +410,7 @@ src_install() {
}
pkg_postinst() {
- fdo-mime_desktop_database_update
+ xdg_desktop_database_update
if use udev ; then
udevadm control --reload-rules \
@@ -455,5 +455,5 @@ pkg_postinst() {
}
pkg_postrm() {
- fdo-mime_desktop_database_update
+ xdg_desktop_database_update
}