All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] vboxguestdrivers: Add __divmoddi4 builtin support
@ 2021-03-19  8:18 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2021-03-19  8:18 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

gcc 11 needs it on i686

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../vboxguestdrivers/add__divmoddi4.patch     | 36 +++++++++++++++++++
 .../vboxguestdrivers_6.1.18.bb                |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/add__divmoddi4.patch

diff --git a/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/add__divmoddi4.patch b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/add__divmoddi4.patch
new file mode 100644
index 0000000000..8dd30a20ef
--- /dev/null
+++ b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/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 <raj.khem@gmail.com>
+
+--- 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;
++}
++
diff --git a/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_6.1.18.bb b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_6.1.18.bb
index d620e9893f..1def1a3115 100644
--- a/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_6.1.18.bb
+++ b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_6.1.18.bb
@@ -14,6 +14,7 @@ VBOX_NAME = "VirtualBox-${PV}"
 SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/${VBOX_NAME}.tar.bz2 \
     file://Makefile.utils \
     file://kernel-5.10.patch \
+    file://add__divmoddi4.patch \
 "
 SRC_URI[md5sum] = "c61001386eb3822ab8f06d688a82e84b"
 SRC_URI[sha256sum] = "108d42b9b391b7a332a33df1662cf7b0e9d9a80f3079d16288d8b9487f427d40"
-- 
2.31.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-19  8:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19  8:18 [meta-oe][PATCH] vboxguestdrivers: Add __divmoddi4 builtin support Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.