From 7ebcafdc8c1e73a3a16d368abd623072d0197149192019512d2e4c6df8916a51 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sun, 5 Mar 2023 22:53:33 +0000 Subject: [PATCH 1/3] Accepting request 1069494 from home:lwfinger:branches:Virtualization - GCC 13 changed and the fixes patch needed revising. boo#1207468 OBS-URL: https://build.opensuse.org/request/show/1069494 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=681 --- fixes_for_gcc13.patch | 45 +++++----------- virtualbox.changes | 5 ++ virtualbox.spec | 119 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 129 insertions(+), 40 deletions(-) diff --git a/fixes_for_gcc13.patch b/fixes_for_gcc13.patch index 722f56f..dcf483e 100644 --- a/fixes_for_gcc13.patch +++ b/fixes_for_gcc13.patch @@ -1,26 +1,3 @@ -Index: VirtualBox-7.0.6/include/iprt/types.h -=================================================================== ---- VirtualBox-7.0.6.orig/include/iprt/types.h -+++ VirtualBox-7.0.6/include/iprt/types.h -@@ -170,6 +170,7 @@ RT_C_DECLS_END - # undef __inline - # define __inline __inline - # endif -+# include - # include - # include - /* -Index: VirtualBox-7.0.6/src/libs/dxvk-native-1.9.2a/src/util/util_matrix.cpp -=================================================================== ---- VirtualBox-7.0.6.orig/src/libs/dxvk-native-1.9.2a/src/util/util_matrix.cpp -+++ VirtualBox-7.0.6/src/libs/dxvk-native-1.9.2a/src/util/util_matrix.cpp -@@ -229,4 +229,4 @@ namespace dxvk { - return os; - } - --} -\ No newline at end of file -+} Index: VirtualBox-7.0.6/src/libs/dxvk-native-1.9.2a/src/util/util_bit.h =================================================================== --- VirtualBox-7.0.6.orig/src/libs/dxvk-native-1.9.2a/src/util/util_bit.h @@ -33,15 +10,17 @@ Index: VirtualBox-7.0.6/src/libs/dxvk-native-1.9.2a/src/util/util_bit.h #include "util_likely.h" #include "util_math.h" -Index: VirtualBox-7.0.6/src/VBox/Additions/3D/mesa/mesa-21.3.8/include/c99_math.h +Index: VirtualBox-7.0.6/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/misc.h =================================================================== ---- VirtualBox-7.0.6.orig/src/VBox/Additions/3D/mesa/mesa-21.3.8/include/c99_math.h -+++ VirtualBox-7.0.6/src/VBox/Additions/3D/mesa/mesa-21.3.8/include/c99_math.h -@@ -34,6 +34,7 @@ - #ifndef _C99_MATH_H_ - #define _C99_MATH_H_ - -+#define _GLIBCXX_HOSTED 1 - #include - #include "c99_compat.h" +--- VirtualBox-7.0.6.orig/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/misc.h ++++ VirtualBox-7.0.6/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/misc.h +@@ -66,6 +66,9 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CO + OF THIS SOFTWARE. + ******************************************************************/ ++ ++#define __STDC_HOSTED__ 1 ++ + /* $Xorg: misc.h,v 1.5 2001/02/09 02:05:15 xorgcvs Exp $ */ + #ifndef MISC_H + #define MISC_H 1 diff --git a/virtualbox.changes b/virtualbox.changes index c0a376e..2c8108f 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Mar 5 20:24:32 UTC 2023 - Larry Finger + +- GCC 13 changed and the fixes patch needed revising. boo#1207468 + ------------------------------------------------------------------- Wed Mar 1 16:13:24 UTC 2023 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index 02cf864..e36390a 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -305,8 +305,21 @@ the terms of the GNU Public License (GPL). -#-######################################### + + + + + + + + + + + + + +#-######################################### %package qt Summary: Qt GUI part for %{name} Group: System/Emulators/PC @@ -330,8 +343,21 @@ This package contains the code for the GUI used to control VMs. -#-######################################## + + + + + + + + + + + + + +#-######################################## %package websrv Summary: WebService GUI part for %{name} Group: System/Emulators/PC @@ -348,9 +374,23 @@ The VirtualBox web server is used to control headless VMs using a browser. + + + + + + + + + + + + + #-########################################## + %package guest-tools Summary: VirtualBox guest tools Group: System/Emulators/PC @@ -378,8 +418,21 @@ VirtualBox guest addition tools. -#-########################################## + + + + + + + + + + + + + +#-########################################## %package -n python3-%{name} Summary: Python bindings for %{name} Group: Development/Libraries/Python @@ -404,8 +457,21 @@ Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package. -#-########################################## + + + + + + + + + + + + + +#-########################################## %package devel Summary: Devel files for %{name} Group: Development/Libraries/Other @@ -425,8 +491,21 @@ Development file for %{name} -#-########################################## + + + + + + + + + + + + + +#-########################################## %package host-source Summary: Source files for %{name} host kernel modules Group: Development/Sources @@ -463,8 +542,21 @@ sudo %{_sbindir}/vboxguestconfig -#-########################################## + + + + + + + + + + + + + +#-########################################## %package guest-desktop-icons Summary: Icons for guest desktop files Group: System/Emulators/PC @@ -482,8 +574,21 @@ This package contains icons for guest desktop files that were created on the des -#-########################################## + + + + + + + + + + + + + +#-########################################## %package vnc Summary: VNC desktop sharing Group: System/Emulators/PC From d3dbcc426542ba8e1c83743ab51a6a01b08e88a26fa32bcbdcd52e7456501ef2 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 6 Mar 2023 21:06:16 +0000 Subject: [PATCH 2/3] Accepting request 1069741 from home:lwfinger:branches:Virtualization - Added file "fixea_for_kernel_6.3.patch" to handle API change. - File "fixes_for_gcc13.patch" updated for additional changes in GCC 13 boo#1207468 OBS-URL: https://build.opensuse.org/request/show/1069741 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=682 --- fixes_for_kernel_6.3.patch | 40 ++++++++++++++++++++++++++++++++++++++ virtualbox.changes | 5 +++-- virtualbox.spec | 19 ++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 fixes_for_kernel_6.3.patch diff --git a/fixes_for_kernel_6.3.patch b/fixes_for_kernel_6.3.patch new file mode 100644 index 0000000..d370f90 --- /dev/null +++ b/fixes_for_kernel_6.3.patch @@ -0,0 +1,40 @@ +Patch to fix VirtualBox builds on kernel 6.3.0 and newer + +Beginning with 6.3, a user is no loncer to write directly info the +vm_flags member of struct vm_area_struct. It is now necessary to use +the vm_flags_set() wrapper. Two locations in memobj-r0drv-linux.c are +affected. + +Signed-off-by: Larry Finger + +Index: VirtualBox-7.0.6/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +=================================================================== +--- VirtualBox-7.0.6.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c ++++ VirtualBox-7.0.6/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +@@ -1401,8 +1401,12 @@ DECLHIDDEN(int) rtR0MemObjNativeLockUser + while (rc-- > 0) + { + flush_dcache_page(pMemLnx->apPages[rc]); +- papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED; +- } ++# if RTLNX_VER_MIN(6, 3, 0) ++ vm_flags_set(papVMAs[rc], VM_DONTCOPY | VM_LOCKED); ++#else ++ papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED; ++#endif ++ } + + LNX_MM_UP_READ(pTask->mm); + +@@ -1873,7 +1877,11 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser( + /* Thes flags help making 100% sure some bad stuff wont happen (swap, core, ++). + * See remap_pfn_range() in mm/memory.c */ + #if RTLNX_VER_MIN(3,7,0) ++# if RTLNX_VER_MIN(6, 3, 0) ++ vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP); ++#else + vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; ++#endif + #else + vma->vm_flags |= VM_RESERVED; + #endif diff --git a/virtualbox.changes b/virtualbox.changes index 2c8108f..c048797 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- -Sun Mar 5 20:24:32 UTC 2023 - Larry Finger +Mon Mar 6 20:57:14 UTC 2023 - Larry Finger -- GCC 13 changed and the fixes patch needed revising. boo#1207468 +- Added file "fixea_for_kernel_6.3.patch" to handle API change. +- File "fixes_for_gcc13.patch" updated for additional changes in GCC 13 boo#1207468 ------------------------------------------------------------------- Wed Mar 1 16:13:24 UTC 2023 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index e36390a..8bcbbe3 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -160,6 +160,8 @@ Patch34: fix_kmp_build.patch Patch35: fixes_for_leap15.5.patch # Fix for GCC13 Patch36: fixes_for_gcc13.patch +# Fix for kernel 6.3 +Patch37: fixes_for_kernel_6.3.patch # # Common BuildRequires for both virtualbox and virtualbox-kmp BuildRequires: %{kernel_module_package_buildreqs} @@ -316,6 +318,8 @@ the terms of the GNU Public License (GPL). + + @@ -354,6 +358,8 @@ This package contains the code for the GUI used to control VMs. + + @@ -386,6 +392,8 @@ The VirtualBox web server is used to control headless VMs using a browser. + + @@ -429,6 +437,8 @@ VirtualBox guest addition tools. + + @@ -468,6 +478,8 @@ Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package. + + @@ -502,6 +514,8 @@ Development file for %{name} + + @@ -553,6 +567,8 @@ sudo %{_sbindir}/vboxguestconfig + + @@ -585,6 +601,8 @@ This package contains icons for guest desktop files that were created on the des + + @@ -656,6 +674,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %if 0%{gcc_version} >= 13 %patch36 -p1 %endif +%patch37 -p1 ### Documents for virtualbox main package ### %if %{main_package} From a36b6afde9fde27b1f2c1c8e3f9d5643c0a24e0a2eca79f3d3c800c74fa1408d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 6 Mar 2023 21:22:17 +0000 Subject: [PATCH 3/3] Accepting request 1069750 from home:lwfinger:branches:Virtualization - Added file "fixes_for_kernel_6.3.patch" to handle API change. - File "fixes_for_gcc13.patch" updated for additional changes in GCC 13 boo#1207468 spec-cleaner used to remove extra blank lines OBS-URL: https://build.opensuse.org/request/show/1069750 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=683 --- virtualbox.changes | 4 +- virtualbox.spec | 191 ++------------------------------------------- 2 files changed, 9 insertions(+), 186 deletions(-) diff --git a/virtualbox.changes b/virtualbox.changes index c048797..4261cdf 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- -Mon Mar 6 20:57:14 UTC 2023 - Larry Finger +Mon Mar 6 21:14:12 UTC 2023 - Larry Finger -- Added file "fixea_for_kernel_6.3.patch" to handle API change. +- Added file "fixes_for_kernel_6.3.patch" to handle API change. - File "fixes_for_gcc13.patch" updated for additional changes in GCC 13 boo#1207468 ------------------------------------------------------------------- diff --git a/virtualbox.spec b/virtualbox.spec index 8bcbbe3..11b7141 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -300,30 +300,8 @@ and others, and limited virtualization of macOS guests on Apple hardware. VirtualBox is freely available as Open Source Software under the terms of the GNU Public License (GPL). - - - - - - - - - - - - - - - - - - - - - - - #-######################################### + %package qt Summary: Qt GUI part for %{name} Group: System/Emulators/PC @@ -340,30 +318,8 @@ Obsoletes: %{name}-ose-qt < %{version} %description qt This package contains the code for the GUI used to control VMs. - - - - - - - - - - - - - - - - - - - - - - - #-######################################## + %package websrv Summary: WebService GUI part for %{name} Group: System/Emulators/PC @@ -375,30 +331,7 @@ Obsoletes: %{name}-vboxwebsrv < %{version} The VirtualBox web server is used to control headless VMs using a browser. - - - - - - - - - - - - - - - - - - - - - - #-########################################## - %package guest-tools Summary: VirtualBox guest tools Group: System/Emulators/PC @@ -419,30 +352,8 @@ Requires(pre): net-tools-deprecated %description guest-tools VirtualBox guest addition tools. - - - - - - - - - - - - - - - - - - - - - - - #-########################################## + %package -n python3-%{name} Summary: Python bindings for %{name} Group: Development/Libraries/Python @@ -460,30 +371,8 @@ Obsoletes: python3-%{name}-ose < %{version} %description -n python3-%{name} Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package. - - - - - - - - - - - - - - - - - - - - - - - #-########################################## + %package devel Summary: Devel files for %{name} Group: Development/Libraries/Other @@ -496,30 +385,8 @@ Obsoletes: %{name}-ose-devel < %{version} %description devel Development file for %{name} - - - - - - - - - - - - - - - - - - - - - - - #-########################################## + %package host-source Summary: Source files for %{name} host kernel modules Group: Development/Sources @@ -549,30 +416,8 @@ Source files for %{name} guest kernel modules These can be built for custom kernels using sudo %{_sbindir}/vboxguestconfig - - - - - - - - - - - - - - - - - - - - - - - #-########################################## + %package guest-desktop-icons Summary: Icons for guest desktop files Group: System/Emulators/PC @@ -583,30 +428,8 @@ BuildArch: noarch %description guest-desktop-icons This package contains icons for guest desktop files that were created on the desktop. - - - - - - - - - - - - - - - - - - - - - - - #-########################################## + %package vnc Summary: VNC desktop sharing Group: System/Emulators/PC