From: Jan Rękorajski Date: Sat, 3 Jul 2021 22:14:15 +0000 (+0200) Subject: - add fix for building with gccc 11 on ix86 X-Git-Tag: auto/th/VirtualBox-6.1.22-2 X-Git-Url: http://git.pld-linux.org/?p=packages%2FVirtualBox.git;a=commitdiff_plain;h=5c8fa7a;ds=sidebyside - add fix for building with gccc 11 on ix86 --- diff --git a/VirtualBox.spec b/VirtualBox.spec index e3b60d7..1a70f1f 100644 --- a/VirtualBox.spec +++ b/VirtualBox.spec @@ -47,7 +47,7 @@ exit 1 %define qtver 5.6.0 -%define rel 1 +%define rel 2 %define pname VirtualBox Summary: VirtualBox - x86 hardware virtualizer Summary(pl.UTF-8): VirtualBox - wirtualizator sprzętu x86 @@ -88,6 +88,7 @@ Patch15: %{pname}-lightdm-1.19.2.patch Patch16: %{pname}-no-vboxvideo.patch Patch17: qt5-gl.patch Patch19: kernel-4.9.256.patch +Patch20: add__divmoddi4.patch URL: http://www.virtualbox.org/ %if %{with userspace} %ifarch %{x8664} @@ -548,6 +549,7 @@ echo override vboxsf %{_kernel_ver} misc >> kernel/installed/etc/depmod.d/%{_ker %patch15 -p0 %patch16 -p0 %patch17 -p1 +%patch20 -p1 %{__sed} -i -e 's,@VBOX_DOC_PATH@,%{_docdir}/%{name}-%{version},' \ -e 's/Categories=.*/Categories=Utility;Emulator;/' src/VBox/Installer/common/virtualbox.desktop.in diff --git a/add__divmoddi4.patch b/add__divmoddi4.patch new file mode 100644 index 0000000..8dd30a2 --- /dev/null +++ b/add__divmoddi4.patch @@ -0,0 +1,36 @@ +add __divmoddi4 builtin + +GCC 11 will generate it in code + +void foo(unsigned char *u8Second, unsigned int *u32Nanosecond, long long timeSpec) +{ + long long i64Div; + int i32Div; + int i32Rem; + i64Div = timeSpec; + i32Rem = (int)(i64Div % 1000000000); + i64Div /= 1000000000; + *u32Nanosecond = i32Rem; + i32Rem = (int)(i64Div % 60); + *u8Second = i32Rem; +} + + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/src/VBox/Runtime/common/math/gcc/divdi3.c ++++ b/src/VBox/Runtime/common/math/gcc/divdi3.c +@@ -68,3 +68,12 @@ __divdi3(a, b) + uq = - uq; + return uq; + } ++ ++quad_t ++__divmoddi4(quad_t a, quad_t b, quad_t* rem) ++{ ++ quad_t d = __divdi3(a,b); ++ *rem = a - (d*b); ++ return d; ++} ++