Mark Brandadd gcc15 plugin20297a31 year agoHistory
121 lines · 4.5 KB · Text
RawDownload
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 2001From: Tony Theodore <tonyt@logyst.com>Date: Sun, 10 May 2020 15:06:47 +1000Subject: [PATCH 1/3] 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.cc b/gcc/config/i386/driver-i386.ccindex 1111111..2222222 100644--- a/gcc/config/i386/driver-i386.cc+++ b/gcc/config/i386/driver-i386.cc@@ -27,7 +27,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" #include "common/config/i386/cpuinfo.h" #include "common/config/i386/i386-isas.h" From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001From: Tony Theodore <tonyt@logyst.com>Date: Sun, 10 May 2020 15:09:58 +1000Subject: [PATCH 2/3] remove hard-coded mingw from paths  diff --git a/gcc/config.gcc b/gcc/config.gccindex 1111111..2222222 100644--- a/gcc/config.gcc+++ b/gcc/config.gcc@@ -2286,7 +2286,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="$target_gtfiles \$(srcdir)/config/mingw/winnt.cc" 	target_gtfiles="$target_gtfiles \$(srcdir)/config/mingw/winnt-dll.cc" 	extra_options="${extra_options} mingw/cygming.opt mingw/mingw.opt"diff --git a/gcc/config/mingw/mingw32.h b/gcc/config/mingw/mingw32.hindex 1111111..2222222 100644--- a/gcc/config/mingw/mingw32.h+++ b/gcc/config/mingw/mingw32.h@@ -232,7 +232,7 @@ along with GCC; see the file COPYING3.  If not see  /* Override startfile prefix defaults.  */ #ifndef STANDARD_STARTFILE_PREFIX_1-#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/"+#define STANDARD_STARTFILE_PREFIX_1 "/lib/" #endif #ifndef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_2 ""@@ -241,7 +241,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 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001From: Liu Hao <lh_mouse@126.com>Date: Wed, 6 May 2020 21:49:18 +0800Subject: [PATCH 3/3] libgomp: Don't hard-code MS printf attributes Source: https://github.com/msys2/MINGW-packages/blob/9501ee2afc8d01dc7d85383e4b22e91c30d93ca7/mingw-w64-gcc/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch Following discussion at https://www.spinics.net/lists/gcchelp/msg51246.html diff --git a/libgomp/libgomp.h b/libgomp/libgomp.hindex 1111111..2222222 100644--- a/libgomp/libgomp.h+++ b/libgomp/libgomp.h@@ -76,6 +76,14 @@ # endif #endif +#include <stdio.h>+#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@@ -181,7 +189,7 @@ team_free (void *ptr)  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)) \@@ -194,11 +202,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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t