aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-03-19 01:14:03 -0700
committerArmin Kuster <akuster808@gmail.com>2021-07-19 16:25:25 -0700
commit12bc39d8c5ee7fdec1d1f5e92812b200eeba5b7b (patch)
tree9e93ff6a018421f4362d069b595eab73a7e340e2
parent4435dfaa9e543b9a9aeba08782ba0d52a6fcd612 (diff)
downloadmeta-openembedded-12bc39d8c5ee7fdec1d1f5e92812b200eeba5b7b.tar.gz
meta-openembedded-12bc39d8c5ee7fdec1d1f5e92812b200eeba5b7b.tar.bz2
meta-openembedded-12bc39d8c5ee7fdec1d1f5e92812b200eeba5b7b.zip
vboxguestdrivers: Add __divmoddi4 builtin support
gcc 11 needs it on i686 Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 57f7692e8ef707535ffa1683aa711de442736ec1) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers/add__divmoddi4.patch36
-rw-r--r--meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_6.1.18.bb1
2 files changed, 37 insertions, 0 deletions
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 000000000..8dd30a20e
--- /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 d620e9893..1def1a311 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"