diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-04-30 16:59:20 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-01 13:07:35 +0100 |
commit | 24a5b74daf327fef16a75481eff4bacae0ac6e0d (patch) | |
tree | b699bec4c018f1ffbb7b55ff7f7d0eb971faa8f7 | |
parent | abe46b65452eff84232b9f9152d79c5a15a660d3 (diff) |
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.patch | 52 | ||||
-rw-r--r-- | recipes-devtools/mingw-w64/nativesdk-mingw-w64-winpthreads_8.0.0.bb | 2 |
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 @@ +From 3b0af7327446ae179dc93b6a6ab1074251d348d0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 30 Apr 2021 16:50:36 -0700 +Subject: [PATCH] winpthreads: Add __udivmoddi4 + +Newer GCC ( 11.1.0+ ) is generating calls to __udivmoddi4 on i686 +architecture, therefore provide an implementation to avoid undefined +references + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + .../winpthreads/src/libgcc/dll_math.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c +index aeec068..d170967 100644 +--- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c ++++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c +@@ -121,6 +121,7 @@ u_quad_t __udivdi3(u_quad_t a, u_quad_t b); + u_quad_t __umoddi3(u_quad_t a, u_quad_t b); + int __ucmpdi2(u_quad_t a, u_quad_t b); + quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); ++u_quad_t __udivmoddi4(u_quad_t a, u_quad_t b, u_quad_t *rem); + + #endif /* !_LIBKERN_QUAD_H_ */ + +@@ -573,7 +574,20 @@ __divmoddi4(a, b, rem) + return (negq ? -uq : uq); + } + ++/* ++ * Divide two unsigned quads. ++ * This function is new in GCC 7. ++ */ ++u_quad_t ++__udivmoddi4(a, b, rem) ++ u_quad_t a, b, *rem; ++{ ++ u_quad_t q = __udivdi3(a, b); ++ if (rem) ++ *rem = a - b * q; ++ return q; ++} ++ + #else + static int __attribute__((unused)) dummy; + #endif /*deined (_X86_) && !defined (__x86_64__)*/ +- +-- +2.31.1 + 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" require mingw-w64.inc +SRC_URI += "file://0001-winpthreads-Add-__udivmoddi4.patch;striplevel=3" + S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" B = "${WORKDIR}/build-${TARGET_SYS}" |