summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorLuke Potgieter <fried.roadkill+ght@gmail.com>2017-10-09 04:19:17 (GMT)
committerTony Theodore <tonyt@logyst.com>2017-10-09 04:28:11 (GMT)
commita966448a7c1233e9b245d51a13bc597f0e71246e (patch)
treea435b68e5890a82a740170c01ff9c704a2c02cee /plugins
parenta6351242b673d25d6ff1812cbacf635121610b62 (diff)
downloadmxe-a966448a7c1233e9b245d51a13bc597f0e71246e.zip
mxe-a966448a7c1233e9b245d51a13bc597f0e71246e.tar.gz
mxe-a966448a7c1233e9b245d51a13bc597f0e71246e.tar.bz2
mingw-w64: fix gcc7 build
Taken from and fixes #1782 Add to gcc7 plugin since it breaks opencv and cgal for gcc5
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gcc7/gcc7-overlay.mk3
-rw-r--r--plugins/gcc7/mingw-w64-1-fixes.patch90
2 files changed, 93 insertions, 0 deletions
diff --git a/plugins/gcc7/gcc7-overlay.mk b/plugins/gcc7/gcc7-overlay.mk
index 90a7a8e..3dad13d 100644
--- a/plugins/gcc7/gcc7-overlay.mk
+++ b/plugins/gcc7/gcc7-overlay.mk
@@ -23,3 +23,6 @@ $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
$(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := https://ftp.gnu.org/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_PATCHES := $(dir $(lastword $(MAKEFILE_LIST)))/gcc7.patch
+
+# use mingw-w64 patch from #1782 - breaks cgal and opencv for gcc5
+mingw-w64_PATCHES := $(dir $(lastword $(MAKEFILE_LIST)))/mingw-w64-1-fixes.patch
diff --git a/plugins/gcc7/mingw-w64-1-fixes.patch b/plugins/gcc7/mingw-w64-1-fixes.patch
new file mode 100644
index 0000000..ae39ece
--- /dev/null
+++ b/plugins/gcc7/mingw-w64-1-fixes.patch
@@ -0,0 +1,90 @@
+This file is part of MXE. See LICENSE.md for licensing information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mark Brand <mabrand@mabrand.nl>
+Date: Sun, 29 Mar 2015 14:36:38 +0200
+Subject: [PATCH] workaround for -isystem flag messing up include order
+
+https://bugzilla.redhat.com/show_bug.cgi?id=843436
+
+diff --git a/mingw-w64-headers/crt/float.h b/mingw-w64-headers/crt/float.h
+index 1111111..2222222 100644
+--- a/mingw-w64-headers/crt/float.h
++++ b/mingw-w64-headers/crt/float.h
+@@ -114,6 +114,15 @@
+ #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
+ #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
+
++ /* The difference between 1 and the least value greater than 1 that is
++ representable in the given floating point type, b**1-p. */
++ #undef FLT_EPSILON
++ #undef DBL_EPSILON
++ #undef LDBL_EPSILON
++ #define FLT_EPSILON __FLT_EPSILON__
++ #define DBL_EPSILON __DBL_EPSILON__
++ #define LDBL_EPSILON __LDBL_EPSILON__
++
+ /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
+ /* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
+ #undef FLT_ROUNDS
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Luke Potgieter <fried.roadkill+ght@gmail.com>
+Date: Wed, 6 Sep 2017 18:21:27 +0200
+Subject: [PATCH] Fixes an issue where gcc 7.x cannot be build for the
+ i686-w64-mingw32.shared target, as per the borrowed solution from the thread:
+ https://sourceforge.net/p/mingw-w64/mailman/message/35828144/ MinGW-w64
+ upstream have applied the same codefix to their repository:
+ https://sourceforge.net/p/mingw-w64/mingw-w64/ci/431ac2a912708546cd7271332e9331399e66bc62/
+ All we need do is wait for version > 5.0.2 to be released, in which case this
+ patch must be removed.
+
+
+diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
+index 1111111..2222222 100644
+--- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
++++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c
+@@ -120,6 +120,7 @@ u_quad_t __qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem);
+ 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);
+
+ #endif /* !_LIBKERN_QUAD_H_ */
+
+@@ -546,7 +547,32 @@ __umoddi3(a, b)
+ (void)__qdivrem(a, b, &r);
+ return (r);
+ }
++
++/*
++ * Divide two signed quads.
++ * This function is new in GCC 7.
++ */
++quad_t
++__divmoddi4(a, b, rem)
++ quad_t a, b, *rem;
++{
++ u_quad_t ua, ub, uq, ur;
++ int negq, negr;
++
++ if (a < 0)
++ ua = -(u_quad_t)a, negq = 1, negr = 1;
++ else
++ ua = a, negq = 0, negr = 0;
++ if (b < 0)
++ ub = -(u_quad_t)b, negq ^= 1;
++ else
++ ub = b;
++ uq = __qdivrem(ua, ub, &ur);
++ if (rem)
++ *rem = (negr ? -ur : ur);
++ return (negq ? -uq : uq);
++}
++
+ #else
+ static int __attribute__((unused)) dummy;
+ #endif /*deined (_X86_) && !defined (__x86_64__)*/
+-