summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-04-30 16:59:20 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-01 13:07:35 +0100
commit24a5b74daf327fef16a75481eff4bacae0ac6e0d (patch)
treeb699bec4c018f1ffbb7b55ff7f7d0eb971faa8f7
parentabe46b65452eff84232b9f9152d79c5a15a660d3 (diff)
downloadmeta-mingw-24a5b74daf327fef16a75481eff4bacae0ac6e0d.tar.gz
nativesdk-mingw-w64-winpthreads: Implement __udivmoddi4
Fixes build with gcc 11+ Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--recipes-devtools/mingw-w64/files/0001-winpthreads-Add-__udivmoddi4.patch52
-rw-r--r--recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_8.0.0.bb2
2 files changed, 54 insertions, 0 deletions
diff --git a/recipes-devtools/mingw-w64/files/0001-winpthreads-Add-__udivmoddi4.patch b/recipes-devtools/mingw-w64/files/0001-winpthreads-Add-__udivmoddi4.patch
new file mode 100644
index 0000000..3eb298e
--- /dev/null
+++ b/recipes-devtools/mingw-w64/files/0001-winpthreads-Add-__udivmoddi4.patch
@@ -0,0 +1,52 @@
1From 3b0af7327446ae179dc93b6a6ab1074251d348d0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 30 Apr 2021 16:50:36 -0700
4Subject: [PATCH] winpthreads: Add __udivmoddi4
5
6Newer GCC ( 11.1.0+ ) is generating calls to __udivmoddi4 on i686
7architecture, therefore provide an implementation to avoid undefined
8references
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 .../winpthreads/src/libgcc/dll_math.c | 16 +++++++++++++++-
14 1 file changed, 15 insertions(+), 1 deletion(-)
15
16diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
17index aeec068..d170967 100644
18--- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
19+++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
20@@ -121,6 +121,7 @@ u_quad_t __udivdi3(u_quad_t a, u_quad_t b);
21 u_quad_t __umoddi3(u_quad_t a, u_quad_t b);
22 int __ucmpdi2(u_quad_t a, u_quad_t b);
23 quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem);
24+u_quad_t __udivmoddi4(u_quad_t a, u_quad_t b, u_quad_t *rem);
25
26 #endif /* !_LIBKERN_QUAD_H_ */
27
28@@ -573,7 +574,20 @@ __divmoddi4(a, b, rem)
29 return (negq ? -uq : uq);
30 }
31
32+/*
33+ * Divide two unsigned quads.
34+ * This function is new in GCC 7.
35+ */
36+u_quad_t
37+__udivmoddi4(a, b, rem)
38+ u_quad_t a, b, *rem;
39+{
40+ u_quad_t q = __udivdi3(a, b);
41+ if (rem)
42+ *rem = a - b * q;
43+ return q;
44+}
45+
46 #else
47 static int __attribute__((unused)) dummy;
48 #endif /*deined (_X86_) && !defined (__x86_64__)*/
49-
50--
512.31.1
52
diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_8.0.0.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_8.0.0.bb
index e694e5b..814268d 100644
--- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_8.0.0.bb
+++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_8.0.0.bb
@@ -2,6 +2,8 @@ DESCRIPTION = "Winpthreads runtime libraries from MinGW-w64 project"
2 2
3require mingw-w64.inc 3require mingw-w64.inc
4 4
5SRC_URI += "file://0001-winpthreads-Add-__udivmoddi4.patch;striplevel=3"
6
5S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" 7S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads"
6B = "${WORKDIR}/build-${TARGET_SYS}" 8B = "${WORKDIR}/build-${TARGET_SYS}"
7 9