add gcc8 plugin

This commit is contained in:
Mark Brand 2018-05-08 22:55:12 +02:00
parent a08b3225ff
commit b42cd62e9a
4 changed files with 124 additions and 6 deletions

View File

@ -0,0 +1,25 @@
# This file is part of MXE. See LICENSE.md for licensing information.
# override relevant cloog, isl, and gcc variables changed in:
# https://github.com/mxe/mxe/pull/965
#
# simply expanded variables (*_SUBDIR, *_FILE, etc.) need to be set
PKG := cloog
$(PKG)_TARGETS := $(MXE_TARGETS)
PKG := isl
$(PKG)_VERSION := 0.16.1
$(PKG)_CHECKSUM := 412538bb65c799ac98e17e8cfcdacbb257a57362acfaaff254b0fcae970126d2
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
$(PKG)_URL := http://isl.gforge.inria.fr/$($(PKG)_FILE)
$(PKG)_URL_2 := https://gcc.gnu.org/pub/gcc/infrastructure/$($(PKG)_FILE)
PKG := gcc
$(PKG)_VERSION := 8.1.0
$(PKG)_CHECKSUM := 1d1866f992626e61349a1ccd0b8d5253816222cdc13390dcfaa74b093aa2b153
$(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)))/gcc8.patch

60
plugins/gcc8/gcc8.patch Normal file
View File

@ -0,0 +1,60 @@
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: Tony Theodore <tonyt@logyst.com>
Date: Thu, 2 Feb 2017 02:05:50 +1100
Subject: [PATCH 1/2] allow native cpu detection when building with clang
function was disabled for non-gcc5 in:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=b587c12551143c14f023860a1dbdf7316ae71f27;hp=43096b526a9f23008b9769372f11475ae63487bc
clang can build it correctly and this should probably be a feature test
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 1111111..2222222 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
const char *host_detect_local_cpu (int argc, const char **argv);
-#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))
+#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__)) || defined(__clang__)
#include "cpuid.h"
struct cache_desc
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Fri, 6 Apr 2018 13:40:22 +1000
Subject: [PATCH 2/2] remove hard-coded mingw from include path
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 1111111..2222222 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1713,7 +1713,7 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
tmake_file="${tmake_file} i386/t-mingw-w32"
;;
esac
- native_system_header_dir=/mingw/include
+ native_system_header_dir=/include
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
case ${target} in
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 1111111..2222222 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -170,7 +170,7 @@ along with GCC; see the file COPYING3. If not see
/* For native mingw-version we need to take care that NATIVE_SYSTEM_HEADER_DIR
macro contains POSIX-style path. See bug 52947. */
#undef NATIVE_SYSTEM_HEADER_DIR
-#define NATIVE_SYSTEM_HEADER_DIR "/mingw/include"
+#define NATIVE_SYSTEM_HEADER_DIR "/include"
/* Output STRING, a string representing a filename, to FILE.
We canonicalize it to be in Unix format (backslashes are replaced

View File

@ -23,6 +23,7 @@ endef
define $(PKG)_BUILD
cd '$(1)' && ./configure \
CFLAGS='-fno-asynchronous-unwind-tables' \
$(MXE_CONFIGURE_OPTS)
$(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
ln -sf '$(PREFIX)/$(TARGET)/bin/libpng-config' '$(PREFIX)/bin/$(TARGET)-libpng-config'

View File

@ -1,17 +1,17 @@
This file is part of MXE. See LICENSE.md for licensing information.
From 1b750c225c874854ed1fc254b6bee7c50376d537 Mon Sep 17 00:00:00 2001
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
Subject: [PATCH 1/2] 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 5874f4e..c031ce0 100644
index 1111111..2222222 100644
--- a/mingw-w64-headers/crt/float.h
+++ b/mingw-w64-headers/crt/float.h
@@ -105,6 +105,15 @@
@@ -114,6 +114,15 @@
#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
@ -27,6 +27,38 @@ index 5874f4e..c031ce0 100644
/* 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
--
2.1.4
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mateusz <mateuszb@poczta.onet.pl>
Date: Mon, 22 Jan 2018 20:58:48 +0100
Subject: [PATCH 2/2] intrin-impl.h: do not define _xgetbv for GCC 8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GCC 8 from r248028 has defined function _xgetbv and we should
avoid double definition of this function.
Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
index 1111111..2222222 100644
--- a/mingw-w64-headers/include/psdk_inc/intrin-impl.h
+++ b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
@@ -1405,6 +1405,7 @@ __buildmov(__movsd, unsigned __LONG32, "d")
#define __INTRINSIC_DEFINED___movsd
#endif /* __INTRINSIC_PROLOG */
+#if !defined(__GNUC__) || __GNUC__ < 8 /* GCC 8 has already defined _xgetbv */
/* NOTE: This should be in immintrin.h */
#if __INTRINSIC_PROLOG(_xgetbv)
unsigned __int64 _xgetbv(unsigned int);
@@ -1426,6 +1427,7 @@ unsigned __int64 _xgetbv(unsigned int index)
}
#define __INTRINSIC_DEFINED__xgetbv
#endif /* __INTRINSIC_PROLOG */
+#endif /* __GNUC__ < 8 */
#endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */