diff --git a/mingw-w64-gcc-git/0001-Relocate-libintl.patch b/mingw-w64-gcc-git/0001-Relocate-libintl.patch deleted file mode 100644 index 8ab29770ca..0000000000 --- a/mingw-w64-gcc-git/0001-Relocate-libintl.patch +++ /dev/null @@ -1,855 +0,0 @@ -From efd07ed77afe493c33581e641a214e0c3975dbef Mon Sep 17 00:00:00 2001 -From: Erwin Waterlander -Date: Wed, 5 Aug 2015 23:36:03 +0100 -Subject: [PATCH 01/19] Relocate libintl - -The relocatex-libintl patch adds builtin relocation for executables to the -libintl dll. With this patch the programs are automatically relocatable. There -is no need anymore to add relocation code to your program when you use this -libintl DLL. - -The patch was ported from the GnuWin32 port of libintl, which has also builtin -relacation support. - -At the moment the relocation support is only active if you compile with MinGW -for Windows. If you compile for Unix/Linux/Cygwin the functionality is -unchanged. - -See also: -http://waterlan.home.xs4all.nl/libintl.html -http://sourceforge.net/tracker/?func=detail&atid=302435&aid=3003879&group_id=2435 -GnuWin32: http://gnuwin32.sourceforge.net/ - -Great thanks to GnuWin32 maintainer Kees Zeelenberg. - -Erwin Waterlander -waterlan@xs4all.nl -http://waterlan.home.xs4all.nl/ - -Additional "bogus paths for *nix-style paths" fix by Alexey Pavlov - -[jes: fix for 64-bit] - -Signed-off-by: Johannes Schindelin ---- - intl/Makefile.in | 8 +- - intl/bindtextdom.c | 22 ++++ - intl/canonicalize.c | 343 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - intl/canonicalize.h | 18 +++ - intl/relocatex.c | 284 +++++++++++++++++++++++++++++++++++++++++++ - intl/relocatex.h | 41 +++++++ - 6 files changed, 715 insertions(+), 1 deletion(-) - create mode 100644 intl/canonicalize.c - create mode 100644 intl/canonicalize.h - create mode 100644 intl/relocatex.c - create mode 100644 intl/relocatex.h - -diff --git a/intl/Makefile.in b/intl/Makefile.in -index 3dd0b7f..e2b8666 100644 ---- a/intl/Makefile.in -+++ b/intl/Makefile.in -@@ -53,6 +53,7 @@ DEFS = -DHAVE_CONFIG_H - COMPILE = $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(DEFS-$@) $(INCLUDES) - - HEADERS = \ -+ canonicalize.h \ - gmo.h \ - gettextP.h \ - hash-string.h \ -@@ -61,6 +62,7 @@ HEADERS = \ - eval-plural.h \ - localcharset.h \ - relocatable.h \ -+ relocatex.h \ - libgnuintl.h - SOURCES = \ - bindtextdom.c \ -@@ -81,6 +83,8 @@ SOURCES = \ - plural-exp.c \ - localcharset.c \ - relocatable.c \ -+ relocatex.c \ -+ canonicalize.c \ - localename.c \ - log.c \ - osdep.c \ -@@ -104,6 +108,8 @@ OBJECTS = \ - plural-exp.o \ - localcharset.o \ - relocatable.o \ -+ relocatex.o \ -+ canonicalize.o \ - localename.o \ - log.o \ - osdep.o \ -@@ -158,7 +164,7 @@ install-info install-dvi install-ps install-pdf install-html: - $(OBJECTS): config.h libintl.h - bindtextdom.o dcgettext.o dcigettext.o dcngettext.o dgettext.o \ - dngettext.o finddomain.o gettext.o intl-compat.o loadmsgcat.o \ --localealias.o ngettext.o textdomain.o: gettextP.h gmo.h loadinfo.h -+localealias.o ngettext.o textdomain.o: gettextP.h gmo.h loadinfo.h relocatex.h - dcigettext.o loadmsgcat.o: hash-string.h - explodename.o l10nflist.o: loadinfo.h - dcigettext.o loadmsgcat.o plural.o plural-exp.o: plural-exp.h -diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c -index 6faac57..b7a62d5 100644 ---- a/intl/bindtextdom.c -+++ b/intl/bindtextdom.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - #ifdef _LIBC - # include -@@ -91,6 +92,12 @@ static void set_binding_values PARAMS ((const char *domainname, - const char **dirnamep, - const char **codesetp)); - -+#if ENABLE_RELOCATABLE -+# include "relocatex.h" -+#else -+# define relocate(pathname) (pathname) -+#endif -+ - /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP - to be used for the DOMAINNAME message catalog. - If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not -@@ -352,8 +359,23 @@ BINDTEXTDOMAIN (domainname, dirname) - const char *domainname; - const char *dirname; - { -+/* - set_binding_values (domainname, &dirname, NULL); - return (char *) dirname; -+*/ -+ if (!access (dirname, R_OK)) { -+ set_binding_values (domainname, &dirname, NULL); -+ return (char *) dirname; -+ } else { -+ char *locale_dirname, *installdir = strdup (dirname), *s; -+ if ((s = strrchr (installdir, '/'))) *s = '\0'; -+ if ((s = strrchr (installdir, '/'))) *s = '\0'; -+ locale_dirname = relocatex (installdir, dirname); -+ set_binding_values (domainname, (const char **) &locale_dirname, NULL); -+ if (installdir) -+ free (installdir); -+ return (char *) locale_dirname; -+ } - } - - /* Specify the character encoding in which the messages from the -diff --git a/intl/canonicalize.c b/intl/canonicalize.c -new file mode 100644 -index 0000000..5217f30 ---- /dev/null -+++ b/intl/canonicalize.c -@@ -0,0 +1,343 @@ -+/* Return the canonical absolute name of a given file. -+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#ifdef __WIN32__ -+# include -+# include -+//# include -+#endif /* __WIN32__ */ -+#include "canonicalize.h" -+ -+#ifndef MAXSYMLINKS -+# define MAXSYMLINKS 20 -+#endif -+ -+#ifndef __set_errno -+# define __set_errno(Val) errno = (Val) -+#endif -+ -+# ifdef VMS -+ /* We want the directory in Unix syntax, not in VMS syntax. */ -+# define __getcwd(buf, max) getcwd (buf, max, 0) -+# else -+# define __getcwd getcwd -+# endif -+ -+#define weak_alias(local, symbol) -+ -+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ -+ /* Win32, Cygwin, OS/2, DOS */ -+# define ISDIRSEP(C) ((C) == '/' || (C) == '\\') -+#else -+ /* Unix */ -+# define ISDIRSEP(C) ((C) == '/') -+#endif -+ -+#ifdef __WIN32__ -+char *win2unixpath (char *FileName) -+{ -+ char *s = FileName; -+ while (*s) { -+ if (*s == '\\') -+ *s = '/'; -+ *s++; -+ } -+ return FileName; -+} -+#endif -+ -+/* Return the canonical absolute name of file NAME. A canonical name -+ does not contain any `.', `..' components nor any repeated path -+ separators ('/') or symlinks. All path components must exist. If -+ RESOLVED is null, the result is malloc'd; otherwise, if the -+ canonical name is PATH_MAX chars or more, returns null with `errno' -+ set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, -+ returns the name in RESOLVED. If the name cannot be resolved and -+ RESOLVED is non-NULL, it contains the path of the first component -+ that cannot be resolved. If the path can be resolved, RESOLVED -+ holds the same value as the value returned. -+ RESOLVED must be at least PATH_MAX long */ -+ -+static char * -+canonicalize (const char *name, char *resolved) -+{ -+ char *rpath, *dest, *extra_buf = NULL; -+ const char *start, *end, *rpath_limit; -+ long int path_max; -+ int num_links = 0, old_errno; -+ -+ if (name == NULL) -+ { -+ /* As per Single Unix Specification V2 we must return an error if -+ either parameter is a null pointer. We extend this to allow -+ the RESOLVED parameter to be NULL in case the we are expected to -+ allocate the room for the return value. */ -+ __set_errno (EINVAL); -+ return NULL; -+ } -+ -+ if (name[0] == '\0') -+ { -+ /* As per Single Unix Specification V2 we must return an error if -+ the name argument points to an empty string. */ -+ __set_errno (ENOENT); -+ return NULL; -+ } -+#ifdef __WIN32__ -+ { -+ char *lpFilePart; -+ int len; -+// fprintf(stderr, "name: %s\n", name); -+ rpath = resolved ? __builtin_alloca (MAX_PATH) : malloc (MAX_PATH); -+// unix2winpath (name); -+// fprintf(stderr, "name: %s\n", name); -+len = GetFullPathName(name, MAX_PATH, rpath, &lpFilePart); -+/* GetFullPathName returns bogus paths for *nix-style paths, like -+ * /foo/bar - it just prepends current drive to them. Keep them -+ * intact (they need to be for relocation to work!). -+ */ -+if (name[0] == '/') { -+ strncpy (rpath, name, MAX_PATH - 1); -+ rpath[MAX_PATH - 1] = '\0'; -+ len = strlen (rpath); -+} -+// fprintf(stderr, "rpath: %s\n", rpath); -+ if (len == 0) { -+ //set_werrno; -+ return NULL; -+ } -+ if (len > MAX_PATH) { -+ if (resolved) -+ __set_errno(ENAMETOOLONG); -+ else { -+ rpath = realloc(rpath, len + 2); -+ GetFullPathName(name, len, rpath, &lpFilePart); -+// fprintf(stderr, "rpath: %s\n", rpath); -+ } -+ } -+// if ( ISDIRSEP(name[strlen(name)]) && !ISDIRSEP(rpath[len]) ) { -+// rpath[len] = '\\'; -+// rpath[len + 1] = 0; -+// } -+ old_errno = errno; -+ //if (!access (rpath, D_OK) && !ISDIRSEP(rpath[len - 1]) ){ -+ if (!access (rpath, R_OK) && !ISDIRSEP(rpath[len - 1]) ){ -+ rpath[len] = '\\'; -+ rpath[len + 1] = 0; -+ } -+ errno = old_errno; -+ win2unixpath (rpath); -+// fprintf(stderr, "rpath: %s\n", rpath); -+ return resolved ? strcpy(resolved, rpath) : rpath ; -+ } -+#else /* __WIN32__ */ -+ -+#ifdef PATH_MAX -+ path_max = PATH_MAX; -+#else -+ path_max = pathconf (name, _PC_PATH_MAX); -+ if (path_max <= 0) -+ path_max = 1024; -+#endif -+ -+ rpath = resolved ? __builtin_alloca (path_max) : malloc (path_max); -+ rpath_limit = rpath + path_max; -+ -+ if (name[0] != '/') -+ { -+ if (!__getcwd (rpath, path_max)) -+ { -+ rpath[0] = '\0'; -+ goto error; -+ } -+ dest = strchr (rpath, '\0'); -+ } -+ else -+ { -+ rpath[0] = '/'; -+ dest = rpath + 1; -+ } -+ -+ for (start = end = name; *start; start = end) -+ { -+#ifdef _LIBC -+ struct stat64 st; -+#else -+ struct stat st; -+#endif -+ int n; -+ -+ /* Skip sequence of multiple path-separators. */ -+ while (*start == '/') -+ ++start; -+ -+ /* Find end of path component. */ -+ for (end = start; *end && *end != '/'; ++end) -+ /* Nothing. */; -+ -+ if (end - start == 0) -+ break; -+ else if (end - start == 1 && start[0] == '.') -+ /* nothing */; -+ else if (end - start == 2 && start[0] == '.' && start[1] == '.') -+ { -+ /* Back up to previous component, ignore if at root already. */ -+ if (dest > rpath + 1) -+ while ((--dest)[-1] != '/'); -+ } -+ else -+ { -+ size_t new_size; -+ -+ if (dest[-1] != '/') -+ *dest++ = '/'; -+ -+ if (dest + (end - start) >= rpath_limit) -+ { -+ ptrdiff_t dest_offset = dest - rpath; -+ -+ if (resolved) -+ { -+ __set_errno (ENAMETOOLONG); -+ if (dest > rpath + 1) -+ dest--; -+ *dest = '\0'; -+ goto error; -+ } -+ new_size = rpath_limit - rpath; -+ if (end - start + 1 > path_max) -+ new_size += end - start + 1; -+ else -+ new_size += path_max; -+ rpath = realloc (rpath, new_size); -+ rpath_limit = rpath + new_size; -+ if (rpath == NULL) -+ return NULL; -+ -+ dest = rpath + dest_offset; -+ } -+ -+#ifdef _LIBC -+ dest = __mempcpy (dest, start, end - start); -+#else -+ memcpy (dest, start, end - start); -+ dest += end - start; -+#endif -+ *dest = '\0'; -+ -+#ifdef _LIBC -+ if (__lxstat64 (_STAT_VER, rpath, &st) < 0) -+#else -+ if (lstat (rpath, &st) < 0) -+#endif -+ goto error; -+ -+#if HAVE_READLINK -+ if (S_ISLNK (st.st_mode)) -+ { -+ char *buf = __builtin_alloca (path_max); -+ size_t len; -+ -+ if (++num_links > MAXSYMLINKS) -+ { -+ __set_errno (ELOOP); -+ goto error; -+ } -+ -+ n = __readlink (rpath, buf, path_max); -+ if (n < 0) -+ goto error; -+ buf[n] = '\0'; -+ -+ if (!extra_buf) -+ extra_buf = __builtin_alloca (path_max); -+ -+ len = strlen (end); -+ if ((long int) (n + len) >= path_max) -+ { -+ __set_errno (ENAMETOOLONG); -+ goto error; -+ } -+ -+ /* Careful here, end may be a pointer into extra_buf... */ -+ memmove (&extra_buf[n], end, len + 1); -+ name = end = memcpy (extra_buf, buf, n); -+ -+ if (buf[0] == '/') -+ dest = rpath + 1; /* It's an absolute symlink */ -+ else -+ /* Back up to previous component, ignore if at root already: */ -+ if (dest > rpath + 1) -+ while ((--dest)[-1] != '/'); -+ } -+#endif -+ } -+ } -+ if (dest > rpath + 1 && dest[-1] == '/') -+ --dest; -+ *dest = '\0'; -+ -+ return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath; -+ -+error: -+ if (resolved) -+ strcpy (resolved, rpath); -+ else -+ free (rpath); -+ return NULL; -+ -+#endif /* __WIN32__ */ -+} -+ -+ -+char * -+__realpath (const char *name, char *resolved) -+{ -+ if (resolved == NULL) -+ { -+ __set_errno (EINVAL); -+ return NULL; -+ } -+ -+ return canonicalize (name, resolved); -+} -+weak_alias (__realpath, realpath) -+ -+ -+char * -+__canonicalize_file_name (const char *name) -+{ -+ return canonicalize (name, NULL); -+} -+weak_alias (__canonicalize_file_name, canonicalize_file_name) -+ -+char * -+canonicalize_file_name (const char *name) -+{ -+ return canonicalize (name, NULL); -+} -diff --git a/intl/canonicalize.h b/intl/canonicalize.h -new file mode 100644 -index 0000000..ea707bf ---- /dev/null -+++ b/intl/canonicalize.h -@@ -0,0 +1,18 @@ -+#ifndef __CANONICALIZE_H__ -+#define __CANONICALIZE_H__ 1 -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+char *canonicalize_file_name (const char *name); -+ -+#ifdef __WIN32__ -+char *win2unixpath (char *path); -+#endif -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* __CANONICALIZE_H__ */ -diff --git a/intl/relocatex.c b/intl/relocatex.c -new file mode 100644 -index 0000000..a2b7438 ---- /dev/null -+++ b/intl/relocatex.c -@@ -0,0 +1,284 @@ -+/* Provide relocatable packages. -+ Copyright (C) 2003 Free Software Foundation, Inc. -+ Written by Bruno Haible , 2003. -+ -+ This program is free software; you can redistribute it and/or modify it -+ under the terms of the GNU Library General Public License as published -+ by the Free Software Foundation; either version 2, or (at your option) -+ any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Library General Public License for more details. -+ -+ You should have received a copy of the GNU Library General Public -+ License along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, -+ USA. */ -+ -+ -+/* Specification. */ -+#include -+#define _GNU_SOURCE -+#include -+#include -+#include -+#include -+/* #include */ -+#include "relocatex.h" -+#include "canonicalize.h" -+/* #include */ -+ -+ -+#if defined _WIN32 || defined __WIN32__ -+# define WIN32_LEAN_AND_MEAN -+# include -+//# define __GW32__ -+//# include -+#endif -+#define set_werrno -+ -+#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ -+ /* Win32, Cygwin, OS/2, DOS */ -+# define ISDIRSEP(C) ((C) == '/' || (C) == '\\') -+#else -+ /* Unix */ -+# define ISDIRSEP(C) ((C) == '/') -+#endif -+ -+/* Original installation prefix. */ -+static char *orig_prefix = NULL; -+static size_t orig_prefix_len = 0; -+/* Current installation prefix. */ -+static char *curr_prefix = NULL; -+static size_t curr_prefix_len = 0; -+/* These prefixes do not end in a slash. Anything that will be concatenated -+ to them must start with a slash. */ -+ -+ -+int win2posixpath (const char *winpath, char *posixpath) -+{ -+ strcpy (posixpath, winpath); -+ win2unixpath (posixpath); -+ return 0; -+} -+ -+ -+/* Sets the original and the current installation prefix of this module. -+ Relocation simply replaces a pathname starting with the original prefix -+ by the corresponding pathname with the current prefix instead. Both -+ prefixes should be directory names without trailing slash (i.e. use "" -+ instead of "/"). */ -+static char * -+set_orig_prefix (const char *orig_prefix_arg) -+{ -+ char *memory; -+// printf ("orig_prefix_arg: %s\n", orig_prefix_arg); -+ if (!orig_prefix_arg) { -+ orig_prefix = NULL; -+ orig_prefix_len = 0; -+ return NULL; -+ } -+ if (orig_prefix) -+ free (orig_prefix); -+ -+ memory = canonicalize_file_name (orig_prefix_arg); -+// printf ("memory: %s\n", memory); -+// memory = (char *) malloc (orig_prefix_len + 1); -+ if (!memory) { -+ set_werrno; -+ orig_prefix = NULL; -+ orig_prefix_len = 0; -+ return NULL; -+ } -+ win2unixpath (memory); -+// win2posixpath (orig_prefix_arg, memory); -+ orig_prefix = memory; -+ orig_prefix_len = strlen (orig_prefix); -+// printf ("orig_prefix: %s\n", orig_prefix); -+ if (ISDIRSEP (orig_prefix[orig_prefix_len-1])) { -+ orig_prefix[orig_prefix_len-1] = '\0'; -+ orig_prefix_len--; -+ } -+// printf ("orig_prefix: %s\n", orig_prefix); -+// printf ("orig_prefix_len: %d\n", orig_prefix_len); -+ return orig_prefix; -+} -+ -+#if defined __WIN32__ -+static char * -+set_current_prefix (const char *ModuleName) -+{ -+ LPTSTR curr_prefix_arg, q, lpFilePart; -+ DWORD len; -+ int nDIRSEP = 0; -+ -+ if (curr_prefix) -+ free (curr_prefix); -+ curr_prefix_arg = malloc (MAX_PATH * sizeof (TCHAR)); -+ if (!curr_prefix_arg) { -+ set_werrno; -+ curr_prefix = NULL; -+ curr_prefix_len = 0; -+ return NULL; -+ } -+ if (ModuleName) { -+// printf ("ModuleName: %s\n", ModuleName); -+ len = SearchPath (NULL, ModuleName, ".DLL", MAX_PATH, curr_prefix_arg, &lpFilePart); -+ if (len) { -+// printf ("ModulePath: %s\n", curr_prefix_arg); -+// printf ("FilePart: %s\n", lpFilePart); -+ } -+ } -+ if (!ModuleName || !len) { -+ len = GetModuleFileName (NULL, curr_prefix_arg, MAX_PATH); -+ if (!len) { -+ set_werrno; -+ curr_prefix = NULL; -+ curr_prefix_len = 0; -+ return NULL; -+ } -+ } -+// strncpy (curr_prefix_arg, ModuleName, MAX_PATH); -+// printf ("curr_prefix_arg: %s\n", curr_prefix_arg); -+ win2posixpath (curr_prefix_arg, curr_prefix_arg); -+ curr_prefix = curr_prefix_arg; -+ q = curr_prefix_arg + len - 1; -+ /* strip name of executable and its directory */ -+ while (!ISDIRSEP (*q) && (q > curr_prefix_arg) && nDIRSEP < 2) { -+ q--; -+ if (ISDIRSEP (*q)) { -+ *q = '\0'; -+ nDIRSEP++; -+ } -+ } -+ curr_prefix_len = q - curr_prefix_arg; -+// printf ("curr_prefix: %s\n", curr_prefix); -+// printf ("curr_prefix_len: %d\n", curr_prefix_len); -+ return curr_prefix; -+} -+ -+char *getshortpath (const char *longpath) -+{ -+ char *shortpath = NULL; -+ DWORD len, res; -+ -+// printf ("longpath: %s\n", longpath); -+ len = GetShortPathName(longpath, shortpath, 0); -+// printf ("len: %ld\n", len); -+ if (!len) { -+// WinErr ("getshortpath: len = 0"); -+ set_werrno; -+ return (char *) longpath; -+ } -+ shortpath = (char *) malloc (len + 1); -+ if (!shortpath) { -+// WinErr ("getshortpath: malloc"); -+ set_werrno; -+ return (char *) longpath; -+ } -+ res = GetShortPathName(longpath, shortpath, len); -+// printf ("res: %ld\n", res); -+ if (!res) { -+// WinErr ("getshortpath: res = 0"); -+ free (shortpath); -+ set_werrno; -+ return (char *) longpath; -+ } -+// printf ("shortpath: %s\n", shortpath); -+ return shortpath; -+} -+ -+char *relocaten (const char *ModuleName, const char *path) -+{ -+ char *relative_path, *relocated_path, *relocated_short_path; -+ int relative_path_len; -+ -+ if (!curr_prefix) -+ set_current_prefix (ModuleName); -+// printf ("path: %s\n", path); -+// printf ("orig_prefix: %s\n", orig_prefix); -+// printf ("curr_prefix: %s\n", curr_prefix); -+// if (strncmp (orig_prefix, path, orig_prefix_len)) -+// if (strcmp (orig_prefix, path)) -+// return (char *) path; -+ relative_path = (char *) path + orig_prefix_len; -+// printf ("relative_path: %s\n", relative_path); -+ relative_path_len = strlen (relative_path); -+ relocated_path = malloc (curr_prefix_len + relative_path_len + 1); -+ strcpy (relocated_path, curr_prefix); -+ strcat (relocated_path, relative_path); -+// printf ("relocated_path: %s\n", relocated_path); -+ relocated_short_path = getshortpath (relocated_path); -+// printf ("relocated_short_path: %s\n", relocated_short_path); -+ if (relocated_short_path) { -+ if (relocated_short_path != relocated_path) -+ free (relocated_path); -+ return relocated_short_path; -+ } else -+ return relocated_path; -+} -+ -+#else // __WIN32__ -+char *relocaten (const char *ModuleName, const char *path) -+{ -+ // dummy function for Unix/Linux -+ return (char *)path; -+} -+#endif -+ -+char *relocaten2 (const char *ModuleName, const char *installdir, const char *path) -+{ -+ set_orig_prefix (installdir); -+ return relocaten (ModuleName, path); -+} -+ -+char *relocatenx (const char *ModuleName, const char *installdir, const char *path) -+{ -+ char *p; -+ -+ set_orig_prefix (installdir); -+ if (access (path, R_OK)) -+ p = relocaten (ModuleName, path); -+ else -+ p = (char *) path; -+// printf ("relocatenx: %s\n", p); -+ return p; -+} -+ -+char *relocate2 (const char *installdir, const char *path) -+{ -+ return relocaten2 (NULL, installdir, path); -+} -+ -+char *relocatex (const char *installdir, const char *path) -+{ -+ return relocatenx (NULL, installdir, path); -+} -+ -+char *relocatepx (const char *cprefix, const char *installdir, const char *path) -+{ -+ if (curr_prefix) -+ free (curr_prefix); -+ curr_prefix = strdup (cprefix); -+ return relocatex (installdir, path); -+} -+ -+static char *get_orig_prefix (void) -+{ -+ return orig_prefix; -+} -+ -+static char *get_curr_prefix (void) -+{ -+ return curr_prefix; -+} -+ -+static char *set_curr_prefix (const char *ModuleName) -+{ -+ if (curr_prefix) -+ free (curr_prefix); -+ set_current_prefix (ModuleName); -+ return curr_prefix; -+} -diff --git a/intl/relocatex.h b/intl/relocatex.h -new file mode 100644 -index 0000000..5cc7c51 ---- /dev/null -+++ b/intl/relocatex.h -@@ -0,0 +1,41 @@ -+/* -+ Copyright (C) 2006 Free Software Foundation, Inc. -+ This file is part of the GnuWin C Library. -+ -+ The GnuWin C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GnuWin C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GnuWin32 C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#ifndef __RELOCATE_H__ -+#define __RELOCATE_H__ 1 -+ -+/* #include */ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+char *relocaten (const char *ModuleName, const char *path); -+char *relocaten2 (const char *ModuleName, const char *installdir, const char *path); -+char *relocatenx (const char *ModuleName, const char *installdir, const char *path); -+char *relocate2 (const char *installdir, const char *path); -+char *relocatex (const char *installdir, const char *path); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+//#endif /* __GW32__ */ -+ -+#endif /* __RELOCATE_H__ */ --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0002-Windows-Follow-Posix-dir-exists-semantics-more-close.patch b/mingw-w64-gcc-git/0002-Windows-Follow-Posix-dir-exists-semantics-more-close.patch deleted file mode 100644 index 5882f712a4..0000000000 --- a/mingw-w64-gcc-git/0002-Windows-Follow-Posix-dir-exists-semantics-more-close.patch +++ /dev/null @@ -1,130 +0,0 @@ -From b69c4aa211f39ef6ffb11bb0f4956904d424eeda Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Wed, 5 Aug 2015 23:36:07 +0100 -Subject: [PATCH 02/19] Windows: Follow Posix dir-exists semantics more closely - -Make Windows behave the same as Posix in the consideration -of whether folder "/doesnt-exist/.." is a valid -path. In Posix, it isn't. - -A concrete instance of when this matters is when cross -compiling GNU/Linux glibc on Windows. ---- - libcpp/files.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 87 insertions(+) - -diff --git a/libcpp/files.c b/libcpp/files.c -index 5aa8d1a..df95f6d 100644 ---- a/libcpp/files.c -+++ b/libcpp/files.c -@@ -30,6 +30,13 @@ along with this program; see the file COPYING3. If not see - #include "md5.h" - #include - -+/* Needed for stat_st_mode_symlink below */ -+#if defined(_WIN32) -+# include -+# define S_IFLNK 0xF000 -+# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -+#endif -+ - /* Variable length record files on VMS will have a stat size that includes - record control characters that won't be included in the read size. */ - #ifdef VMS -@@ -198,6 +205,49 @@ static int pchf_save_compare (const void *e1, const void *e2); - static int pchf_compare (const void *d_p, const void *e_p); - static bool check_file_against_entries (cpp_reader *, _cpp_file *, bool); - -+#if defined(_WIN32) -+ -+static int stat_st_mode_symlink (char const* path, struct stat* buf) -+{ -+ WIN32_FILE_ATTRIBUTE_DATA attr; -+ memset(buf,0,sizeof(*buf)); -+ int err = GetFileAttributesExA (path, GetFileExInfoStandard, &attr) ? 0 : 1; -+ if (!err) -+ { -+ WIN32_FIND_DATAA finddata; -+ HANDLE h = FindFirstFileA (path, &finddata); -+ if (h != INVALID_HANDLE_VALUE) -+ { -+ FindClose (h); -+ if ((finddata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) && -+ (finddata.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) -+ buf->st_mode = S_IFLNK; -+ else if (finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) -+ buf->st_mode = S_IFDIR; -+ else if (finddata.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE) -+ buf->st_mode = S_IFDIR; -+ else -+ buf->st_mode = S_IFREG; -+ buf->st_mode |= S_IREAD; -+ if (!(finddata.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) -+ buf->st_mode |= S_IWRITE; -+ } -+ else -+ { -+ buf->st_mode = S_IFDIR; -+ } -+ return 0; -+ } -+ return -1; -+} -+ -+#else -+ -+#define stat_st_mode_symlink (_name, _buf) stat ((_name), (_buf)) -+ -+#endif -+ -+ - /* Given a filename in FILE->PATH, with the empty string interpreted - as , open it. - -@@ -227,6 +277,43 @@ open_file (_cpp_file *file) - } - else - file->fd = open (file->path, O_RDONLY | O_NOCTTY | O_BINARY, 0666); -+#if defined(_WIN32) || defined(__CYGWIN__) -+ /* Windows and Posix differ in the face of paths of the form: -+ nonexistantdir/.. in that Posix will return ENOENT whereas -+ Windows won't care that we stepped into a non-existant dir -+ Only do these slow checks if ".." appears in file->path. -+ Cygwin also suffers from the same problem (but doesn't need -+ a new stat function): -+ http://cygwin.com/ml/cygwin/2013-05/msg00222.html -+ */ -+ if (file->fd > 0) -+ { -+ char filepath[MAX_PATH]; -+ strncpy (filepath, file->path, sizeof(filepath) - 1); -+ char* dirsep = &filepath[0]; -+ while ( (dirsep = strchr (dirsep, '\\')) != NULL) -+ *dirsep = '/'; -+ if (strstr(file->path, "/../")) -+ { -+ dirsep = &filepath[0]; -+ char dirsepc; -+ /* Check each directory in the chain. */ -+ while ( (dirsep = strpbrk (dirsep, "\\/")) != NULL) -+ { -+ dirsepc = *(++dirsep); -+ *dirsep = '\0'; -+ if (stat_st_mode_symlink (filepath, &file->st) == -1) -+ { -+ *dirsep = dirsepc; -+ close (file->fd); -+ file->fd = -1; -+ return false; -+ } -+ *dirsep++ = dirsepc; -+ } -+ } -+ } -+#endif - - if (file->fd != -1) - { --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0003-Windows-Use-not-in-progpath-and-leave-case-as-is.patch b/mingw-w64-gcc-git/0003-Windows-Use-not-in-progpath-and-leave-case-as-is.patch deleted file mode 100644 index 86062d3cdf..0000000000 --- a/mingw-w64-gcc-git/0003-Windows-Use-not-in-progpath-and-leave-case-as-is.patch +++ /dev/null @@ -1,60 +0,0 @@ -From f75fd3266f9690ea5b7d543600382afcf9be5502 Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Wed, 5 Aug 2015 23:36:09 +0100 -Subject: [PATCH 03/19] Windows: Use '/' not '\' in progpath and leave case - as-is - -Windows can handle both '/' and '\' dirseps. GCC will -have been built using Cygwin, MSYS* or cross-compiled -from a system where dirsep is '/' so it is cleaner to -force the dirseps to be '/' and keep the case as-is. - -This way, the value will be consistent with the build -system and string operations, be they internal to GCC -or external to it (e.g. processing map files with sed) -have a better chance of working as expected. - -A concrete instance of when this matters is when cross -compiling GNU/Linux glibc on Windows. ---- - libiberty/lrealpath.c | 19 +++++++++++++++---- - 1 file changed, 15 insertions(+), 4 deletions(-) - -diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c -index b27c8de..8165984 100644 ---- a/libiberty/lrealpath.c -+++ b/libiberty/lrealpath.c -@@ -138,15 +138,26 @@ lrealpath (const char *filename) - { - char buf[MAX_PATH]; - char* basename; -+ char* slash; - DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename); - if (len == 0 || len > MAX_PATH - 1) - return strdup (filename); - else - { -- /* The file system is case-preserving but case-insensitive, -- Canonicalize to lowercase, using the codepage associated -- with the process locale. */ -- CharLowerBuff (buf, len); -+ /* Turn all back slashes back into forward slashes -+ and don't make it lowercase. -+ Rationale: -+ Windows is as happy with / as it is with \. This will -+ have been built using Cygwin, MSYS* or cross-compiled -+ from a system where dirsep is / so it is cleaner just -+ to keep the dirseps as / (and the case un-modified). -+ This way, the value will be consistent with the build -+ system and string operations (be they internal to this -+ software or external to it, e.g. processing map files -+ with sed) work as expected. */ -+ slash = buf; -+ while ((slash = strchr(slash,'\\')) != NULL) -+ *slash = '/'; - return strdup (buf); - } - } --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0004-Windows-Don-t-ignore-native-system-header-dir.patch b/mingw-w64-gcc-git/0004-Windows-Don-t-ignore-native-system-header-dir.patch deleted file mode 100644 index ba666d589b..0000000000 --- a/mingw-w64-gcc-git/0004-Windows-Don-t-ignore-native-system-header-dir.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 7b4d8cb135724fe4d72048a19f46a29dac4b323e Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Wed, 5 Aug 2015 23:36:11 +0100 -Subject: [PATCH 04/19] Windows: Don't ignore native system header dir - ---- - gcc/config.gcc | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index e26742e..e44cac7 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -1736,7 +1736,10 @@ i[34567]86-*-mingw* | x86_64-*-mingw*) - tmake_file="${tmake_file} i386/t-mingw-w32" - ;; - esac -- native_system_header_dir=/mingw/include -+ # Don't ignore values passed in to configure via --native-system-header-dir -+ if test x$native_system_header_dir = x ; then -+ native_system_header_dir=/mingw/include -+ fi - target_gtfiles="\$(srcdir)/config/i386/winnt.c" - extra_options="${extra_options} i386/cygming.opt i386/mingw.opt" - case ${target} in --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0006-Build-EXTRA_GNATTOOLS-for-Ada.patch b/mingw-w64-gcc-git/0006-Build-EXTRA_GNATTOOLS-for-Ada.patch deleted file mode 100644 index fbad80c9f4..0000000000 --- a/mingw-w64-gcc-git/0006-Build-EXTRA_GNATTOOLS-for-Ada.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 502fd7b40e4f8b5eb8010a568b5ad45427d4e945 Mon Sep 17 00:00:00 2001 -From: Alexey Pavlov -Date: Wed, 5 Aug 2015 23:36:17 +0100 -Subject: [PATCH 06/19] Build EXTRA_GNATTOOLS for Ada - ---- - gnattools/Makefile.in | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in -index 0c889ee..fe3b4b0 100644 ---- a/gnattools/Makefile.in -+++ b/gnattools/Makefile.in -@@ -197,7 +197,7 @@ gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts - ../../gnatmake$(exeext) ../../gnatlink$(exeext) - # gnattools2 - $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \ -- $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools -+ $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools $(EXTRA_GNATTOOLS) - - # gnatmake/link can be built with recent gnatmake/link if they are available. - # This is especially convenient for building cross tools or for rebuilding -@@ -209,7 +209,7 @@ regnattools: $(GCC_DIR)/stamp-gnatlib-rts - gnatmake-re gnatlink-re - # gnattools2 - $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \ -- $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools -+ $(TOOLS_FLAGS_TO_PASS_NATIVE) common-tools $(EXTRA_GNATTOOLS) - - gnattools-cross: $(GCC_DIR)/stamp-tools - # gnattools1-re -@@ -218,7 +218,7 @@ gnattools-cross: $(GCC_DIR)/stamp-tools - gnatmake-re gnatlink-re - # gnattools2 - $(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \ -- $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools -+ $(TOOLS_FLAGS_TO_PASS_CROSS) common-tools $(EXTRA_GNATTOOLS) - # Rename cross tools to where the GCC makefile wants them when - # installing. FIXME: installation should be done elsewhere. - if [ -f $(GCC_DIR)/gnatbind$(exeext) ] ; then \ --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0005-gcc-5-branch-Windows-New-feature-to-allow-overriding-lmsvcrt.patch b/mingw-w64-gcc-git/0006-gcc-5-branch-Windows-New-feature-to-allow-overriding.patch similarity index 88% rename from mingw-w64-gcc-git/0005-gcc-5-branch-Windows-New-feature-to-allow-overriding-lmsvcrt.patch rename to mingw-w64-gcc-git/0006-gcc-5-branch-Windows-New-feature-to-allow-overriding.patch index 31ac4732d8..8a9675eed3 100644 --- a/mingw-w64-gcc-git/0005-gcc-5-branch-Windows-New-feature-to-allow-overriding-lmsvcrt.patch +++ b/mingw-w64-gcc-git/0006-gcc-5-branch-Windows-New-feature-to-allow-overriding.patch @@ -1,7 +1,8 @@ -From 9a5802335d195c8b1bf577bbc00e7905c2ed8226 Mon Sep 17 00:00:00 2001 +From 73c46f52872c95daed5e8bdca52c4b3e0d633c01 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Wed, 5 Aug 2015 23:36:13 +0100 -Subject: [PATCH 07/21] gcc-5-branch Windows: New feature to allow overriding -lmsvcrt +Subject: [PATCH 06/15] gcc-5-branch Windows: New feature to allow overriding + -lmsvcrt Added in support of the MinGW-w64 WIP feature "agile mscvrt dll" where a process' loaded msvc runtime is used by a newly loaded DLL rather than @@ -39,5 +40,5 @@ index f139761..0950304 100644 #undef STARTFILE_SPEC #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ -- -2.5.0 +2.8.1 diff --git a/mingw-w64-gcc-git/0005-master-Windows-New-feature-to-allow-overriding-lmsvcrt.patch b/mingw-w64-gcc-git/0006-master-Windows-New-feature-to-allow-overriding-lmsvcrt.patch similarity index 100% rename from mingw-w64-gcc-git/0005-master-Windows-New-feature-to-allow-overriding-lmsvcrt.patch rename to mingw-w64-gcc-git/0006-master-Windows-New-feature-to-allow-overriding-lmsvcrt.patch diff --git a/mingw-w64-gcc-git/0007-Prettify-linking-no-undefined.patch b/mingw-w64-gcc-git/0007-Prettify-linking-no-undefined.patch deleted file mode 100644 index 00069b85d9..0000000000 --- a/mingw-w64-gcc-git/0007-Prettify-linking-no-undefined.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7e545106faa4b13de2ef56b2c47c0f11f3c77b2a Mon Sep 17 00:00:00 2001 -From: Alexey Pavlov -Date: Wed, 5 Aug 2015 23:36:19 +0100 -Subject: [PATCH 07/19] Prettify linking -no-undefined - -It might be better to put this change in a -conditional block for Windows only? ---- - libgfortran/Makefile.am | 2 +- - libgfortran/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am -index 39d3e11..1425988 100644 ---- a/libgfortran/Makefile.am -+++ b/libgfortran/Makefile.am -@@ -45,7 +45,7 @@ libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP) - cafexeclib_LTLIBRARIES = libcaf_single.la - cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR) - libcaf_single_la_SOURCES = caf/single.c --libcaf_single_la_LDFLAGS = -static -+libcaf_single_la_LDFLAGS = -static -no-undefined - libcaf_single_la_DEPENDENCIES = caf/libcaf.h - libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS) - -diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in -index 7ed080c..67f81d7 100644 ---- a/libgfortran/Makefile.in -+++ b/libgfortran/Makefile.in -@@ -606,7 +606,7 @@ libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP) - cafexeclib_LTLIBRARIES = libcaf_single.la - cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR) - libcaf_single_la_SOURCES = caf/single.c --libcaf_single_la_LDFLAGS = -static -+libcaf_single_la_LDFLAGS = -static -no-undefined - libcaf_single_la_DEPENDENCIES = caf/libcaf.h - libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS) - @IEEE_SUPPORT_TRUE@fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0008-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch b/mingw-w64-gcc-git/0008-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch deleted file mode 100644 index 3758b82f0f..0000000000 --- a/mingw-w64-gcc-git/0008-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 382271305afe34e79980393960565a39f6c55a99 Mon Sep 17 00:00:00 2001 -From: Erik van Pienbroek -Date: Wed, 5 Aug 2015 23:36:21 +0100 -Subject: [PATCH 08/19] gcc: make xmmintrin header cplusplus compatible - [deprecated] - -Deprecated as-per: -http://marc.info/?l=fedora-extras-commits&m=138946782004553&w=2 ---- - gcc/config/i386/xmmintrin.h | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/gcc/config/i386/xmmintrin.h b/gcc/config/i386/xmmintrin.h -index ffe5771..a95d66a 100644 ---- a/gcc/config/i386/xmmintrin.h -+++ b/gcc/config/i386/xmmintrin.h -@@ -64,6 +64,10 @@ _mm_prefetch (const void *__P, enum _mm_hint __I) - #define __DISABLE_SSE__ - #endif /* __SSE__ */ - -+#ifdef __cplusplus -+extern "C" { -+#endif -+ - /* The Intel API is flexible enough that we must allow aliasing with other - vector types, and their scalar components. */ - typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); -@@ -1245,6 +1249,10 @@ do { \ - (row3) = __builtin_ia32_movhlps (__t3, __t2); \ - } while (0) - -+#ifdef __cplusplus -+} -+#endif -+ - /* For backward source compatibility. */ - # include - --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0010-Fix-using-large-PCH.patch b/mingw-w64-gcc-git/0010-Fix-using-large-PCH.patch deleted file mode 100644 index 8cd46846f1..0000000000 --- a/mingw-w64-gcc-git/0010-Fix-using-large-PCH.patch +++ /dev/null @@ -1,154 +0,0 @@ -From 040d65b7bd7e54c44350479b4318e85fd870fb71 Mon Sep 17 00:00:00 2001 -From: Martin Richter -Date: Wed, 5 Aug 2015 23:36:25 +0100 -Subject: [PATCH 10/19] Fix using large PCH - -The following patch fixes segfault when gt_pch_use_address -fails (returns -1). fatal_error now correctly shows an error -message and terminates the program. -I have basicly only reordered reads, and placed them after -the file mapping itself. Global pointers are changed only -after gt_pch_use_address succeeds, so in case of failure -they still contain valid addresses. - -This patch is meant for the master branch. However, it -should not be hard to modify it for others. - -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14940 -https://sourceforge.net/p/mingw-w64/bugs/382/ ---- - gcc/config/i386/host-mingw32.c | 10 ++------- - gcc/ggc-common.c | 51 +++++++++++++++++++++++++++++++++--------- - 2 files changed, 42 insertions(+), 19 deletions(-) - -diff --git a/gcc/config/i386/host-mingw32.c b/gcc/config/i386/host-mingw32.c -index f51219a..903c027 100644 ---- a/gcc/config/i386/host-mingw32.c -+++ b/gcc/config/i386/host-mingw32.c -@@ -42,9 +42,6 @@ static size_t mingw32_gt_pch_alloc_granularity (void); - - static inline void w32_error(const char*, const char*, int, const char*); - --/* FIXME: Is this big enough? */ --static const size_t pch_VA_max_size = 128 * 1024 * 1024; -- - /* Granularity for reserving address space. */ - static size_t va_granularity = 0x10000; - -@@ -86,9 +83,6 @@ static void * - mingw32_gt_pch_get_address (size_t size, int) - { - void* res; -- size = (size + va_granularity - 1) & ~(va_granularity - 1); -- if (size > pch_VA_max_size) -- return NULL; - - /* FIXME: We let system determine base by setting first arg to NULL. - Allocating at top of available address space avoids unnecessary -@@ -98,7 +92,7 @@ mingw32_gt_pch_get_address (size_t size, int) - If we allocate at bottom we need to reserve the address as early - as possible and at the same point in each invocation. */ - -- res = VirtualAlloc (NULL, pch_VA_max_size, -+ res = VirtualAlloc (NULL, size, - MEM_RESERVE | MEM_TOP_DOWN, - PAGE_NOACCESS); - if (!res) -@@ -148,7 +142,7 @@ mingw32_gt_pch_use_address (void *addr, size_t size, int fd, - - /* Offset must be also be a multiple of allocation granularity for - this to work. We can't change the offset. */ -- if ((offset & (va_granularity - 1)) != 0 || size > pch_VA_max_size) -+ if ((offset & (va_granularity - 1)) != 0) - return -1; - - -diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c -index 9b291aa..1861c95 100644 ---- a/gcc/ggc-common.c -+++ b/gcc/ggc-common.c -@@ -598,7 +598,9 @@ gt_pch_restore (FILE *f) - size_t i; - struct mmap_info mmi; - int result; -- -+ long pch_tabs_off; -+ long pch_data_off; -+ - /* Delete any deletable objects. This makes ggc_pch_read much - faster, as it can be sure that no GCable objects remain other - than the ones just read in. */ -@@ -606,20 +608,24 @@ gt_pch_restore (FILE *f) - for (rti = *rt; rti->base != NULL; rti++) - memset (rti->base, 0, rti->stride); - -- /* Read in all the scalar variables. */ -+ /* We need to read tables after mapping, or fatal_error will -+ segfault when gt_pch_use_address returns -1. Skip them for now. */ -+ pch_tabs_off = ftell(f); -+ -+ /* Skip all the scalar variables. */ - for (rt = gt_pch_scalar_rtab; *rt; rt++) - for (rti = *rt; rti->base != NULL; rti++) -- if (fread (rti->base, rti->stride, 1, f) != 1) -- fatal_error (input_location, "can%'t read PCH file: %m"); -+ if (fseek (f, rti->stride, SEEK_CUR) != 0) -+ fatal_error (input_location, "can%'t read PCH file: %m"); - -- /* Read in all the global pointers, in 6 easy loops. */ -+ /* Skip all the global pointers. */ - for (rt = gt_ggc_rtab; *rt; rt++) - for (rti = *rt; rti->base != NULL; rti++) - for (i = 0; i < rti->nelt; i++) -- if (fread ((char *)rti->base + rti->stride * i, -- sizeof (void *), 1, f) != 1) -- fatal_error (input_location, "can%'t read PCH file: %m"); -- -+ if (fseek (f, sizeof (void *), SEEK_CUR) != 0) -+ fatal_error (input_location, "can%'t read PCH file: %m"); -+ -+ /* mmi still has to be read now. */ - if (fread (&mmi, sizeof (mmi), 1, f) != 1) - fatal_error (input_location, "can%'t read PCH file: %m"); - -@@ -630,12 +636,35 @@ gt_pch_restore (FILE *f) - if (result == 0) - { - if (fseek (f, mmi.offset, SEEK_SET) != 0 -- || fread (mmi.preferred_base, mmi.size, 1, f) != 1) -- fatal_error (input_location, "can%'t read PCH file: %m"); -+ || fread (mmi.preferred_base, mmi.size, 1, f) != 1) -+ fatal_error (input_location, "can%'t read PCH file: %m"); - } - else if (fseek (f, mmi.offset + mmi.size, SEEK_SET) != 0) - fatal_error (input_location, "can%'t read PCH file: %m"); -+ -+ /* File mapping done, read tables now. */ -+ pch_data_off = ftell(f); -+ -+ if (fseek (f, pch_tabs_off, SEEK_SET) != 0) -+ fatal_error (input_location, "can%'t read PCH file: %m"); - -+ /* Read in all the scalar variables. */ -+ for (rt = gt_pch_scalar_rtab; *rt; rt++) -+ for (rti = *rt; rti->base != NULL; rti++) -+ if (fread (rti->base, rti->stride, 1, f) != 1) -+ fatal_error (input_location, "can%'t read PCH file: %m"); -+ -+ /* Read in all the global pointers, in 6 easy loops. */ -+ for (rt = gt_ggc_rtab; *rt; rt++) -+ for (rti = *rt; rti->base != NULL; rti++) -+ for (i = 0; i < rti->nelt; i++) -+ if (fread ((char *)rti->base + rti->stride * i, -+ sizeof (void *), 1, f) != 1) -+ fatal_error (input_location, "can%'t read PCH file: %m"); -+ -+ if (fseek (f, pch_data_off, SEEK_SET) != 0) -+ fatal_error (input_location, "can%'t read PCH file: %m"); -+ - ggc_pch_read (f, mmi.preferred_base); - - gt_pch_restore_stringpool (); --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0011-Enable-shared-gnat-implib.patch b/mingw-w64-gcc-git/0011-Enable-shared-gnat-implib.patch deleted file mode 100644 index f8479f27d9..0000000000 --- a/mingw-w64-gcc-git/0011-Enable-shared-gnat-implib.patch +++ /dev/null @@ -1,39 +0,0 @@ -From f1dcb04c0ff28f11325ef3e16d4b6e8f3eafcfed Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?J=C3=BCrgen=20Pfeifer?= -Date: Wed, 5 Aug 2015 23:36:27 +0100 -Subject: [PATCH 11/19] Enable shared gnat implib - -Provide GNAT runtime import libraries to -allow to link against shared runtime - -Original commit: -https://github.com/Alexpux/MINGW-packages/commit/51b4eb3b702fdb38df0460180c2f8209a686aaec ---- - gcc/ada/gcc-interface/Makefile.in | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in -index 8d91b66..aabe555 100644 ---- a/gcc/ada/gcc-interface/Makefile.in -+++ b/gcc/ada/gcc-interface/Makefile.in -@@ -2887,13 +2887,16 @@ gnatlib-shared-win32: - $(PICFLAG_FOR_TARGET) \ - -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ - $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ -- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB) -+ $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ -+ -Wl,-out-implib,libgnat$(hyphen)$(LIBRARY_VERSION).dll.a \ -+ $(MISCLIB) - cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \ - | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \ - $(PICFLAG_FOR_TARGET) \ - -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ - $(GNATRTL_TASKING_OBJS) \ - $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ -+ -Wl,-out-implib,libgnarl$(hyphen)$(LIBRARY_VERSION).dll.a \ - $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) - - gnatlib-shared-darwin: --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0012-MinGW-w64-Enable-libitm.patch b/mingw-w64-gcc-git/0012-MinGW-w64-Enable-libitm.patch deleted file mode 100644 index 4b9fef2bd8..0000000000 --- a/mingw-w64-gcc-git/0012-MinGW-w64-Enable-libitm.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 38c9b4f3e8b774f11b018e74aa578954576d3a0c Mon Sep 17 00:00:00 2001 -From: LRN -Date: Wed, 5 Aug 2015 23:36:29 +0100 -Subject: [PATCH 12/19] MinGW-w64: Enable libitm - ---- - libitm/Makefile.am | 2 +- - libitm/Makefile.in | 3 ++- - libitm/configure | 17 +++++++++++++++++ - libitm/configure.ac | 1 + - libitm/configure.tgt | 4 ++++ - 5 files changed, 25 insertions(+), 2 deletions(-) - -diff --git a/libitm/Makefile.am b/libitm/Makefile.am -index 1dce82d..0ea39f2 100644 ---- a/libitm/Makefile.am -+++ b/libitm/Makefile.am -@@ -54,7 +54,7 @@ libitm_version_info = -version-info $(libtool_VERSION) - # want or need libstdc++. - libitm_la_DEPENDENCIES = $(libitm_version_dep) - libitm_la_LINK = $(LINK) $(libitm_la_LDFLAGS) --libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) -+libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) $(lt_host_flags) - - libitm_la_SOURCES = \ - aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc barrier.cc beginend.cc \ -diff --git a/libitm/Makefile.in b/libitm/Makefile.in -index 138eeb1..a25c6d2 100644 ---- a/libitm/Makefile.in -+++ b/libitm/Makefile.in -@@ -307,6 +307,7 @@ libtool_VERSION = @libtool_VERSION@ - link_itm = @link_itm@ - localedir = @localedir@ - localstatedir = @localstatedir@ -+lt_host_flags = @lt_host_flags@ - mandir = @mandir@ - mkdir_p = @mkdir_p@ - multi_basedir = @multi_basedir@ -@@ -357,7 +358,7 @@ libitm_version_info = -version-info $(libtool_VERSION) - # want or need libstdc++. - libitm_la_DEPENDENCIES = $(libitm_version_dep) - libitm_la_LINK = $(LINK) $(libitm_la_LDFLAGS) --libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) -+libitm_la_LDFLAGS = $(libitm_version_info) $(libitm_version_script) $(lt_host_flags) - libitm_la_SOURCES = aatree.cc alloc.cc alloc_c.cc alloc_cpp.cc \ - barrier.cc beginend.cc clone.cc eh_cpp.cc local.cc query.cc \ - retry.cc rwlock.cc useraction.cc util.cc sjlj.S tls.cc \ -diff --git a/libitm/configure b/libitm/configure -index 55332bb..8f19e0a 100644 ---- a/libitm/configure -+++ b/libitm/configure -@@ -630,6 +630,7 @@ MAINTAINER_MODE_FALSE - MAINTAINER_MODE_TRUE - enable_static - enable_shared -+lt_host_flags - CXXCPP - CPP - OTOOL64 -@@ -15149,6 +15150,22 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # Only expand once: - - -+case $host in -+ *-cygwin* | *-mingw*) -+ # 'host' will be top-level target in the case of a target lib, -+ # we must compare to with_cross_host to decide if this is a native -+ # or cross-compiler and select where to install dlls appropriately. -+ if test -n "$with_cross_host" && -+ test x"$with_cross_host" != x"no"; then -+ lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"'; -+ else -+ lt_host_flags='-no-undefined -bindir "$(bindir)"'; -+ fi -+ ;; -+ *) -+ lt_host_flags= -+ ;; -+esac - - - -diff --git a/libitm/configure.ac b/libitm/configure.ac -index 3875aa0..574afb9 100644 ---- a/libitm/configure.ac -+++ b/libitm/configure.ac -@@ -147,6 +147,7 @@ AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes") - - # Configure libtool - AM_PROG_LIBTOOL -+ACX_LT_HOST_FLAGS - AC_SUBST(enable_shared) - AC_SUBST(enable_static) - -diff --git a/libitm/configure.tgt b/libitm/configure.tgt -index e84382f..adea588 100644 ---- a/libitm/configure.tgt -+++ b/libitm/configure.tgt -@@ -145,6 +145,10 @@ case "${target}" in - # POSIX system. The OS is supported. - ;; - -+ *-*-mingw*) -+ # POSIX system. The OS is supported. -+ ;; -+ - *) # Non-POSIX, or embedded system - UNSUPPORTED=1 - ;; --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0013-MinGW-w64-Enable-libsanitizer.patch b/mingw-w64-gcc-git/0013-MinGW-w64-Enable-libsanitizer.patch deleted file mode 100644 index 3d32213b82..0000000000 --- a/mingw-w64-gcc-git/0013-MinGW-w64-Enable-libsanitizer.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a883299ce617d3e12fc708baded51e8b15277da0 Mon Sep 17 00:00:00 2001 -From: LRN -Date: Wed, 5 Aug 2015 23:36:31 +0100 -Subject: [PATCH 13/19] MinGW-w64: Enable libsanitizer - ---- - libsanitizer/configure.tgt | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt -index 05ead76..1bfd064 100644 ---- a/libsanitizer/configure.tgt -+++ b/libsanitizer/configure.tgt -@@ -41,6 +41,8 @@ case "${target}" in - TSAN_TARGET_DEPENDENT_OBJECTS=tsan_rtl_aarch64.lo - fi - ;; -+ *-*-mingw*) -+ ;; - x86_64-*-darwin[1]* | i?86-*-darwin[1]*) - TSAN_SUPPORTED=no - ;; --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0014-MinGW-w64-Enable-shared-gnat.patch b/mingw-w64-gcc-git/0014-MinGW-w64-Enable-shared-gnat.patch deleted file mode 100644 index bf2d502bc3..0000000000 --- a/mingw-w64-gcc-git/0014-MinGW-w64-Enable-shared-gnat.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 7831e17377252b93fc9e146e766436cb81016da1 Mon Sep 17 00:00:00 2001 -From: LRN -Date: Wed, 5 Aug 2015 23:36:33 +0100 -Subject: [PATCH 14/19] MinGW-w64: Enable shared gnat - ---- - libada/configure | 2 +- - libada/configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libada/configure b/libada/configure -index 2296096..ba488e7 100755 ---- a/libada/configure -+++ b/libada/configure -@@ -2956,7 +2956,7 @@ fi - - - # Determine what to build for 'gnatlib' --if test $build = $target \ -+if test $host = $target \ - && test ${enable_shared} = yes ; then - # Note that build=target is almost certainly the wrong test; FIXME - default_gnatlib_target="gnatlib-shared" -diff --git a/libada/configure.ac b/libada/configure.ac -index 04e06fe..51b5fb2 100644 ---- a/libada/configure.ac -+++ b/libada/configure.ac -@@ -127,7 +127,7 @@ AC_PROG_AWK - AC_PROG_LN_S - - # Determine what to build for 'gnatlib' --if test $build = $target \ -+if test $host = $target \ - && test ${enable_shared} = yes ; then - # Note that build=target is almost certainly the wrong test; FIXME - default_gnatlib_target="gnatlib-shared" --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0015-MinGW-w64-No-fpic-in-sanitizer.patch b/mingw-w64-gcc-git/0015-MinGW-w64-No-fpic-in-sanitizer.patch deleted file mode 100644 index 396c75a4b2..0000000000 --- a/mingw-w64-gcc-git/0015-MinGW-w64-No-fpic-in-sanitizer.patch +++ /dev/null @@ -1,179 +0,0 @@ -From f5c55e9e15576c20994c41ed123875a3b5680ab9 Mon Sep 17 00:00:00 2001 -From: LRN -Date: Wed, 5 Aug 2015 23:36:35 +0100 -Subject: [PATCH 15/19] MinGW-w64: No -fpic in sanitizer - ---- - libsanitizer/asan/Makefile.am | 2 +- - libsanitizer/asan/Makefile.in | 2 +- - libsanitizer/interception/Makefile.am | 2 +- - libsanitizer/interception/Makefile.in | 2 +- - libsanitizer/lsan/Makefile.am | 2 +- - libsanitizer/lsan/Makefile.in | 2 +- - libsanitizer/sanitizer_common/Makefile.am | 2 +- - libsanitizer/sanitizer_common/Makefile.in | 2 +- - libsanitizer/tsan/Makefile.am | 2 +- - libsanitizer/tsan/Makefile.in | 2 +- - libsanitizer/ubsan/Makefile.am | 2 +- - libsanitizer/ubsan/Makefile.in | 2 +- - 12 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am -index 4500e21..03dad11 100644 ---- a/libsanitizer/asan/Makefile.am -+++ b/libsanitizer/asan/Makefile.am -@@ -7,7 +7,7 @@ DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D - if USING_MAC_INTERPOSE - DEFS += -DMAC_INTERPOSE_FUNCTIONS -DMISSING_BLOCKS_SUPPORT - endif --AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -fno-ipa-icf -+AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -fno-ipa-icf - AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) - AM_CXXFLAGS += -std=gnu++11 - ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config -diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in -index 881d1d3..1b2375c 100644 ---- a/libsanitizer/asan/Makefile.in -+++ b/libsanitizer/asan/Makefile.in -@@ -298,7 +298,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) - # May be used by toolexeclibdir. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ -- -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -+ -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti \ - -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ - -Wno-variadic-macros -fno-ipa-icf \ - $(LIBSTDCXX_RAW_CXX_CXXFLAGS) -std=gnu++11 -diff --git a/libsanitizer/interception/Makefile.am b/libsanitizer/interception/Makefile.am -index 4fb69a9..6df9645 100644 ---- a/libsanitizer/interception/Makefile.am -+++ b/libsanitizer/interception/Makefile.am -@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - - DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS --AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -+AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros - AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) - AM_CXXFLAGS += -std=gnu++11 - ACLOCAL_AMFLAGS = -I m4 -diff --git a/libsanitizer/interception/Makefile.in b/libsanitizer/interception/Makefile.in -index c7ccb51..681e7e2 100644 ---- a/libsanitizer/interception/Makefile.in -+++ b/libsanitizer/interception/Makefile.in -@@ -248,7 +248,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) - # May be used by toolexeclibdir. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ -- -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -+ -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti \ - -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ - -Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \ - -std=gnu++11 -diff --git a/libsanitizer/lsan/Makefile.am b/libsanitizer/lsan/Makefile.am -index 03ec4fe..55a1d33 100644 ---- a/libsanitizer/lsan/Makefile.am -+++ b/libsanitizer/lsan/Makefile.am -@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - - DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS --AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -+AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros - AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) - AM_CXXFLAGS += -std=gnu++11 - ACLOCAL_AMFLAGS = -I m4 -diff --git a/libsanitizer/lsan/Makefile.in b/libsanitizer/lsan/Makefile.in -index 4802ed4..18d2f32 100644 ---- a/libsanitizer/lsan/Makefile.in -+++ b/libsanitizer/lsan/Makefile.in -@@ -289,7 +289,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) - # May be used by toolexeclibdir. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ -- -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -+ -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti \ - -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ - -Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \ - -std=gnu++11 -diff --git a/libsanitizer/sanitizer_common/Makefile.am b/libsanitizer/sanitizer_common/Makefile.am -index ee7a3f1..22240ee 100644 ---- a/libsanitizer/sanitizer_common/Makefile.am -+++ b/libsanitizer/sanitizer_common/Makefile.am -@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -isystem $(top_srcdir)/include/system - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - - DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS @RPC_DEFS@ --AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -+AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros - AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) - AM_CXXFLAGS += -std=gnu++11 - if LIBBACKTRACE_SUPPORTED -diff --git a/libsanitizer/sanitizer_common/Makefile.in b/libsanitizer/sanitizer_common/Makefile.in -index 765efd1..4d5c16b 100644 ---- a/libsanitizer/sanitizer_common/Makefile.in -+++ b/libsanitizer/sanitizer_common/Makefile.in -@@ -277,7 +277,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/include -isystem $(top_srcdir)/include/system - # May be used by toolexeclibdir. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ -- -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -+ -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti \ - -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ - -Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \ - -std=gnu++11 $(am__append_1) -diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am -index 6776923..af69f47 100644 ---- a/libsanitizer/tsan/Makefile.am -+++ b/libsanitizer/tsan/Makefile.am -@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - - DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DCAN_SANITIZE_UB=0 @OBSTACK_DEFS@ --AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -+AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros - AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) - AM_CXXFLAGS += -std=gnu++11 - ACLOCAL_AMFLAGS = -I m4 -diff --git a/libsanitizer/tsan/Makefile.in b/libsanitizer/tsan/Makefile.in -index 14a4202..7382c9d 100644 ---- a/libsanitizer/tsan/Makefile.in -+++ b/libsanitizer/tsan/Makefile.in -@@ -304,7 +304,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include - # May be used by toolexeclibdir. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ -- -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -+ -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti \ - -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ - -Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \ - -std=gnu++11 -diff --git a/libsanitizer/ubsan/Makefile.am b/libsanitizer/ubsan/Makefile.am -index 9e70b12..8998edb 100644 ---- a/libsanitizer/ubsan/Makefile.am -+++ b/libsanitizer/ubsan/Makefile.am -@@ -4,7 +4,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - - DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DPIC -DCAN_SANITIZE_UB=1 --AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -+AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros - AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) - AM_CXXFLAGS += -std=gnu++11 - ACLOCAL_AMFLAGS = -I m4 -diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.in -index f5b06d0..59fe4af 100644 ---- a/libsanitizer/ubsan/Makefile.in -+++ b/libsanitizer/ubsan/Makefile.in -@@ -287,7 +287,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include - # May be used by toolexeclibdir. - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ -- -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -+ -Wno-long-long -fno-builtin -fno-exceptions -fno-rtti \ - -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ - -Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \ - -std=gnu++11 --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0016-MinGW-w64-Port-sanitizer.patch b/mingw-w64-gcc-git/0016-MinGW-w64-Port-sanitizer.patch deleted file mode 100644 index e46fc5480d..0000000000 --- a/mingw-w64-gcc-git/0016-MinGW-w64-Port-sanitizer.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 1f0993231ce1318bf73ba6bb76062752bffb13b3 Mon Sep 17 00:00:00 2001 -From: LRN -Date: Wed, 5 Aug 2015 23:36:35 +0100 -Subject: [PATCH 16/19] MinGW-w64: Port sanitizer - ---- - libsanitizer/asan/asan_win.cc | 3 --- - libsanitizer/configure | 30 ++++++++++++++++++++++++++++-- - libsanitizer/configure.ac | 5 +++-- - 3 files changed, 31 insertions(+), 7 deletions(-) - -diff --git a/libsanitizer/asan/asan_win.cc b/libsanitizer/asan/asan_win.cc -index 6c12523..faf3779 100644 ---- a/libsanitizer/asan/asan_win.cc -+++ b/libsanitizer/asan/asan_win.cc -@@ -182,9 +182,6 @@ void MaybeReexec() { - } - - void *AsanDoesNotSupportStaticLinkage() { --#if defined(_DEBUG) --#error Please build the runtime with a non-debug CRT: /MD or /MT --#endif - return 0; - } - -diff --git a/libsanitizer/configure b/libsanitizer/configure -index 040ded0..efe2f45 100755 ---- a/libsanitizer/configure -+++ b/libsanitizer/configure -@@ -629,6 +629,7 @@ TSAN_SUPPORTED_FALSE - TSAN_SUPPORTED_TRUE - enable_static - enable_shared -+lt_host_flags - CXXCPP - OTOOL64 - OTOOL -@@ -15388,6 +15389,31 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -+ -+ -+case $host in -+ *-cygwin* | *-mingw*) -+ # 'host' will be top-level target in the case of a target lib, -+ # we must compare to with_cross_host to decide if this is a native -+ # or cross-compiler and select where to install dlls appropriately. -+ if test -n "$with_cross_host" && -+ test x"$with_cross_host" != x"no"; then -+ lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"'; -+ else -+ lt_host_flags='-no-undefined -bindir "$(bindir)"'; -+ fi -+ ;; -+ *) -+ lt_host_flags= -+ ;; -+esac -+ -+ -+ -+ -+ -+ -+ - for ac_prog in gawk mawk nawk awk - do - # Extract the first word of "$ac_prog", so it can be a program name with args. -@@ -15515,7 +15541,7 @@ done - - - # Common libraries that we need to link against for all sanitizer libs. --link_sanitizer_common='-lpthread -lm' -+link_sanitizer_common="-lpthread -lm $lt_host_flags" - - # At least for glibc, shm_open is in librt. But don't pull that - # in if it still doesn't give us the function we want. This -@@ -15604,7 +15630,7 @@ fi - - - # Set up the set of additional libraries that we need to link against for libasan. --link_libasan=$link_sanitizer_common -+link_libasan="$link_sanitizer_common -ldbghelp" - - - # Set up the set of additional libraries that we need to link against for libtsan. -diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac -index 063b1d6..9265e70 100644 ---- a/libsanitizer/configure.ac -+++ b/libsanitizer/configure.ac -@@ -74,6 +74,7 @@ case "$AWK" in - "") AC_MSG_ERROR([can't build without awk]) ;; - esac - -+ACX_LT_HOST_FLAGS - AC_SUBST(enable_shared) - AC_SUBST(enable_static) - -@@ -96,7 +97,7 @@ AM_CONDITIONAL(LSAN_SUPPORTED, [test "x$LSAN_SUPPORTED" = "xyes"]) - AC_CHECK_FUNCS(clock_getres clock_gettime clock_settime) - - # Common libraries that we need to link against for all sanitizer libs. --link_sanitizer_common='-lpthread -lm' -+link_sanitizer_common="-lpthread -lm $lt_host_flags" - - # At least for glibc, shm_open is in librt. But don't pull that - # in if it still doesn't give us the function we want. This -@@ -109,7 +110,7 @@ AC_CHECK_LIB(dl, dlsym, - [link_sanitizer_common="-ldl $link_sanitizer_common"]) - - # Set up the set of additional libraries that we need to link against for libasan. --link_libasan=$link_sanitizer_common -+link_libasan="$link_sanitizer_common -ldbghelp" - AC_SUBST(link_libasan) - - # Set up the set of additional libraries that we need to link against for libtsan. --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0017-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch b/mingw-w64-gcc-git/0017-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch deleted file mode 100644 index eddd1ebc91..0000000000 --- a/mingw-w64-gcc-git/0017-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 0265871a6dc3b3c57f008ba5d97356bbbecad176 Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Wed, 5 Aug 2015 23:36:39 +0100 -Subject: [PATCH 17/19] Force linking to libgcc_s_dw2-1.dll [deprecated] - -.. by adding to specs: -*libgcc ---undefined=___deregister_frame_info ---undefined=___register_frame_info - -These flags get added twice to the ld command line -because of %G appearing twice in: -*link_gcc_c_sequence -%G %L %G -so this should be tidied up really. - -20150805 update: - -Looking at this again, it seems that the -SHARED_LIBGCC_UNDEFS_SPEC stuff added in commit 7d804f -does the same thing, so my hack may not be needed. It -would appear that for some time, DWARF2_UNWIND_INFO -was not defined, but it's OK now. Latest specs have: -*shared_libgcc_undefs: -%{shared-libgcc: -u ___register_frame_info -u ___deregister_frame_info} ---- - gcc/config/i386/cygwin.h | 6 +++++- - gcc/config/i386/mingw32.h | 8 ++++++-- - 2 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/gcc/config/i386/cygwin.h b/gcc/config/i386/cygwin.h -index 182e4d6..8814bf0 100644 ---- a/gcc/config/i386/cygwin.h -+++ b/gcc/config/i386/cygwin.h -@@ -56,6 +56,10 @@ along with GCC; see the file COPYING3. If not see - fvtable-verify=std:vtv_end.o%s} \ - crtend.o%s" - -+/* There is a bug when building i686 dw-2 exceptions -+ where gcc_s gets stripped which this works around */ -+#define PREVENT_STRIP_REG_FRAME_INFO "--undefined=___deregister_frame_info --undefined=___register_frame_info" -+ - /* Normally, -lgcc is not needed since everything in it is in the DLL, but we - want to allow things to be added to it when installing new versions of - GCC without making a new CYGWIN.DLL, so we leave it. Profiling is handled -@@ -66,7 +70,7 @@ along with GCC; see the file COPYING3. If not see - %{static|static-libgcc:-lgcc -lgcc_eh} \ - %{!static: \ - %{!static-libgcc: \ -- -lgcc_s -lgcc \ -+ -lgcc_s " PREVENT_STRIP_REG_FRAME_INFO " -lgcc \ - } \ - } " - #else -diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h -index f875e7b..d284d89 100644 ---- a/gcc/config/i386/mingw32.h -+++ b/gcc/config/i386/mingw32.h -@@ -120,6 +120,10 @@ along with GCC; see the file COPYING3. If not see - %{shared|mdll: " SUB_LINK_ENTRY " --enable-auto-image-base} \ - %(shared_libgcc_undefs)" - -+/* There is a bug when building i686 dw-2 exceptions -+ where gcc_s gets stripped which this works around */ -+#define PREVENT_STRIP_REG_FRAME_INFO "--undefined=___deregister_frame_info --undefined=___register_frame_info" -+ - /* Include in the mingw32 libraries with libgcc */ - #ifdef ENABLE_SHARED_LIBGCC - #define SHARED_LIBGCC_SPEC " \ -@@ -128,9 +132,9 @@ along with GCC; see the file COPYING3. If not see - %{!static-libgcc: \ - %{!shared: \ - %{!shared-libgcc:-lgcc -lgcc_eh} \ -- %{shared-libgcc:-lgcc_s -lgcc} \ -+ %{shared-libgcc:-lgcc_s " PREVENT_STRIP_REG_FRAME_INFO " -lgcc} \ - } \ -- %{shared:-lgcc_s -lgcc} \ -+ %{shared:-lgcc_s " PREVENT_STRIP_REG_FRAME_INFO " -lgcc} \ - } \ - } " - #else --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0018-MinGW-w64-Disable-libsanitizer.patch b/mingw-w64-gcc-git/0018-MinGW-w64-Disable-libsanitizer.patch deleted file mode 100644 index a798780260..0000000000 --- a/mingw-w64-gcc-git/0018-MinGW-w64-Disable-libsanitizer.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 65d3ecb538446adac3a9780224c4cd0e285e5216 Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Sat, 8 Aug 2015 16:46:03 +0100 -Subject: [PATCH 18/19] MinGW-w64: Disable libsanitizer - -[20150808] Causes a build failure on gcc-5-branch ---- - libsanitizer/configure.tgt | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt -index 1bfd064..924464f 100644 ---- a/libsanitizer/configure.tgt -+++ b/libsanitizer/configure.tgt -@@ -41,8 +41,10 @@ case "${target}" in - TSAN_TARGET_DEPENDENT_OBJECTS=tsan_rtl_aarch64.lo - fi - ;; -- *-*-mingw*) -- ;; -+# [20150808] :: Causes a build failure on gcc-5-branch: -+# mingw-w64-gcc-git\src\build-i686-w64-mingw32\i686-w64-mingw32\libsanitizer\asan/../../../../gcc/libsanitizer/asan/asan_interceptors.cc:722: undefined reference to `_except_handler4_common' -+# *-*-mingw*) -+# ;; - x86_64-*-darwin[1]* | i?86-*-darwin[1]*) - TSAN_SUPPORTED=no - ;; --- -2.7.1 - diff --git a/mingw-w64-gcc-git/0019-clone_function_name_1-Retain-any-stdcall-suffix.patch b/mingw-w64-gcc-git/0019-clone_function_name_1-Retain-any-stdcall-suffix.patch deleted file mode 100644 index f30555bf1a..0000000000 --- a/mingw-w64-gcc-git/0019-clone_function_name_1-Retain-any-stdcall-suffix.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 9fffbbf00e6ce9e91372e544b1e55dc1e6beb3a2 Mon Sep 17 00:00:00 2001 -From: Ray Donnelly -Date: Mon, 17 Aug 2015 22:57:46 +0100 -Subject: [PATCH 19/19] clone_function_name_1: Retain any stdcall suffix - -Previously, clone_function_name_1 would add a suffix after -any existing stdcall suffix, for example ipa-split.c would -clone test@4 as test@4.part.0. - -Later, i386_pe_strip_name_encoding_full would come along -and strip off everything from the last @ onwards which had -the effect of generating incorrect section names which -would then fall over with errors such as: - -error: void test() causes a section type conflict with \ - void test@4.part.0() - -The following testcase, reduced from Firefox can be used -to reproduce this. - -test.ii: -class ClassA { -public: - virtual int __attribute__((__stdcall__)) Dispatch() = 0; -}; -class ClassB { -public: - ClassA* __attribute__((__stdcall__)) operator->(); -}; -class ClassC : ClassA { - int *some_int_ptr_variable; - int __attribute__((__stdcall__)) Dispatch() { - return some_int_ptr_variable - ? 42 - : m_ClassInstanceB->Dispatch(); - } - ClassB m_ClassInstanceB; -}; -ClassC ClassInstanceC; - -Compile for i686-w64-mingw32 with: -cc1plus -O -fpartial-inlining -fdevirtualize \ - -fdevirtualize-speculatively test.ii - -Outputs: -test.ii: In member function 'virtual int ClassC::Dispatch()': -test.ii:11:36: error: virtual int ClassC::Dispatch() causes \ - a section type conflict with int ClassC::_ZN6ClassC8DispatchEv@4.part.0() - int __attribute__((CALLTYPE)) Dispatch() { - ^ -test.ii:11:36: note: \ - 'int ClassC::_ZN6ClassC8DispatchEv@4.part.0()' was declared here ---- - gcc/cgraphclones.c | 13 ++++++++++++- - gcc/defaults.h | 2 +- - 2 files changed, 13 insertions(+), 2 deletions(-) - -diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c -index 354655e..bdb0056 100644 ---- a/gcc/cgraphclones.c -+++ b/gcc/cgraphclones.c -@@ -501,15 +501,24 @@ cgraph_node::create_clone (tree new_decl, gcov_type gcov_count, int freq, - static GTY(()) unsigned int clone_fn_id_num; - - /* Return a new assembler name for a clone with SUFFIX of a decl named -- NAME. */ -+ NAME. Final stdcall @N suffixes are maintained. */ - - tree - clone_function_name_1 (const char *name, const char *suffix) - { - size_t len = strlen (name); - char *tmp_name, *prefix; -+ char *at_suffix = NULL; - - prefix = XALLOCAVEC (char, len + strlen (suffix) + 2); -+ /* name + 1 to skip fastcall which begins with '@' */ -+ at_suffix = strchr (name + 1, '@'); -+ size_t at_suffix_len = 0; -+ if (at_suffix) -+ { -+ at_suffix_len = strlen (at_suffix); -+ len -= at_suffix_len; -+ } - memcpy (prefix, name, len); - strcpy (prefix + len + 1, suffix); - #ifndef NO_DOT_IN_LABEL -@@ -520,6 +529,8 @@ clone_function_name_1 (const char *name, const char *suffix) - prefix[len] = '_'; - #endif - ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix, clone_fn_id_num++); -+ if (at_suffix) -+ strcat (tmp_name, at_suffix); - return get_identifier (tmp_name); - } - -diff --git a/gcc/defaults.h b/gcc/defaults.h -index 3e18338..45d7192 100644 ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -51,7 +51,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ - do { const char *const name_ = (NAME); \ - char *const output_ = (OUTPUT) = \ -- (char *) alloca (strlen (name_) + 32); \ -+ (char *) alloca (strlen (name_) + 35); \ - sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \ - } while (0) - #endif --- -2.7.1 - diff --git a/mingw-w64-gcc-git/PKGBUILD b/mingw-w64-gcc-git/PKGBUILD index 92ee960b56..290d16e6db 100644 --- a/mingw-w64-gcc-git/PKGBUILD +++ b/mingw-w64-gcc-git/PKGBUILD @@ -11,7 +11,7 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-git" "${MINGW_PACKAGE_PREFIX}-${_realname}-fortran-git" "${MINGW_PACKAGE_PREFIX}-${_realname}-ada-git" "${MINGW_PACKAGE_PREFIX}-${_realname}-objc-git") -pkgver=r138945.d346ffc +pkgver=r139182.f1da5ef pkgrel=1 pkgdesc="GCC for the MinGW-w64" arch=('any') @@ -42,46 +42,41 @@ if [ "${_branch}" = "master" ]; then else _realpkgver=5.3.1 fi + source=("git://gcc.gnu.org/git/gcc.git#branch=${_branch}" - "0001-Relocate-libintl.patch" - "0002-Windows-Follow-Posix-dir-exists-semantics-more-close.patch" - "0003-Windows-Use-not-in-progpath-and-leave-case-as-is.patch" - "0004-Windows-Don-t-ignore-native-system-header-dir.patch" - "0005-gcc-5-branch-Windows-New-feature-to-allow-overriding-lmsvcrt.patch" - "0005-master-Windows-New-feature-to-allow-overriding-lmsvcrt.patch" - "0006-Build-EXTRA_GNATTOOLS-for-Ada.patch" - "0007-Prettify-linking-no-undefined.patch" - "0008-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch" + "0001-gcc-5-branch-gfortran-incorrect-reading-of-values-fr.patch" + "0002-Relocate-libintl.patch" + "0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch" + "0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch" + "0005-Windows-Don-t-ignore-native-system-header-dir.patch" + "0006-gcc-5-branch-Windows-New-feature-to-allow-overriding.patch" + "0006-master-Windows-New-feature-to-allow-overriding-lmsvcrt.patch" + "0007-Build-EXTRA_GNATTOOLS-for-Ada.patch" + "0008-Prettify-linking-no-undefined.patch" + "0009-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch" "0010-Fix-using-large-PCH.patch" "0011-Enable-shared-gnat-implib.patch" "0012-MinGW-w64-Enable-libitm.patch" - "0013-MinGW-w64-Enable-libsanitizer.patch" - "0014-MinGW-w64-Enable-shared-gnat.patch" - "0015-MinGW-w64-No-fpic-in-sanitizer.patch" - "0016-MinGW-w64-Port-sanitizer.patch" - "0017-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch" - "0018-MinGW-w64-Disable-libsanitizer.patch" - "0019-clone_function_name_1-Retain-any-stdcall-suffix.patch") + "0013-MinGW-w64-Enable-shared-gnat.patch" + "0014-clone_function_name_1-Retain-any-stdcall-suffix.patch" + "0015-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch") sha256sums=('SKIP' - '85d571d1d64ffdbf3fdf4fb88c8ecdaa8e53ef2a1251636e6f939538934faebe' - 'e18e18f3aed42ad78d3f6d666fefc24809988ce06d766c4d7e99fc63b1eab2ad' - 'cf2df2f2efac87aa6393fe3df2e54e5b6d74d2806bcd26375a400aa3cd3e56de' - 'eccb5995542b2146b030afa7a8f743fd5e12bef54f41550e90bc28437f9a89e9' - 'b4a21a032717e11062a99933f619709f57cd8b821de1e52aaf0b6cacda17df56' + 'eedf62646d0e86bf85252f67bb0a483cdba87cffd2c9b4e29648d277b9ce5a70' + 'ca1b45843b0403e610139792f849ccfaf4383f770951abf03f9666c92be8f814' + '31e21293227c48f3d4be898755690128e8027544962fd5f3f093a1f67b328677' + '6420969c4dfae063ef919691ad55221682ae8c0d7c124e2162230dec71fe0804' + 'f5fdfbfb26922897eca7d05a33cbf86c88008001763faef1c3e20983a54324dc' + '2756200fb73737e2bace3c9b8f37fe7703f0ec8f171a3c303cec5ae7ff669410' 'd1e10cd2ef5594c34acead334bb93af500e00699ba673edc8916da22a572677d' - '2f1c9280a9a379c6a1b91b5b7d7f14db65490bd024b1db4e71834cea73582316' - 'd08cfe014f879cd396eb8af29356d5bedf73495aafd5f0153ad7ddc0dda9059e' - 'eecb90bf47894b886463dbd5e0634fc9003b32686f3a1f498b75b675c3f6c0fc' - 'f9ef7a16105abca37dd6b8bbf5f2318d4f809bb5a8f83a2281c4fcdc2e0d28e4' - '25fec6456b6e97833acd3bafc68013da2f673ced246f7d52fca38057d4a73961' - '63061c3e1d68951659b427df2e1642d5da8ca1da028c793704e265f51042ce62' - 'd9873d516ee813301aebc84d9752f7cecb16385c832c004ccd0fb663e70564b5' - '166c73f6062faa1a3782d2576b9dcb16c2a38d1f5138dc34047800c52f49485e' - 'd40a8019ef8412c554ca90b53851902061a8f90ee9f8ba422852ebcf61c63f2a' - 'de355f346d1097dddbab00742fe761240f13c8b48e8aef57c361e6a3bfb1a675' - '46a87be685919d1f53e1d60ead5525baa04408583586d8d468a0a80ccbbd75c1' - '73231d53fc72bee16bfbb082fa6f2b8e27ecdde2b4535441540f5a36b9a105e6' - 'b478d9de9675b506773f59db5e820b8f72676358d9deaf9324b007ed45de99bf') + '59bad937bd2e4c54f6798ccaad0d19e7022e33ab6178b46877a908c27c5f98b0' + '3e8e2b9c3fd05a6395df29eb5fffed3a4948612ca0d91315afd5f417bb45da28' + 'fb584161496a44340e96a3d1b0b2cb06366752e912850252094f824db410ec5d' + 'e648e0508c5fccf6f7b1da4acc4f93cc47d914a57aaeee8aefe42656561f9e63' + '10612dfa9ea5c813423c780fa8e350cda21c5cba0e11b8befbf9f954922cb6b0' + 'e9919134afd212a8f17349784c71ad821431c70334b24c0103a16a5f419784c6' + 'ec3f39fc5499378a9dc058c001f0903c137233293154276b29ade45d4fc4ce5d' + 'bdfc75d5f2fd231bb3b3368d2938043f842dc83c4b589f1c31d634886bfbbfd5' + 'c3680b070fe917bf6eb323828058255790151d754d50bfe9917774ff7e06cbad') _threads="posix" @@ -92,42 +87,21 @@ pkgver() { prepare() { cd ${srcdir}/${_realname} - - git am "${srcdir}"/0001-Relocate-libintl.patch - git am "${srcdir}"/0002-Windows-Follow-Posix-dir-exists-semantics-more-close.patch - git am "${srcdir}"/0003-Windows-Use-not-in-progpath-and-leave-case-as-is.patch - git am "${srcdir}"/0004-Windows-Don-t-ignore-native-system-header-dir.patch - git am "${srcdir}"/0005-${_branch}-Windows-New-feature-to-allow-overriding-lmsvcrt.patch - git am "${srcdir}"/0006-Build-EXTRA_GNATTOOLS-for-Ada.patch - git am "${srcdir}"/0007-Prettify-linking-no-undefined.patch - git am "${srcdir}"/0008-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch + git am "${srcdir}"/0001-${_branch}-gfortran-incorrect-reading-of-values-fr.patch || true + git am "${srcdir}"/0002-Relocate-libintl.patch + git am "${srcdir}"/0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch + git am "${srcdir}"/0004-Windows-Use-not-in-progpath-and-leave-case-as-is.patch + git am "${srcdir}"/0005-Windows-Don-t-ignore-native-system-header-dir.patch + git am "${srcdir}"/0006-${_branch}-Windows-New-feature-to-allow-overriding.patch + git am "${srcdir}"/0007-Build-EXTRA_GNATTOOLS-for-Ada.patch + git am "${srcdir}"/0008-Prettify-linking-no-undefined.patch + git am "${srcdir}"/0009-gcc-make-xmmintrin-header-cplusplus-compatible-depre.patch git am "${srcdir}"/0010-Fix-using-large-PCH.patch git am "${srcdir}"/0011-Enable-shared-gnat-implib.patch git am "${srcdir}"/0012-MinGW-w64-Enable-libitm.patch - - # TODO :: Move all the sanitizer patches beside each other, and actually, consider - # just dropping them. Reasoning: LRN seems to have stopped updating sbuild, - # these patches were very much WIP, I never even tried to use them once and - # they only apply to the master branch now (since porting them is a burden). - # If things don't improve, next time I work on this package, they're gone. - if [[ "${_branch}" != "gcc-5-branch" ]]; then - git am "${srcdir}"/0013-MinGW-w64-Enable-libsanitizer.patch - fi - - git am "${srcdir}"/0014-MinGW-w64-Enable-shared-gnat.patch - - if [[ "${_branch}" != "gcc-5-branch" ]]; then - git am "${srcdir}"/0015-MinGW-w64-No-fpic-in-sanitizer.patch - git am "${srcdir}"/0016-MinGW-w64-Port-sanitizer.patch - fi - - git am "${srcdir}"/0017-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch - - if [[ "${_branch}" != "gcc-5-branch" ]]; then - git am "${srcdir}"/0018-MinGW-w64-Disable-libsanitizer.patch - fi - - git am "${srcdir}"/0019-clone_function_name_1-Retain-any-stdcall-suffix.patch + git am "${srcdir}"/0013-MinGW-w64-Enable-shared-gnat.patch + git am "${srcdir}"/0014-clone_function_name_1-Retain-any-stdcall-suffix.patch + git am "${srcdir}"/0015-Force-linking-to-libgcc_s_dw2-1.dll-deprecated.patch # do not expect $prefix/mingw symlink - this should be superceded by # 0004-Windows-Don-t-ignore-native-system-header-dir.patch .. but isn't! @@ -213,7 +187,9 @@ build() { package_mingw-w64-gcc-libs-git() { pkgdesc="GNU Compiler Collection (libraries) for MinGW-w64" - depends=("${MINGW_PACKAGE_PREFIX}-gmp" "${MINGW_PACKAGE_PREFIX}-libwinpthread") + depends=("${MINGW_PACKAGE_PREFIX}-gmp" + "${MINGW_PACKAGE_PREFIX}-libwinpthread" + "${MINGW_PACKAGE_PREFIX}-${_realname}-libgfortran-git") provides=("${MINGW_PACKAGE_PREFIX}-${_realname}-libs") conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-libs")