summaryrefslogtreecommitdiff
path: root/skip/mingw-w64-gcc
diff options
context:
space:
mode:
Diffstat (limited to 'skip/mingw-w64-gcc')
-rw-r--r--skip/mingw-w64-gcc/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch53
-rw-r--r--skip/mingw-w64-gcc/mingw-w64-gcc.xibuild72
2 files changed, 125 insertions, 0 deletions
diff --git a/skip/mingw-w64-gcc/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch b/skip/mingw-w64-gcc/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
new file mode 100644
index 0000000..fc60b54
--- /dev/null
+++ b/skip/mingw-w64-gcc/0020-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 <lh_mouse@126.com>
+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 <stdio.h>
++#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
+
diff --git a/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild b/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild
new file mode 100644
index 0000000..285a7cb
--- /dev/null
+++ b/skip/mingw-w64-gcc/mingw-w64-gcc.xibuild
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+NAME="mingw-w64-gcc"
+DESC="Cross GCC for the MinGW-w64 cross-compiler"
+
+MAKEDEPS=" zlib mpc1 gmp mpfr"
+
+PKG_VER=12.2.0
+SOURCE="https://ftp.gnu.org/gnu/gcc/gcc-$PKG_VER/gcc-$PKG_VER.tar.xz"
+
+islver=0.25
+
+ADDITIONAL="
+http://libisl.sourceforge.io/isl-$islver.tar.bz2
+0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
+"
+target="x86_64-w64-mingw32"
+
+prepare() {
+ apply_patches
+
+ # link isl for in-tree builds
+ tar xf isl-$islver.tar.bz2
+ ln -sf isl-$islver isl
+
+ mkdir -p "$_gccdir"
+}
+
+build() {
+ export CFLAGS="$CFLAGS -O2"
+ export CXXFLAGS="$CXXFLAGS -O2"
+ export CPPFLAGS="$CPPFLAGS -O2"
+ "$BUILD_ROOT"/configure \
+ --prefix=/usr \
+ --target=$target \
+ --libexecdir=/usr/libexec \
+ --disable-dw2-exceptions \
+ --disable-multilib \
+ --disable-nls \
+ --disable-sjlj-exceptions \
+ --disable-werror \
+ --enable-checking=release \
+ --enable-cloog-backend=isl \
+ --enable-fully-dynamic-string \
+ --enable-languages=c,lto,c++ \
+ --enable-libgomp \
+ --enable-libstdcxx-time=yes \
+ --enable-lto \
+ --enable-shared \
+ --enable-static \
+ --enable-threads=posix \
+ --with-system-zlib
+ make
+}
+
+package() {
+ cd "$_gccdir"
+ make DESTDIR="$PKG_DEST" install
+
+ #$target-strip "$PKG_DEST"/usr/$target/lib/*.dll
+
+ ln -s $target-gcc "$PKG_DEST"/usr/bin/$target-cc
+
+ # Move DLLs
+ mkdir -p "$PKG_DEST"/usr/$target/bin
+ mv "$PKG_DEST"/usr/$target/lib/*.dll "$PKG_DEST"/usr/$target/bin
+
+ # Unnecessary files
+ rm -rf "$PKG_DEST"/usr/share
+ rm "$PKG_DEST"/usr/lib/libcc1.*
+}
+