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) | |
download | meta-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.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 @@ | |||
1 | From 3b0af7327446ae179dc93b6a6ab1074251d348d0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 30 Apr 2021 16:50:36 -0700 | ||
4 | Subject: [PATCH] winpthreads: Add __udivmoddi4 | ||
5 | |||
6 | Newer GCC ( 11.1.0+ ) is generating calls to __udivmoddi4 on i686 | ||
7 | architecture, therefore provide an implementation to avoid undefined | ||
8 | references | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | Signed-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 | |||
16 | diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c | ||
17 | index 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 | -- | ||
51 | 2.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 | ||
3 | require mingw-w64.inc | 3 | require mingw-w64.inc |
4 | 4 | ||
5 | SRC_URI += "file://0001-winpthreads-Add-__udivmoddi4.patch;striplevel=3" | ||
6 | |||
5 | S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" | 7 | S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-libraries/winpthreads" |
6 | B = "${WORKDIR}/build-${TARGET_SYS}" | 8 | B = "${WORKDIR}/build-${TARGET_SYS}" |
7 | 9 | ||