From cc3d268764c22b3b6bd69c466e4eade0b9b89f3e Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Wed, 2 Dec 2020 10:49:41 -0600 Subject: [PATCH] Upgrade mingw-w64 to v8.0.0 --- build-mingw-w64.sh | 5 +- ...Don-t-hard-code-MS-printf-attributes.patch | 53 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 mingw-w64-patches/gcc-libgomp-Don-t-hard-code-MS-printf-attributes.patch diff --git a/build-mingw-w64.sh b/build-mingw-w64.sh index d46c9720..836e2a38 100755 --- a/build-mingw-w64.sh +++ b/build-mingw-w64.sh @@ -40,7 +40,7 @@ GCC_SRCTARBALL=gcc-$GCC_VER.tar.xz GCC_URL="https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/$GCC_SRCTARBALL" GCC_SRCDIR=gcc-$GCC_VER -MINGW_W64_GITVER=v7.0.0 +MINGW_W64_GITVER=v8.0.0 MINGW_W64_GITURL="git://git.code.sf.net/p/mingw-w64/mingw-w64" MINGW_W64_SRCDIR=mingw-w64-git @@ -73,6 +73,9 @@ function setup_src { if [ ! -e "$GCC_SRCDIR" ]; then tar -xf "$GCC_SRCTARBALL" ln -s ../$ISL_SRCDIR $GCC_SRCDIR/isl + for f in $(dirname $0)/mingw-w64-patches/gcc-*; do + patch -d "$GCC_SRCDIR" -p1 < $f + done fi if [ ! -e "$MINGW_W64_SRCDIR" ]; then diff --git a/mingw-w64-patches/gcc-libgomp-Don-t-hard-code-MS-printf-attributes.patch b/mingw-w64-patches/gcc-libgomp-Don-t-hard-code-MS-printf-attributes.patch new file mode 100644 index 00000000..fc60b546 --- /dev/null +++ b/mingw-w64-patches/gcc-libgomp-Don-t-hard-code-MS-printf-attributes.patch @@ -0,0 +1,53 @@ +From 05b0bb43124b041da360ba9adcbaab8430be6d18 Mon Sep 17 00:00:00 2001 +From: Liu Hao +Date: Wed, 6 May 2020 21:49:18 +0800 +Subject: [PATCH] libgomp: Don't hard-code MS printf attributes + +--- + libgomp/libgomp.h | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h +index c98c1452bd4..0cc8443f6c2 100644 +--- a/libgomp/libgomp.h ++++ b/libgomp/libgomp.h +@@ -69,6 +69,13 @@ + # endif + #endif + ++#include ++#ifdef __MINGW_PRINTF_FORMAT ++#define PRINTF_FORMAT __MINGW_PRINTF_FORMAT ++#else ++#define PRINTF_FORMAT printf ++#endif ++ + #ifdef HAVE_ATTRIBUTE_VISIBILITY + # pragma GCC visibility push(hidden) + #endif +@@ -180,7 +187,7 @@ extern void gomp_aligned_free (void *); + + extern void gomp_vdebug (int, const char *, va_list); + extern void gomp_debug (int, const char *, ...) +- __attribute__ ((format (printf, 2, 3))); ++ __attribute__ ((format (PRINTF_FORMAT, 2, 3))); + #define gomp_vdebug(KIND, FMT, VALIST) \ + do { \ + if (__builtin_expect (gomp_debug_var, 0)) \ +@@ -193,11 +200,11 @@ extern void gomp_debug (int, const char *, ...) + } while (0) + extern void gomp_verror (const char *, va_list); + extern void gomp_error (const char *, ...) +- __attribute__ ((format (printf, 1, 2))); ++ __attribute__ ((format (PRINTF_FORMAT, 1, 2))); + extern void gomp_vfatal (const char *, va_list) + __attribute__ ((noreturn)); + extern void gomp_fatal (const char *, ...) +- __attribute__ ((noreturn, format (printf, 1, 2))); ++ __attribute__ ((noreturn, format (PRINTF_FORMAT, 1, 2))); + + struct gomp_task; + struct gomp_taskgroup; +-- +2.26.2 +