From 1feafdfaa698293d4a2f3d20d706f62ac3be0e42 Mon Sep 17 00:00:00 2001 From: Bernhard Froehlich Date: Thu, 3 Jan 2013 13:40:28 +0000 Subject: - Update to 4.2.6 - Remove custom FreeBSD compiler flags that are only supported by our old base GCC 4.2 [1] - Fix building with ports GCC 4.6 [1] - Fix build on 10-CURRENT after removal of vm_page_lock_queues() in r242941 [2] - Improve waits for periods shorter than a single tick [1] - Fix dependency check when building with custom KMODDIR [3] - Fix recording with OSS Audio backend to record at a proper volume [4] - Initialize host-only interfaces at boot time so that other scripts and daemons can properly use them [2] - Fix build if $ENV not ash-compatible [5] - Fix ich9 bios to correctly configure pci bridge1 and pci bridge2 [6] - Add VLAN trunking support to vboxnetflt [7] PR: ports/171730 [1], ports/167521 [5] Submitted by: Andriy Gapon [1] Submitted by: Ed Maste [2] Submitted by: Kurt Jaeger [5] Submitted by: Gustau Perez i Querol [6] Submitted by: Landon J Fuller [7] Reported by: Daniel Braniss [3] Obtained from: https://www.virtualbox.org/ticket/10695 [4] See: http://article.gmane.org/gmane.os.freebsd.devel.emulation/10438 [6] --- emulators/virtualbox-ose-additions/Makefile | 16 ++--- emulators/virtualbox-ose-additions/distinfo | 4 +- .../files/extrapatch-include-iprt-string.h | 10 --- .../files/patch-include-iprt-types.h | 19 ------ ...h-src-VBox-Additions-x11-vboxvideo-Makefile.kmk | 20 ++++++ ...-Additions-x11-x11include-1.3-xorg-xf86_ansic.h | 10 --- ...-Additions-x11-x11include-1.4-xorg-xf86_ansic.h | 10 --- ...-Additions-x11-x11include-7.0-xorg-xf86_ansic.h | 10 --- ...-Additions-x11-x11include-7.1-xorg-xf86_ansic.h | 10 --- ...ox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c | 77 +++++++++++++++------- ...VBox-Runtime-r0drv-freebsd-the-freebsd-kernel.h | 10 +++ 11 files changed, 90 insertions(+), 106 deletions(-) delete mode 100644 emulators/virtualbox-ose-additions/files/extrapatch-include-iprt-string.h delete mode 100644 emulators/virtualbox-ose-additions/files/patch-include-iprt-types.h create mode 100644 emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk delete mode 100644 emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.3-xorg-xf86_ansic.h delete mode 100644 emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.4-xorg-xf86_ansic.h delete mode 100644 emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.0-xorg-xf86_ansic.h delete mode 100644 emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.1-xorg-xf86_ansic.h create mode 100644 emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-the-freebsd-kernel.h (limited to 'emulators/virtualbox-ose-additions') diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile index 1ae783065758..88038a45665b 100644 --- a/emulators/virtualbox-ose-additions/Makefile +++ b/emulators/virtualbox-ose-additions/Makefile @@ -1,12 +1,8 @@ -# New ports collection makefile for: virtualbox-ose-additions -# Date created: 2009-09-21 -# Whom: Bernhard Froehlich -# +# Created by: Bernhard Froehlich # $FreeBSD$ -# PORTNAME= virtualbox-ose -DISTVERSION= 4.1.22 +DISTVERSION= 4.2.6 CATEGORIES= emulators kld MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \ http://tmp.chruetertee.ch/ \ @@ -22,12 +18,13 @@ LICENSE_FILE= ${WRKSRC}/COPYING BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm \ as86:${PORTSDIR}/devel/dev86 \ - kmk:${PORTSDIR}/devel/kBuild-devel + kmk:${PORTSDIR}/devel/kBuild UNIQUENAME= ${PORTNAME}${PKGNAMESUFFIX} WRKSRC= ${WRKDIR}/VirtualBox-${PORTVERSION} USE_RC_SUBR= vboxguest vboxservice ONLY_FOR_ARCHS= i386 amd64 +FETCH_ARGS= -pRr USE_BZIP2= yes MAKE_JOBS_UNSAFE= yes @@ -38,7 +35,6 @@ CONFIGURE_ARGS+=--with-gcc="${CC}" --with-g++="${CXX}" --nofatal \ --build-headless CONFLICTS= bcc-[0-9]* -CONFLICTS_BUILD= kBuild-[0-9]* CONFLICTS_INSTALL= virtualbox-ose-additions-devel-[3,4]* virtualbox-ose-[3,4]* virtualbox-ose-devel-[3,4]* virtualbox-ose-legacy-[3,4]* OPTIONS_DEFINE= DEBUG X11 OPENGL @@ -93,10 +89,6 @@ IGNORE= requires kernel sources .include -.if ${OSVERSION} > 900012 -EXTRA_PATCHES= ${FILESDIR}/extrapatch-include-iprt-string.h -.endif - pre-everything:: .if ${ARCH} == "amd64" .if !exists(/usr/lib32/libc.so) diff --git a/emulators/virtualbox-ose-additions/distinfo b/emulators/virtualbox-ose-additions/distinfo index 29da8afb570c..943900923e07 100644 --- a/emulators/virtualbox-ose-additions/distinfo +++ b/emulators/virtualbox-ose-additions/distinfo @@ -1,2 +1,2 @@ -SHA256 (VirtualBox-4.1.22.tar.bz2) = 7abb506203dd0d69b4b408fd999b5b9a479a9adce5f80e9b5569641c053dd153 -SIZE (VirtualBox-4.1.22.tar.bz2) = 73385514 +SHA256 (VirtualBox-4.2.6.tar.bz2) = 54526091bc2aa66b88ca878dd9ecc4466f96d607db2f6678a9d673ecf6646ae3 +SIZE (VirtualBox-4.2.6.tar.bz2) = 76291326 diff --git a/emulators/virtualbox-ose-additions/files/extrapatch-include-iprt-string.h b/emulators/virtualbox-ose-additions/files/extrapatch-include-iprt-string.h deleted file mode 100644 index c22eebe25952..000000000000 --- a/emulators/virtualbox-ose-additions/files/extrapatch-include-iprt-string.h +++ /dev/null @@ -1,10 +0,0 @@ ---- include/iprt/string.h.orig 2010-04-28 01:02:16.000000000 +0200 -+++ include/iprt/string.h 2010-06-17 16:20:14.000000000 +0200 -@@ -60,7 +60,6 @@ - #if (defined(RT_OS_DARWIN) && defined(KERNEL)) \ - || (defined(RT_OS_FREEBSD) && defined(_KERNEL)) - RT_C_DECLS_BEGIN --void *memchr(const void *pv, int ch, size_t cb); - char *strpbrk(const char *pszStr, const char *pszChars); - RT_C_DECLS_END - #endif diff --git a/emulators/virtualbox-ose-additions/files/patch-include-iprt-types.h b/emulators/virtualbox-ose-additions/files/patch-include-iprt-types.h deleted file mode 100644 index afa28bbb1461..000000000000 --- a/emulators/virtualbox-ose-additions/files/patch-include-iprt-types.h +++ /dev/null @@ -1,19 +0,0 @@ -- Fix build failure on FreeBSD 10-CURRENT after r228444 - -include/iprt/types.h:174: error: redefinition of typedef 'bool' -@/sys/types.h:271: error: previous declaration of 'bool' was here - -Submitted by: Daichi GOTO ---- include/iprt/types.h.orig 2011-10-28 16:29:51.000000000 +0200 -+++ include/iprt/types.h 2011-12-22 10:17:16.000000000 +0100 -@@ -167,6 +167,10 @@ - # if defined(__GNUC__) - # if defined(RT_OS_LINUX) && __GNUC__ < 3 - typedef uint8_t bool; -+# elif defined(RT_OS_FREEBSD) -+# ifndef __bool_true_false_are_defined -+typedef _Bool bool; -+# endif - # else - # if defined(RT_OS_DARWIN) && defined(_STDBOOL_H) - # undef bool diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk new file mode 100644 index 000000000000..0525808f70c8 --- /dev/null +++ b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-vboxvideo-Makefile.kmk @@ -0,0 +1,20 @@ +--- src/VBox/Additions/x11/vboxvideo/Makefile.kmk.orig 2012-10-26 18:23:35.000000000 +0200 ++++ src/VBox/Additions/x11/vboxvideo/Makefile.kmk 2012-10-28 16:54:59.074303788 +0100 +@@ -196,7 +196,7 @@ + vboxvideo_drv_15_TEMPLATE = VBOXGUESTR3XORGMOD + vboxvideo_drv_15_CFLAGS := $(vboxvideo_drv_70_CFLAGS) + vboxvideo_drv_15_DEFS := $(vboxvideo_15_DEFS) XORG_VERSION_CURRENT=100503000 +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + vboxvideo_drv_15_DEFS += VBOX_DRI + endif + vboxvideo_drv_15_INCS = \ +@@ -204,7 +204,7 @@ + $(VBOX_PATH_X11_ROOT)/xorg-server-1.5.3 + vboxvideo_drv_15_INCS += $(PATH_ROOT)/src/VBox/Runtime/include + vboxvideo_drv_15_SOURCES = $(vboxvideo_drv_13_SOURCES) +-if1of ($(KBUILD_TARGET), linux solaris) ++if1of ($(KBUILD_TARGET), freebsd linux solaris) + vboxvideo_drv_15_SOURCES += \ + vboxvideo_dri.c + endif diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.3-xorg-xf86_ansic.h b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.3-xorg-xf86_ansic.h deleted file mode 100644 index b1dd2925cafa..000000000000 --- a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.3-xorg-xf86_ansic.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Additions/x11/x11include/1.3/xorg/xf86_ansic.h.orig 2011-01-25 20:19:04.000000000 +0100 -+++ src/VBox/Additions/x11/x11include/1.3/xorg/xf86_ansic.h 2011-01-25 20:19:16.000000000 +0100 -@@ -259,7 +259,6 @@ - extern int xf86open(const char*, int,...); - extern int xf86close(int); - extern long xf86lseek(int, long, int); --extern int xf86ioctl(int, unsigned long, pointer); - extern xf86ssize_t xf86read(int, void *, xf86size_t); - extern xf86ssize_t xf86write(int, const void *, xf86size_t); - extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */); diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.4-xorg-xf86_ansic.h b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.4-xorg-xf86_ansic.h deleted file mode 100644 index 1e4fcf6a5a09..000000000000 --- a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-1.4-xorg-xf86_ansic.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Additions/x11/x11include/1.4/xorg/xf86_ansic.h.orig 2011-01-25 20:28:21.000000000 +0100 -+++ src/VBox/Additions/x11/x11include/1.4/xorg/xf86_ansic.h 2011-01-25 20:28:43.000000000 +0100 -@@ -243,7 +243,6 @@ - extern int xf86open(const char*, int,...); - extern int xf86close(int); - extern long xf86lseek(int, long, int); --extern int xf86ioctl(int, unsigned long, pointer); - extern xf86ssize_t xf86read(int, void *, xf86size_t); - extern xf86ssize_t xf86write(int, const void *, xf86size_t); - extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */); diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.0-xorg-xf86_ansic.h b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.0-xorg-xf86_ansic.h deleted file mode 100644 index 52f98249067b..000000000000 --- a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.0-xorg-xf86_ansic.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Additions/x11/x11include/7.0/xorg/xf86_ansic.h.orig 2011-01-18 22:29:29.000000000 +0100 -+++ src/VBox/Additions/x11/x11include/7.0/xorg/xf86_ansic.h 2011-01-18 22:32:34.000000000 +0100 -@@ -268,7 +268,6 @@ - extern int xf86open(const char*, int,...); - extern int xf86close(int); - extern long xf86lseek(int, long, int); --extern int xf86ioctl(int, unsigned long, pointer); - extern xf86ssize_t xf86read(int, void *, xf86size_t); - extern xf86ssize_t xf86write(int, const void *, xf86size_t); - extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */); diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.1-xorg-xf86_ansic.h b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.1-xorg-xf86_ansic.h deleted file mode 100644 index df00ce88d3e6..000000000000 --- a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Additions-x11-x11include-7.1-xorg-xf86_ansic.h +++ /dev/null @@ -1,10 +0,0 @@ ---- src/VBox/Additions/x11/x11include/7.1/xorg/xf86_ansic.h.orig 2011-01-25 20:04:06.000000000 +0100 -+++ src/VBox/Additions/x11/x11include/7.1/xorg/xf86_ansic.h 2011-01-25 20:04:15.000000000 +0100 -@@ -269,7 +269,6 @@ - extern int xf86open(const char*, int,...); - extern int xf86close(int); - extern long xf86lseek(int, long, int); --extern int xf86ioctl(int, unsigned long, pointer); - extern xf86ssize_t xf86read(int, void *, xf86size_t); - extern xf86ssize_t xf86write(int, const void *, xf86size_t); - extern void* xf86mmap(void*, xf86size_t, int, int, int, xf86size_t /* off_t */); diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c index fd376f9b528b..b666b7ed0362 100644 --- a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c +++ b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c @@ -1,25 +1,56 @@ -Remove explicit initialization of m->flags and m->oflags because per -default vm_phys_alloc_contig() already initializes the page as unmanaged. -Chase move of PG_UNMANAGED flag from m->flags to m->oflags and renaming -to VPO_UNMANAGED for an additional assert. +From Alan L. Cox on FreeBSD-current: -Reviewed by: kib -See: http://svnweb.freebsd.org/base?view=revision&revision=224746 ---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2011-04-05 14:34:09.000000000 +0200 -+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c 2011-08-11 15:06:46.000000000 +0200 -@@ -394,9 +394,13 @@ - pPage->wire_count = 1; - pPage->pindex = iPage; - pPage->act_count = 0; -- pPage->oflags = 0; -- pPage->flags = PG_UNMANAGED; - atomic_add_int(&cnt.v_wire_count, 1); -+ -+#if __FreeBSD_version >= 900040 -+ Assert(pPage->oflags & VPO_UNMANAGED != 0); -+#else -+ Assert(pPage->flags & PG_UNMANAGED != 0); + I just glanced at the virtualbox code for a couple minutes. For + FreeBSD 9 and 10, these lock acquires are completely unnecessary, and + have been since FreeBSD 9.0. Just delete them. They may be equally + unnecessary under FreeBSD 8, but I didn't look carefully enough to + answer that question. + +[1] http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html +--- + src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c +index 5c90cf3..1176b51 100644 +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c ++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c +@@ -164,14 +164,19 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) + { + VM_OBJECT_LOCK(pMemFreeBSD->pObject); + vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0); ++#if __FreeBSD_version < 900000 ++ /* See http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html */ + vm_page_lock_queues(); ++#endif + for (vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0); + pPage != NULL; + pPage = vm_page_next(pPage)) + { + vm_page_unwire(pPage, 0); + } ++#if __FreeBSD_version < 900000 + vm_page_unlock_queues(); +#endif - } - - + VM_OBJECT_UNLOCK(pMemFreeBSD->pObject); + vm_object_deallocate(pMemFreeBSD->pObject); + break; +@@ -263,11 +268,15 @@ static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages, + while (iPage-- > 0) + { + pPage = vm_page_lookup(pObject, iPage); ++#if __FreeBSD_version < 900000 + vm_page_lock_queues(); ++#endif + if (fWire) + vm_page_unwire(pPage, 0); + vm_page_free(pPage); ++#if __FreeBSD_version < 900000 + vm_page_unlock_queues(); ++#endif + } + VM_OBJECT_UNLOCK(pObject); + return rcNoMem; +-- +1.7.11.5 + diff --git a/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-the-freebsd-kernel.h b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-the-freebsd-kernel.h new file mode 100644 index 000000000000..98a8b960508e --- /dev/null +++ b/emulators/virtualbox-ose-additions/files/patch-src-VBox-Runtime-r0drv-freebsd-the-freebsd-kernel.h @@ -0,0 +1,10 @@ +--- ./src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h.orig 2012-06-12 02:54:01.440878507 +0400 ++++ ./src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h 2012-06-12 00:08:55.218232972 +0400 +@@ -64,6 +64,7 @@ + #include + #include /* KERN_SUCCESS ++ */ + #include ++#include + #include /* vm_phys_alloc_* */ + #include /* kmem_alloc_attr */ + #include /* cnt */ -- cgit v1.2.3