diff --git a/hardware/virtualization/virtualbox/files/019-vboxr0-cflags.patch b/hardware/virtualization/virtualbox/files/019-vboxr0-cflags.patch
new file mode 100644
index 0000000000..d021bc48fa
--- /dev/null
+++ b/hardware/virtualization/virtualbox/files/019-vboxr0-cflags.patch
@@ -0,0 +1,18 @@
+--- a/Config.kmk
++++ b/Config.kmk
+@@ -4502,11 +4502,14 @@ 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)
++ $(VBOX_GCC_fno-stack-protector) -fno-common -ffreestanding $(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)
++ if $(VBOX_GCC_VERSION_CC) >= 40500 # 4.1.2 complains, 4.5.2 is okay, didn't check which version inbetween made it okay with g++.
++TEMPLATE_VBoxR0_CXXFLAGS += -ffreestanding
++ endif
+ TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables -ffreestanding
+ TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables
+ TEMPLATE_VBoxR0_CXXFLAGS.freebsd = -ffreestanding
diff --git a/hardware/virtualization/virtualbox/pspec.xml b/hardware/virtualization/virtualbox/pspec.xml
index 1babe0fd5a..d12d977146 100644
--- a/hardware/virtualization/virtualbox/pspec.xml
+++ b/hardware/virtualization/virtualbox/pspec.xml
@@ -12,7 +12,7 @@
app:gui
A powerful virtualization program
VirtualBox is a family of powerful x86 virtualization products for enterprise as well as home use. This is the Open Source Edition which lacks USB support and some other things.
- http://download.virtualbox.org/virtualbox/6.1.32/VirtualBox-6.1.32.tar.bz2
+ http://download.virtualbox.org/virtualbox/6.1.34/VirtualBox-6.1.34.tar.bz2
dkms.conf
dkms-guest.conf
@@ -75,6 +75,7 @@
013-Makefile.patch
017-fix-narrowing-conversion.patch
018-xclient.patch
+ 019-vboxr0-cflags.patch
@@ -203,6 +204,13 @@
+
+ 2022-04-25
+ 6.1.34
+ Version bump.
+ Mustafa Cinasal
+ muscnsl@gmail.com
+
2022-01-25
6.1.32