aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2014-12-23 08:05:04 +0800
committerjkim <jkim@FreeBSD.org>2014-12-23 08:05:04 +0800
commitdd4c1bab534fccbbb43fea835b8b54fea07e37d0 (patch)
tree20e51abcada2a41f6b2e02be42e4c206aeab27d0
parentd44b8114d9985732abfb1d4e62846d123e4381f6 (diff)
downloadfreebsd-ports-gnome-dd4c1bab534fccbbb43fea835b8b54fea07e37d0.tar.gz
freebsd-ports-gnome-dd4c1bab534fccbbb43fea835b8b54fea07e37d0.tar.zst
freebsd-ports-gnome-dd4c1bab534fccbbb43fea835b8b54fea07e37d0.zip
- Reduce diff from Linux OpenGL support. Note we do not have to manually
turn off AIGLX any more. - Do not install vboxvideo.ko when OPENGL is disabled. It is only required for OpenGL support. - Install vboxvideo.ko.symbols when both DEBUG and OPENGL are enabled. - Do not try to load vboxvideo.ko if it does not exist.
-rw-r--r--emulators/virtualbox-ose-additions/Makefile9
-rw-r--r--emulators/virtualbox-ose-additions/files/vboxguest.in1
-rw-r--r--emulators/virtualbox-ose-additions/pkg-plist3
-rw-r--r--emulators/virtualbox-ose/files/patch-Config.kmk8
-rw-r--r--emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py98
-rw-r--r--emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py98
-rw-r--r--emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py107
-rw-r--r--emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk72
-rw-r--r--emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk20
9 files changed, 413 insertions, 3 deletions
diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile
index 541188cc4db5..443c9f74e8c2 100644
--- a/emulators/virtualbox-ose-additions/Makefile
+++ b/emulators/virtualbox-ose-additions/Makefile
@@ -3,7 +3,7 @@
PORTNAME= virtualbox-ose
DISTVERSION= 4.3.20
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= emulators
MASTER_SITES= http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
http://tmp.chruetertee.ch/ \
@@ -113,6 +113,8 @@ EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-VBox-Additions-x11-VBoxClient-Makefil
.endif
.endif
+SUB_LIST+= KMODDIR=${KMODDIR}
+
pre-everything::
.if ${ARCH} == "amd64"
.if !exists(/usr/lib32/libc.so)
@@ -159,8 +161,11 @@ do-install:
.if ${PORT_OPTIONS:MDEBUG}
${INSTALL_KLD} ${VBOX_BIN}/src/vboxguest/vboxguest.ko.symbols ${STAGEDIR}${KMODDIR}
.endif
-.if ${PORT_OPTIONS:MX11}
+.if ${PORT_OPTIONS:MOPENGL}
${INSTALL_KLD} ${VBOX_BIN}/vboxvideo.ko ${STAGEDIR}${KMODDIR}
+.if ${PORT_OPTIONS:MDEBUG}
+ ${INSTALL_KLD} ${VBOX_BIN}/vboxvideo.ko.symbols ${STAGEDIR}${KMODDIR}
+.endif
.endif
${INSTALL_PROGRAM} ${VBOX_SBINS:S|^|${VBOX_BIN}/|} \
diff --git a/emulators/virtualbox-ose-additions/files/vboxguest.in b/emulators/virtualbox-ose-additions/files/vboxguest.in
index ade179f1e22f..7ea2bb47e2f4 100644
--- a/emulators/virtualbox-ose-additions/files/vboxguest.in
+++ b/emulators/virtualbox-ose-additions/files/vboxguest.in
@@ -32,6 +32,7 @@ vboxguest_start()
return 1
fi
fi
+ test -f "%%KMODDIR%%/vboxvideo.ko" || return 0
if ! kldstat -q -m vgapci/vboxvideo;
then
if ! kldload vboxvideo > /dev/null 2>&1;
diff --git a/emulators/virtualbox-ose-additions/pkg-plist b/emulators/virtualbox-ose-additions/pkg-plist
index 2ade10b54198..0166c5116172 100644
--- a/emulators/virtualbox-ose-additions/pkg-plist
+++ b/emulators/virtualbox-ose-additions/pkg-plist
@@ -16,4 +16,5 @@ sbin/VBoxService
%%X11%%share/autostart/vboxclient.desktop
/%%KMODDIR%%/vboxguest.ko
%%DEBUG%%/%%KMODDIR%%/vboxguest.ko.symbols
-%%X11%%/%%KMODDIR%%/vboxvideo.ko
+%%OPENGL%%/%%KMODDIR%%/vboxvideo.ko
+%%DEBUG%%%%OPENGL%%/%%KMODDIR%%/vboxvideo.ko.symbols
diff --git a/emulators/virtualbox-ose/files/patch-Config.kmk b/emulators/virtualbox-ose/files/patch-Config.kmk
index 6fa848c740fe..344bde32d8eb 100644
--- a/emulators/virtualbox-ose/files/patch-Config.kmk
+++ b/emulators/virtualbox-ose/files/patch-Config.kmk
@@ -119,3 +119,11 @@
/usr/local/lib
else ifeq ($(KBUILD_HOST),solaris)
TEMPLATE_VBoxBldProg_TOOL = GXX3PLAIN
+@@ -5427,6 +5407,7 @@
+ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
+ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
+ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed
++TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.freebsd = -Wl,--no-as-needed
+ TEMPLATE_VBOXCROGLR3HOSTDLL_BLDDIRS = $(VBOX_PATH_CROGL_GENFILES)/
+
+ #
diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py
new file mode 100644
index 000000000000..316d738f8600
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports.py
@@ -0,0 +1,98 @@
+--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py.orig 2014-12-19 16:58:04.474417000 -0500
++++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports.py 2014-11-21 10:16:35.000000000 -0500
+@@ -0,0 +1,95 @@
++# Copyright (c) 2001, Stanford University
++# All rights reserved.
++#
++# See the file LICENSE.txt for information on redistributing this software.
++
++
++import sys
++
++import apiutil
++
++
++def GenerateEntrypoints():
++
++ #apiutil.CopyrightC()
++
++ # Get sorted list of dispatched functions.
++ # The order is very important - it must match cr_opcodes.h
++ # and spu_dispatch_table.h
++ print '%include "iprt/asmdefs.mac"'
++ print ""
++ print "%ifdef RT_ARCH_AMD64"
++ print "extern glim"
++ print "%else ; X86"
++ print "extern glim"
++ print "%endif"
++ print ""
++
++ keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
++
++ for index in range(len(keys)):
++ func_name = keys[index]
++ if apiutil.Category(func_name) == "Chromium":
++ continue
++ if apiutil.Category(func_name) == "VBox":
++ continue
++
++ print "BEGINPROC_EXPORTED gl%s" % func_name
++ print "%ifdef RT_ARCH_AMD64"
++ print "\tmov \trax, qword glim+%d" % (8*index)
++ print "\tjmp \t[rax]"
++ print "%else ; X86"
++ print "\tmov \teax, dword glim+%d" % (4*index)
++ print "\tjmp \t[eax]"
++ print "%endif"
++ print "ENDPROC gl%s" % func_name
++ print ""
++
++
++ print ';'
++ print '; Aliases'
++ print ';'
++
++ # Now loop over all the functions and take care of any aliases
++ allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
++ for func_name in allkeys:
++ if "omit" in apiutil.ChromiumProps(func_name):
++ continue
++
++ if func_name in keys:
++ # we already processed this function earlier
++ continue
++
++ # alias is the function we're aliasing
++ alias = apiutil.Alias(func_name)
++ if alias:
++ # this dict lookup should never fail (raise an exception)!
++ index = keys.index(alias)
++ print "BEGINPROC_EXPORTED gl%s" % func_name
++ print "%ifdef RT_ARCH_AMD64"
++ print "\tmov \trax, qword glim+%d" % (8*index)
++ print "\tjmp \t[rax]"
++ print "%else ; X86"
++ print "\tmov \teax, dword glim+%d" % (4*index)
++ print "\tjmp \t[eax]"
++ print "%endif"
++ print "ENDPROC gl%s" % func_name
++ print ""
++
++
++ print ';'
++ print '; No-op stubs'
++ print ';'
++
++ # Now generate no-op stub functions
++ for func_name in allkeys:
++ if "stub" in apiutil.ChromiumProps(func_name):
++ print "BEGINPROC_EXPORTED gl%s" % func_name
++ print "\tleave"
++ print "\tret"
++ print "ENDPROC gl%s" % func_name
++ print ""
++
++
++GenerateEntrypoints()
++
diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py
new file mode 100644
index 000000000000..099624ce39d7
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_exports_dri.py
@@ -0,0 +1,98 @@
+--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py.orig 2014-12-19 16:58:04.474417000 -0500
++++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_exports_dri.py 2014-11-21 10:16:35.000000000 -0500
+@@ -0,0 +1,95 @@
++# Copyright (c) 2001, Stanford University
++# All rights reserved.
++#
++# See the file LICENSE.txt for information on redistributing this software.
++
++
++import sys
++
++import apiutil
++
++
++def GenerateEntrypoints():
++
++ #apiutil.CopyrightC()
++
++ # Get sorted list of dispatched functions.
++ # The order is very important - it must match cr_opcodes.h
++ # and spu_dispatch_table.h
++ print '%include "iprt/asmdefs.mac"'
++ print ""
++ print "%ifdef RT_ARCH_AMD64"
++ print "extern glim"
++ print "%else ; X86"
++ print "extern glim"
++ print "%endif"
++ print ""
++
++ keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
++
++ for index in range(len(keys)):
++ func_name = keys[index]
++ if apiutil.Category(func_name) == "Chromium":
++ continue
++ if apiutil.Category(func_name) == "VBox":
++ continue
++
++ print "BEGINPROC_EXPORTED cr_gl%s" % func_name
++ print "%ifdef RT_ARCH_AMD64"
++ print "\tmov \trax, qword glim+%d" % (8*index)
++ print "\tjmp \t[rax]"
++ print "%else ; X86"
++ print "\tmov \teax, dword glim+%d" % (4*index)
++ print "\tjmp \t[eax]"
++ print "%endif"
++ print "ENDPROC cr_gl%s" % func_name
++ print ""
++
++
++ print ';'
++ print '; Aliases'
++ print ';'
++
++ # Now loop over all the functions and take care of any aliases
++ allkeys = apiutil.GetAllFunctions(sys.argv[1]+"/APIspec.txt")
++ for func_name in allkeys:
++ if "omit" in apiutil.ChromiumProps(func_name):
++ continue
++
++ if func_name in keys:
++ # we already processed this function earlier
++ continue
++
++ # alias is the function we're aliasing
++ alias = apiutil.Alias(func_name)
++ if alias:
++ # this dict lookup should never fail (raise an exception)!
++ index = keys.index(alias)
++ print "BEGINPROC_EXPORTED cr_gl%s" % func_name
++ print "%ifdef RT_ARCH_AMD64"
++ print "\tmov \trax, qword glim+%d" % (8*index)
++ print "\tjmp \t[rax]"
++ print "%else ; X86"
++ print "\tmov \teax, dword glim+%d" % (4*index)
++ print "\tjmp \t[eax]"
++ print "%endif"
++ print "ENDPROC cr_gl%s" % func_name
++ print ""
++
++
++ print ';'
++ print '; No-op stubs'
++ print ';'
++
++ # Now generate no-op stub functions
++ for func_name in allkeys:
++ if "stub" in apiutil.ChromiumProps(func_name):
++ print "BEGINPROC_EXPORTED cr_gl%s" % func_name
++ print "\tleave"
++ print "\tret"
++ print "ENDPROC cr_gl%s" % func_name
++ print ""
++
++
++GenerateEntrypoints()
++
diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py
new file mode 100644
index 000000000000..e3d7513bb8c7
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-FreeBSD_i386_glxapi_exports.py
@@ -0,0 +1,107 @@
+--- src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py.orig 2014-12-19 16:58:04.474417000 -0500
++++ src/VBox/Additions/common/crOpenGL/FreeBSD_i386_glxapi_exports.py 2014-11-21 10:16:35.000000000 -0500
+@@ -0,0 +1,104 @@
++"""
++Copyright (C) 2009-2012 Oracle Corporation
++
++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.
++"""
++
++import sys
++
++#Note, this should match the fakedri_glxfuncsList.h order
++glx_functions = [
++"CopyContext",
++"UseXFont",
++#"GetDriverConfig",
++"GetProcAddress",
++"QueryExtension",
++"IsDirect",
++"DestroyGLXPbufferSGIX",
++"QueryGLXPbufferSGIX",
++"CreateGLXPixmap",
++"CreateGLXPixmapWithConfigSGIX",
++"QueryContext",
++"CreateContextWithConfigSGIX",
++"SwapBuffers",
++"CreateNewContext",
++"SelectEventSGIX",
++"GetCurrentDrawable",
++"ChooseFBConfig",
++"WaitGL",
++"GetFBConfigs",
++"CreatePixmap",
++"GetSelectedEventSGIX",
++"GetCurrentReadDrawable",
++"GetCurrentDisplay",
++"QueryServerString",
++"CreateWindow",
++"SelectEvent",
++"GetVisualFromFBConfigSGIX",
++"GetFBConfigFromVisualSGIX",
++"QueryDrawable",
++"CreateContext",
++"GetConfig",
++"CreateGLXPbufferSGIX",
++"CreatePbuffer",
++"ChooseFBConfigSGIX",
++"WaitX",
++"GetVisualFromFBConfig",
++#"GetScreenDriver",
++"GetFBConfigAttrib",
++"GetCurrentContext",
++"GetClientString",
++"DestroyPixmap",
++"MakeCurrent",
++"DestroyContext",
++"GetProcAddressARB",
++"GetSelectedEvent",
++"DestroyPbuffer",
++"DestroyWindow",
++"DestroyGLXPixmap",
++"QueryVersion",
++"ChooseVisual",
++"MakeContextCurrent",
++"QueryExtensionsString",
++"GetFBConfigAttribSGIX",
++"FreeMemoryMESA",
++"QueryContextInfoEXT",
++"ImportContextEXT",
++"GetContextIDEXT",
++"MakeCurrentReadSGI",
++"AllocateMemoryMESA",
++"GetMemoryOffsetMESA",
++"CreateGLXPixmapMESA",
++"GetCurrentDisplayEXT",
++"FreeContextEXT"
++];
++
++print '%include "iprt/asmdefs.mac"'
++print ""
++print "%ifdef RT_ARCH_AMD64"
++print "extern glxim"
++print "%else ; X86"
++print "extern glxim"
++print "%endif"
++print ""
++
++for index in range(len(glx_functions)):
++ func_name = glx_functions[index]
++
++ print "BEGINPROC_EXPORTED vbox_glX%s" % func_name
++ print "%ifdef RT_ARCH_AMD64"
++ print "\tmov \trax, qword glxim+%d" % (8*index)
++ print "\tjmp \t[rax]"
++ print "%else ; X86"
++ print "\tmov \teax, dword glxim+%d" % (4*index)
++ print "\tjmp \t[eax]"
++ print "%endif"
++ print "ENDPROC vbox_glX%s" % func_name
++ print ""
++
diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk
new file mode 100644
index 000000000000..cd8bc4499c7b
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-crOpenGL-Makefile.kmk
@@ -0,0 +1,72 @@
+--- src/VBox/Additions/common/crOpenGL/Makefile.kmk.orig 2014-11-21 10:16:35.000000000 -0500
++++ src/VBox/Additions/common/crOpenGL/Makefile.kmk 2014-12-19 16:55:22.000000000 -0500
+@@ -172,7 +172,7 @@
+ VBoxOGL_SOURCES.solaris += \
+ $(VBOX_PATH_CROGL_GENFILES)/solaris_exports.c
+ VBoxOGL_SOURCES.freebsd += \
+- $(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.c
++ $(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.asm
+ endif
+ endif
+
+@@ -190,10 +190,12 @@
+ $(VBOX_PATH_CROGL_GENFILES)/linux_exports.asm
+ VBoxOGL_CLEAN.solaris += \
+ $(VBOX_PATH_CROGL_GENFILES)/solaris_exports.c
++VBoxOGL_CLEAN.freebsd += \
++ $(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.asm
+ VBoxOGL_CLEAN.win = \
+ $(VBOX_PATH_CROGL_GENFILES)/windows_exports.asm \
+ $(VBOX_PATH_CROGL_GENFILES)/cropengl.def
+-if1of ($(KBUILD_TARGET), linux solaris)
++if1of ($(KBUILD_TARGET), linux solaris freebsd)
+ ifdef VBoxOGL_DRI
+ VBoxOGL_CLEAN += \
+ $(VBOX_PATH_CROGL_GENFILES)/cr_gl.h \
+@@ -206,6 +208,8 @@
+ $(VBOX_PATH_CROGL_GENFILES)/linux_glxapi_exports.asm
+ VBoxOGL_CLEAN.solaris += \
+ $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm
++ VBoxOGL_CLEAN.freebsd += \
++ $(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm
+ endif
+ endif
+ VBoxOGL_LIBS = \
+@@ -235,7 +239,7 @@
+ ifdef VBOX_WITH_WDDM
+ VBoxOGL_DEFS.win += VBOX_WITH_WDDM
+ endif
+-if1of ($(KBUILD_TARGET), linux)
++if1of ($(KBUILD_TARGET), linux freebsd)
+ VBoxOGL_LDFLAGS += -Wl,-z,nodelete
+ endif
+ ifdef VBOX_WITH_WDDM
+@@ -317,8 +321,8 @@
+ $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
+
+ else ifeq ($(KBUILD_TARGET),freebsd)
+-$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.c: \
+- $(PATH_SUB_CURRENT)/FreeBSD_exports.py \
++$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports.asm: \
++ $(PATH_SUB_CURRENT)/FreeBSD_i386_exports.py \
+ $(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
+ | $$(dir $$@)
+ $(call MSG_GENERATE,python,$@,$<)
+@@ -387,7 +391,16 @@
+ $(VBOX_PATH_CROGL_GENFILES)/solaris_glxapi_exports.asm: $(PATH_SUB_CURRENT)/SunOS_i386_glxapi_exports.py | $$(dir $$@)
+ $(call MSG_GENERATE,python,$@,$<)
+ $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
+-
++ else ifeq ($(KBUILD_TARGET),freebsd)
++$(VBOX_PATH_CROGL_GENFILES)/freebsd_exports_dri.asm: \
++ $(PATH_SUB_CURRENT)/FreeBSD_i386_exports_dri.py \
++ $(VBOX_CROGL_API_FILES) $(PATH_SUB_CURRENT)/entrypoints.py \
++ | $$(dir $$@)
++ $(call MSG_GENERATE,python,$@,$<)
++ $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI)
++$(VBOX_PATH_CROGL_GENFILES)/freebsd_glxapi_exports.asm: $(PATH_SUB_CURRENT)/FreeBSD_i386_glxapi_exports.py | $$(dir $$@)
++ $(call MSG_GENERATE,python,$@,$<)
++ $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $<
+ else
+ $(VBOX_PATH_CROGL_GENFILES)/linux_exports_dri.asm: \
+ $(PATH_SUB_CURRENT)/Linux_i386_exports_dri.py \
diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk b/emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk
new file mode 100644
index 000000000000..119813957bca
--- /dev/null
+++ b/emulators/virtualbox-ose/files/patch-src-VBox-GuestHost-OpenGL-Makefile.kmk
@@ -0,0 +1,20 @@
+--- src/VBox/GuestHost/OpenGL/Makefile.kmk.orig 2014-11-21 10:22:21.000000000 -0500
++++ src/VBox/GuestHost/OpenGL/Makefile.kmk 2014-12-22 17:20:31.000000000 -0500
+@@ -116,7 +116,7 @@
+ endif
+ VBoxOGLcrutil_CLEAN = \
+ $(VBOX_PATH_CROGL_GENFILES)/debug_opcodes.c
+-if1of ($(KBUILD_TARGET), linux)
++if1of ($(KBUILD_TARGET), linux freebsd)
+ VBoxOGLcrutil_LDFLAGS += -Wl,-z,nodelete
+ endif
+
+@@ -160,7 +160,7 @@
+ if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_WDDM)
+ VBoxOGLhostcrutil_INSTTYPE.win = both
+ endif
+-if1of ($(KBUILD_TARGET), linux)
++if1of ($(KBUILD_TARGET), linux freebsd)
+ VBoxOGLhostcrutil_LDFLAGS = $(NO_SUCH_VARIABLE)
+ endif
+ VBoxOGLhostcrutil_LDFLAGS.darwin = $(VBoxOGLcrutil_LDFLAGS.darwin) \