gcc: update to 13.1.0 on x86_64

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2023-05-04 09:14:40 +01:00
parent 1e5bb2ff2c
commit 8d9ebb7441
16 changed files with 131 additions and 298 deletions

View File

@@ -1,7 +1,7 @@
From 056d1dbaa0c542fde6e0d90a28be9a280967d6d1 Mon Sep 17 00:00:00 2001
From 88f975b3a349be6b927d8f19958b1c20d7248264 Mon Sep 17 00:00:00 2001
From: Erwin Waterlander <waterlan@xs4all.nl>
Date: Wed, 5 Aug 2015 23:36:03 +0100
Subject: [PATCH 01/15] Relocate libintl
Subject: [PATCH] Relocate libintl
The relocatex-libintl patch adds builtin relocation for executables to the
libintl dll. With this patch the programs are automatically relocatable. There
@@ -34,11 +34,11 @@ Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
intl/Makefile.in | 8 +-
intl/bindtextdom.c | 22 +++
intl/canonicalize.c | 343 ++++++++++++++++++++++++++++++++++++++++++++
intl/canonicalize.c | 344 ++++++++++++++++++++++++++++++++++++++++++++
intl/canonicalize.h | 18 +++
intl/relocatex.c | 284 ++++++++++++++++++++++++++++++++++++
intl/relocatex.h | 41 ++++++
6 files changed, 715 insertions(+), 1 deletion(-)
6 files changed, 716 insertions(+), 1 deletion(-)
create mode 100644 intl/canonicalize.c
create mode 100644 intl/canonicalize.h
create mode 100644 intl/relocatex.c
@@ -142,7 +142,7 @@ index 6faac5756a3..1854b651b90 100644
/* 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 00000000000..5217f304540
index 00000000000..636df496e69
--- /dev/null
+++ b/intl/canonicalize.c
@@ -0,0 +1,344 @@
@@ -852,5 +852,5 @@ index 00000000000..5cc7c5174a9
+
+#endif /* __RELOCATE_H__ */
--
2.35.3
2.40.0

View File

@@ -1,7 +1,7 @@
From 8056eedaf6dbdeeb07df72221078223f4bed5161 Mon Sep 17 00:00:00 2001
From 45ca3b9cdd964ec448c2ca56d5258983aef2722b Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 5 Aug 2015 23:36:07 +0100
Subject: [PATCH 02/15] Windows: Follow Posix dir-exists semantics more closely
Subject: [PATCH 02/16] 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
@@ -127,5 +127,5 @@ index 24208f7b0f8..a740d7a778c 100644
if (file->fd != -1)
{
--
2.35.3
2.38.1

View File

@@ -1,60 +0,0 @@
From 2d1c33eeae5af6b2a634778bfb5162606414bce3 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 5 Aug 2015 23:36:09 +0100
Subject: [PATCH 03/15] 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 3c7053b0b70..b9cbf666210 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.35.3

View File

@@ -1,17 +1,17 @@
From 910eea0aa52a3789ccb88343ec6574566e159ede Mon Sep 17 00:00:00 2001
From 7b42c392145bfebc79a5a8dce77dc61f09290a32 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 5 Aug 2015 23:36:11 +0100
Subject: [PATCH 04/15] Windows: Don't ignore native system header dir
Subject: [PATCH 04/16] 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 c5064dd3766..a72fb5bbb74 100644
index 2fbf2e6fa69..f950ba56edc 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2209,7 +2209,10 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
@@ -2138,7 +2138,10 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
tmake_file="${tmake_file} i386/t-mingw-w32"
;;
esac
@@ -24,5 +24,5 @@ index c5064dd3766..a72fb5bbb74 100644
extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
case ${target} in
--
2.35.3
2.38.1

View File

@@ -1,7 +1,7 @@
From 6ff4cbf39895026305654bb5b8bd82f9593803b9 Mon Sep 17 00:00:00 2001
From 45fab34cb60bc221e6debdf9457d382b62cf4017 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 5 Aug 2015 23:36:13 +0100
Subject: [PATCH 05/15] master Windows: New feature to allow overriding
Subject: [PATCH 05/16] master Windows: New feature to allow overriding
-lmsvcrt
Added in support of the MinGW-w64 WIP feature "agile mscvrt dll" where
@@ -27,18 +27,18 @@ index 12435d813f5..5dff2ac1551 100644
Target RejectNegative
Generate code for a DLL.
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index d3ca0cd0279..07dcd6ba97b 100644
index b5f31c3da0a..baf80400862 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -185,7 +185,7 @@ along with GCC; see the file COPYING3. If not see
@@ -196,7 +196,7 @@ along with GCC; see the file COPYING3. If not see
#define REAL_LIBGCC_SPEC \
"%{mthreads:-lmingwthrd} -lmingw32 \
" SHARED_LIBGCC_SPEC " \
- -lmoldname -lmingwex -lmsvcrt -lkernel32"
+ -lmoldname -lmingwex %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*} -lkernel32"
- -lmoldname -lmingwex -lmsvcrt -lkernel32 " MCFGTHREAD_SPEC
+ -lmoldname -lmingwex %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*} -lkernel32 " MCFGTHREAD_SPEC
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
--
2.35.3
2.38.1

View File

@@ -1,7 +1,7 @@
From c231dea93690f8081e38e1888fbf9d77327025a7 Mon Sep 17 00:00:00 2001
From a7c1041c3138dba8fa811490852f37b236a7f368 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexey.pawlow@gmail.com>
Date: Wed, 5 Aug 2015 23:36:17 +0100
Subject: [PATCH 06/15] Build EXTRA_GNATTOOLS for Ada
Subject: [PATCH 06/16] Build EXTRA_GNATTOOLS for Ada
---
gnattools/Makefile.in | 4 ++--
@@ -30,5 +30,5 @@ index e8fc4af0788..f0daadbc1d7 100644
gnattools-cross: $(GCC_DIR)/stamp-tools
# gnattools1-re
--
2.35.3
2.38.1

View File

@@ -1,7 +1,7 @@
From b4c710af7f83e36caed1e2cc9ac4cd0198b44865 Mon Sep 17 00:00:00 2001
From e3d18c5f5b7ffb28146d7d7efef480ccedc4be26 Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexey.pawlow@gmail.com>
Date: Wed, 5 Aug 2015 23:36:19 +0100
Subject: [PATCH 07/15] Prettify linking -no-undefined
Subject: [PATCH 07/16] Prettify linking -no-undefined
It might be better to put this change in a
conditional block for Windows only?
@@ -11,7 +11,7 @@ conditional block for Windows only?
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index 5ce0cd7cd05..bf072610679 100644
index 454ad12e701..cb02b417e6b 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -57,7 +57,7 @@ libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
@@ -24,10 +24,10 @@ index 5ce0cd7cd05..bf072610679 100644
libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
index 7ac6bfba657..3ec67505073 100644
index 23df0761096..14b78ed3569 100644
--- a/libgfortran/Makefile.in
+++ b/libgfortran/Makefile.in
@@ -766,7 +766,7 @@ libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP)
@@ -767,7 +767,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
@@ -37,5 +37,5 @@ index 7ac6bfba657..3ec67505073 100644
libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS)
@IEEE_SUPPORT_TRUE@fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude
--
2.35.3
2.38.1

View File

@@ -1,56 +0,0 @@
From c084ab275f47cc27621e664d1c63e177525cf321 Mon Sep 17 00:00:00 2001
From: LIU Hao <lh_mouse@126.com>
Date: Tue, 10 May 2022 13:19:07 +0800
Subject: [PATCH] Remove size limit of PCH
Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14940
Signed-off-by: LIU Hao <lh_mouse@126.com>
---
gcc/config/i386/host-mingw32.cc | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index 3b0d83ffc60..f915b85abd0 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -44,9 +44,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;
@@ -88,9 +85,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
@@ -100,7 +94,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)
@@ -150,7 +144,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;
--
2.36.0

View File

@@ -1,7 +1,7 @@
From cbe4bbcd9261c2b6d4bb02025685b2047bac4e6d Mon Sep 17 00:00:00 2001
From c0af45f4c4b03154ea5ade26d02e1561223b63d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Pfeifer?= <juergen@familiepfeifer.de>
Date: Wed, 5 Aug 2015 23:36:27 +0100
Subject: [PATCH 09/15] Enable shared gnat implib
Subject: [PATCH 09/16] Enable shared gnat implib
Provide GNAT runtime import libraries to
allow to link against shared runtime
@@ -13,10 +13,10 @@ https://github.com/Alexpux/MINGW-packages/commit/51b4eb3b702fdb38df0460180c2f820
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 1e9801a8b96..a640e51df9d 100644
index 6b19b8be58e..7a7d4eeb18f 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -769,13 +769,16 @@ gnatlib-shared-win32:
@@ -764,12 +764,15 @@ gnatlib-shared-win32:
$(PICFLAG_FOR_TARGET) \
-o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
@@ -24,8 +24,7 @@ index 1e9801a8b96..a640e51df9d 100644
+ $(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 \
cd $(RTSDIR); $(GCC_FOR_ADA_RTS) -shared -shared-libgcc \
$(PICFLAG_FOR_TARGET) \
-o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
@@ -35,5 +34,5 @@ index 1e9801a8b96..a640e51df9d 100644
gnatlib-shared-darwin:
--
2.35.3
2.38.1

View File

@@ -1,17 +1,17 @@
From d40fdef088ea568820d6355d416a04794c2291dc Mon Sep 17 00:00:00 2001
From 7bb1c4dfb29899729c13376cbae8393f201f1e83 Mon Sep 17 00:00:00 2001
From: Olivier Michel <Olivier.Michel@cyberbotics.com>
Date: Fri, 31 May 2019 15:07:06 +0200
Subject: [PATCH 10/15] Handle spaces in path for default manifest
Subject: [PATCH 10/16] Handle spaces in path for default manifest
---
gcc/gcc.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..07f07c1f26f 100644
index afb23cd07b0..8eee9345afe 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -6871,7 +6871,6 @@ eval_spec_function (const char *func, const char *args,
@@ -6829,7 +6829,6 @@ eval_spec_function (const char *func, const char *args,
int save_arg_going;
int save_delete_this_arg;
int save_this_is_output_file;
@@ -19,7 +19,7 @@ index bb07cc244e3..07f07c1f26f 100644
int save_input_from_pipe;
int save_this_is_linker_script;
const char *save_suffix_subst;
@@ -6889,7 +6888,6 @@ eval_spec_function (const char *func, const char *args,
@@ -6847,7 +6846,6 @@ eval_spec_function (const char *func, const char *args,
save_arg_going = arg_going;
save_delete_this_arg = delete_this_arg;
save_this_is_output_file = this_is_output_file;
@@ -27,7 +27,7 @@ index bb07cc244e3..07f07c1f26f 100644
save_this_is_linker_script = this_is_linker_script;
save_input_from_pipe = input_from_pipe;
save_suffix_subst = suffix_subst;
@@ -6921,13 +6919,15 @@ eval_spec_function (const char *func, const char *args,
@@ -6879,13 +6877,15 @@ eval_spec_function (const char *func, const char *args,
argbuf.address ());
/* Pop the spec processing context. */
@@ -44,7 +44,7 @@ index bb07cc244e3..07f07c1f26f 100644
this_is_linker_script = save_this_is_linker_script;
input_from_pipe = save_input_from_pipe;
suffix_subst = save_suffix_subst;
@@ -6999,8 +6999,9 @@ handle_spec_function (const char *p, bool *retval_nonnull,
@@ -6957,8 +6957,9 @@ handle_spec_function (const char *p, bool *retval_nonnull,
/* p now points to just past the end of the spec function expression. */
funcval = eval_spec_function (func, args, soft_matched_part);
@@ -56,5 +56,5 @@ index bb07cc244e3..07f07c1f26f 100644
*retval_nonnull = funcval != NULL;
--
2.35.3
2.38.1

View File

@@ -1,7 +1,7 @@
From e2020cc059570a3c275ba78fe3c8a7bc6f746e50 Mon Sep 17 00:00:00 2001
From 8b5e94ebdce49fc8f7a0926a695110e83cc408ad Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Mon, 17 Aug 2015 22:57:46 +0100
Subject: [PATCH 11/15] clone_function_name_1: Retain any stdcall suffix
Subject: [PATCH 11/16] 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
@@ -51,12 +51,12 @@ test.ii:11:36: error: virtual int ClassC::Dispatch() causes \
test.ii:11:36: note: \
'int ClassC::_ZN6ClassC8DispatchEv@4.part.0()' was declared here
---
gcc/cgraphclones.cc | 14 +++++++++++++-
gcc/cgraphclones.cc | 13 ++++++++++++-
gcc/defaults.h | 2 +-
2 files changed, 14 insertions(+), 2 deletions(-)
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc
index eb0fa87b554..a959040033e 100644
index eb0fa87b554..3bde7e6957e 100644
--- a/gcc/cgraphclones.cc
+++ b/gcc/cgraphclones.cc
@@ -470,7 +470,8 @@ static GTY(()) hash_map<const char *, unsigned> *clone_fn_ids;
@@ -91,7 +91,7 @@ index eb0fa87b554..a959040033e 100644
}
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 7c7a80e596e..c47b32ad49e 100644
index 376687d91b1..be29e4b7c60 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -51,7 +51,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
@@ -104,5 +104,5 @@ index 7c7a80e596e..c47b32ad49e 100644
} while (0)
#endif
--
2.35.3
2.38.1

View File

@@ -1,14 +1,14 @@
From 4617711110effcb0902857d70b9aa13d39b57c0d Mon Sep 17 00:00:00 2001
From f00621c645ca24f8d228bac7b1dbb5763d1f4db3 Mon Sep 17 00:00:00 2001
From: Liu Hao <lh_mouse@126.com>
Date: Wed, 6 May 2020 21:49:18 +0800
Subject: [PATCH 12/15] libgomp: Don't hard-code MS printf attributes
Subject: [PATCH 12/16] libgomp: Don't hard-code MS printf attributes
---
libgomp/libgomp.h | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h
index b9e03919993..bf28ef66e27 100644
index 75192749dc7..add858d2cd3 100644
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -69,6 +69,13 @@
@@ -25,7 +25,7 @@ index b9e03919993..bf28ef66e27 100644
#ifdef HAVE_ATTRIBUTE_VISIBILITY
# pragma GCC visibility push(hidden)
#endif
@@ -177,7 +184,7 @@ team_free (void *ptr)
@@ -176,7 +183,7 @@ team_free (void *ptr)
extern void gomp_vdebug (int, const char *, va_list);
extern void gomp_debug (int, const char *, ...)
@@ -34,7 +34,7 @@ index b9e03919993..bf28ef66e27 100644
#define gomp_vdebug(KIND, FMT, VALIST) \
do { \
if (__builtin_expect (gomp_debug_var, 0)) \
@@ -190,11 +197,11 @@ extern void gomp_debug (int, const char *, ...)
@@ -189,11 +196,11 @@ extern void gomp_debug (int, const char *, ...)
} while (0)
extern void gomp_verror (const char *, va_list);
extern void gomp_error (const char *, ...)
@@ -49,5 +49,5 @@ index b9e03919993..bf28ef66e27 100644
struct gomp_task;
struct gomp_taskgroup;
--
2.35.3
2.38.1

View File

@@ -1,7 +1,7 @@
From 525fd24cc877e2f3f66817908ed0bfec425a473f Mon Sep 17 00:00:00 2001
From cbe91a182184704e76eeac8d47cad7aaff5c9f24 Mon Sep 17 00:00:00 2001
From: LIU Hao <lh_mouse@126.com>
Date: Wed, 11 May 2022 22:42:53 +0800
Subject: [PATCH] [PR14940] Allow a PCH to be mapped to a different address
Subject: [PATCH 13/16] Allow a PCH to be mapped to a different address
First, try mapping the PCH to its original address. If that fails, try
letting the system choose one; the PCH can be relocated thereafter.
@@ -19,10 +19,10 @@ Reference: https://gcc.gnu.org/pipermail/gcc-patches/2022-May/594556.html
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/gcc/config/i386/host-mingw32.cc b/gcc/config/i386/host-mingw32.cc
index 3b0d83ffc606..ec92483b7835 100644
index f915b85abd0..cb254629029 100644
--- a/gcc/config/i386/host-mingw32.cc
+++ b/gcc/config/i386/host-mingw32.cc
@@ -141,7 +141,6 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
@@ -135,7 +135,6 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
and earlier, backslashes are invalid in object name. So, we need
to check if we are on Windows2000 or higher. */
OSVERSIONINFO version_info;
@@ -30,7 +30,7 @@ index 3b0d83ffc606..ec92483b7835 100644
version_info.dwOSVersionInfoSize = sizeof (version_info);
@@ -175,25 +174,24 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
@@ -169,25 +168,24 @@ mingw32_gt_pch_use_address (void *&addr, size_t size, int fd,
return -1;
}
@@ -72,5 +72,5 @@ index 3b0d83ffc606..ec92483b7835 100644
}
--
2.36.1
2.38.1

View File

@@ -1,7 +1,7 @@
From 20897cd296f35272c4fca4f0f5f7bb48e6242758 Mon Sep 17 00:00:00 2001
From 02840e72b20cea4248485462245d4fd3fbe4f385 Mon Sep 17 00:00:00 2001
From: Kai Tietz <ktietz@anaconda.com>
Date: Wed, 21 Apr 2021 07:54:59 +0200
Subject: [PATCH 13/15] add -m(no-)align-vector-insn option for i386
Subject: [PATCH 15/16] add -m(no-)align-vector-insn option for i386
---
gcc/config/i386/i386-options.cc | 9 +++++--
@@ -12,10 +12,10 @@ Subject: [PATCH 13/15] add -m(no-)align-vector-insn option for i386
5 files changed, 55 insertions(+), 9 deletions(-)
diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
index 32cc58a764b..07e33f3d344 100644
index acb2291e70f..2de64ed5cde 100644
--- a/gcc/config/i386/i386-options.cc
+++ b/gcc/config/i386/i386-options.cc
@@ -384,6 +384,7 @@ ix86_target_string (HOST_WIDE_INT isa, HOST_WIDE_INT isa2,
@@ -386,6 +386,7 @@ ix86_target_string (HOST_WIDE_INT isa, HOST_WIDE_INT isa2,
{ "-minline-stringops-dynamically", MASK_INLINE_STRINGOPS_DYNAMICALLY },
{ "-mms-bitfields", MASK_MS_BITFIELD_LAYOUT },
{ "-mno-align-stringops", MASK_NO_ALIGN_STRINGOPS },
@@ -23,7 +23,7 @@ index 32cc58a764b..07e33f3d344 100644
{ "-mno-fancy-math-387", MASK_NO_FANCY_MATH_387 },
{ "-mno-push-args", MASK_NO_PUSH_ARGS },
{ "-mno-red-zone", MASK_NO_RED_ZONE },
@@ -1100,8 +1101,12 @@ ix86_valid_target_attribute_inner_p (tree fndecl, tree args, char *p_strings[],
@@ -1103,8 +1104,12 @@ ix86_valid_target_attribute_inner_p (tree fndecl, tree args, char *p_strings[],
MASK_INLINE_STRINGOPS_DYNAMICALLY),
IX86_ATTR_NO ("align-stringops",
@@ -39,7 +39,7 @@ index 32cc58a764b..07e33f3d344 100644
IX86_ATTR_YES ("recip",
OPT_mrecip,
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index a6b0e28f238..2ba61b0e4ea 100644
index 0dbaacb57ed..3b1a644e2b6 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -241,6 +241,10 @@ malign-stringops
@@ -65,7 +65,7 @@ index a6b0e28f238..2ba61b0e4ea 100644
Target RejectNegative Joined UInteger Var(ix86_preferred_stack_boundary_arg)
Attempt to keep stack aligned to this power of 2.
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 07dcd6ba97b..217230de7d1 100644
index baf80400862..2ff2a99e31b 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
@@ -75,13 +75,13 @@ index 07dcd6ba97b..217230de7d1 100644
- | MASK_MS_BITFIELD_LAYOUT)
+ | MASK_MS_BITFIELD_LAYOUT | MASK_NO_ALIGN_VECTOR_INSN)
/* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
is for compatibility with native compiler. */
#ifndef TARGET_USING_MCFGTHREAD
#define TARGET_USING_MCFGTHREAD 0
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index a8cc17a054d..dacf9ae9564 100644
index c4141a96735..0ee5a9054ee 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -1556,7 +1556,7 @@
@@ -1644,7 +1644,7 @@
;; less than its natural alignment.
(define_predicate "misaligned_operand"
(and (match_code "mem")
@@ -91,10 +91,10 @@ index a8cc17a054d..dacf9ae9564 100644
;; Return true if OP is a parallel for an mov{d,q,dqa,ps,pd} vec_select,
;; where one of the two operands of the vec_concat is const0_operand.
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 5e93aa23b47..4bcc048a351 100644
index 076064f97e6..b224b578676 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1705,7 +1705,8 @@
@@ -1749,7 +1749,8 @@
(vec_concat:V2DF (vec_select:DF (match_dup 2)
(parallel [(const_int 0)]))
(match_operand:DF 3 "memory_operand")))]
@@ -104,7 +104,7 @@ index 5e93aa23b47..4bcc048a351 100644
&& ix86_operands_ok_for_move_multiple (operands, true, DFmode)"
[(set (match_dup 2) (match_dup 5))]
"operands[5] = adjust_address (operands[1], V2DFmode, 0);")
@@ -1716,7 +1717,8 @@
@@ -1760,7 +1761,8 @@
(set (match_operand:V2DF 2 "sse_reg_operand")
(vec_concat:V2DF (match_operand:DF 4 "sse_reg_operand")
(match_operand:DF 3 "memory_operand")))]
@@ -114,7 +114,7 @@ index 5e93aa23b47..4bcc048a351 100644
&& REGNO (operands[4]) == REGNO (operands[2])
&& ix86_operands_ok_for_move_multiple (operands, true, DFmode)"
[(set (match_dup 2) (match_dup 5))]
@@ -1730,7 +1732,8 @@
@@ -1774,7 +1776,8 @@
(set (match_operand:DF 2 "memory_operand")
(vec_select:DF (match_operand:V2DF 3 "sse_reg_operand")
(parallel [(const_int 1)])))]
@@ -124,7 +124,7 @@ index 5e93aa23b47..4bcc048a351 100644
&& ix86_operands_ok_for_move_multiple (operands, false, DFmode)"
[(set (match_dup 4) (match_dup 1))]
"operands[4] = adjust_address (operands[0], V2DFmode, 0);")
@@ -10310,7 +10313,8 @@
@@ -10434,7 +10437,8 @@
(vec_select:V2SF
(match_operand:V4SF 1 "nonimmediate_operand" " v,v,m")
(parallel [(const_int 0) (const_int 1)])))]
@@ -134,7 +134,7 @@ index 5e93aa23b47..4bcc048a351 100644
"@
%vmovlps\t{%1, %0|%q0, %1}
%vmovaps\t{%1, %0|%0, %1}
@@ -10319,6 +10323,21 @@
@@ -10443,6 +10447,21 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2SF,V4SF,V2SF")])
@@ -156,7 +156,7 @@ index 5e93aa23b47..4bcc048a351 100644
(define_expand "sse_loadlps_exp"
[(set (match_operand:V4SF 0 "nonimmediate_operand")
(vec_concat:V4SF
@@ -13131,7 +13150,7 @@
@@ -13338,7 +13357,7 @@
(vec_select:DF
(match_operand:V2DF 1 "nonimmediate_operand" "x,x,m")
(parallel [(const_int 0)])))]
@@ -165,7 +165,7 @@ index 5e93aa23b47..4bcc048a351 100644
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
movlps\t{%1, %0|%0, %1}
@@ -13140,6 +13159,20 @@
@@ -13347,6 +13366,20 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "V2SF,V4SF,V2SF")])
@@ -187,5 +187,5 @@ index 5e93aa23b47..4bcc048a351 100644
[(set (match_operand:V2DF 0 "nonimmediate_operand")
(vec_concat:V2DF
--
2.35.3
2.38.1

View File

@@ -1,78 +1,39 @@
From bcbea3d668db5c836826a1758cc997cbbc9069de Mon Sep 17 00:00:00 2001
From b053e90d5db4e9fe844d1dd1203792197873d51f Mon Sep 17 00:00:00 2001
From: Tomas Kalibera <tomas.kalibera@gmail.com>
Date: Thu, 13 Jan 2022 05:25:32 -0500
Subject: [PATCH 14/15] c-family: Let stdio.h override built in printf format
Date: Mon, 16 May 2022 06:43:09 -0400
Subject: [PATCH] c-family: Let stdio.h override built in printf format
[PR95130,PR92292]
Mingw32 targets use ms_printf format for printf, but mingw-w64 when
configured for UCRT uses gnu_format (via stdio.h). GCC then checks both
formats, which means that one cannot print a 64-bit integer without a
warning. All these lines issue a warning:
configured for UCRT uses gnu_format (via stdio.h). GCC checks both formats,
which means that one gets a warning twice if the format string violates both
formats:
printf("Hello %"PRIu64"\n", x);
printf("Hello %I64u\n", x);
printf("Hello %llu\n", x);
because each of them violates one of the formats. Also, one gets a warning
twice if the format string violates both formats.
printf("Hello %lu\n", (long long unsigned) x);
Fixed by disabling the built in format in case there are additional ones.
This fixes also prevents issues if the print formats disagree. In the past
it was the case when printing 64-bit integers, but GCC ms_printf format since
c51f1e7427e6a5ae2a6d82b5a790df77a3adc99 supports %llu.
gcc/c-family/ChangeLog:
PR c/95130
PR c/92292
* c-common.c (check_function_arguments): Pass also function
declaration to check_function_format.
* c-common.h (check_function_format): Extra argument - function
declaration.
* c-format.c (check_function_format): For builtin functions with a
* c-format.cc (check_function_format): For builtin functions with a
built in format and at least one more, do not check the first one.
---
gcc/c-family/c-common.cc | 2 +-
gcc/c-family/c-common.h | 2 +-
gcc/c-family/c-format.cc | 32 ++++++++++++++++++++++++++++++--
3 files changed, 32 insertions(+), 4 deletions(-)
gcc/c-family/c-format.cc | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc
index bb0544eeaea..a063468f26d 100644
--- a/gcc/c-family/c-common.cc
+++ b/gcc/c-family/c-common.cc
@@ -6071,7 +6071,7 @@ check_function_arguments (location_t loc, const_tree fndecl, const_tree fntype,
/* Check for errors in format strings. */
if (warn_format || warn_suggest_attribute_format)
- check_function_format (fntype, TYPE_ATTRIBUTES (fntype), nargs, argarray,
+ check_function_format (fndecl, fntype, TYPE_ATTRIBUTES (fntype), nargs, argarray,
arglocs);
if (warn_format)
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 52a85bfb783..7b8c87bec19 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -857,7 +857,7 @@ extern void check_function_arguments_recurse (void (*)
opt_code);
extern bool check_builtin_function_arguments (location_t, vec<location_t>,
tree, tree, int, tree *);
-extern void check_function_format (const_tree, tree, int, tree *,
+extern void check_function_format (const_tree, const_tree, tree, int, tree *,
vec<location_t> *);
extern bool attribute_fallthrough_p (tree);
extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
diff --git a/gcc/c-family/c-format.cc b/gcc/c-family/c-format.cc
index 98f28c0dcc6..f3adcf9642d 100644
index 01adea4ff41..613b7c827bb 100644
--- a/gcc/c-family/c-format.cc
+++ b/gcc/c-family/c-format.cc
@@ -1160,12 +1160,13 @@ decode_format_type (const char *s, bool *is_raw /* = NULL */)
attribute themselves. */
void
-check_function_format (const_tree fntype, tree attrs, int nargs,
+check_function_format (const_tree fndecl, const_tree fntype, tree attrs, int nargs,
@@ -1173,9 +1173,10 @@ void
check_function_format (const_tree fn, tree attrs, int nargs,
tree *argarray, vec<location_t> *arglocs)
{
- tree a;
@@ -83,32 +44,31 @@ index 98f28c0dcc6..f3adcf9642d 100644
/* See if this function has any format attributes. */
for (a = attrs; a; a = TREE_CHAIN (a))
@@ -1176,6 +1177,33 @@ check_function_format (const_tree fntype, tree attrs, int nargs,
@@ -1186,6 +1187,32 @@ check_function_format (const_tree fn, tree attrs, int nargs,
function_format_info info;
decode_format_attr (fntype, atname, TREE_VALUE (a), &info,
decode_format_attr (fn, atname, TREE_VALUE (a), &info,
/*validated=*/true);
+
+ /* Mingw32 targets have traditionally used ms_printf format for the
+ printf function, and this format is built in GCC. But nowadays,
+ if mingw-w64 is configured to target UCRT, the printf function
+ uses the gnu_printf format (specified in the stdio.h header). This
+ causes GCC to check both formats, which means that there is no way
+ to e.g. print a long long unsigned without a warning (ms_printf
+ warns for %llu and gnu_printf warns for %I64u). Also, GCC would warn
+ twice about the same issue when both formats are violated, e.g.
+ for %lu used to print long long unsigned.
+ causes GCC to check both formats, which means that GCC would
+ warn twice about the same issue when both formats are violated,
+ e.g. for %lu used to print long long unsigned.
+
+ Hence, if there are multiple format specifiers, we skip the first
+ one. See PR 95130, PR 92292. */
+ one. See PR 95130 (but note that GCC ms_printf already supports
+ %llu) and PR 92292. */
+
+ if (!skipped_default_format && fndecl)
+ if (!skipped_default_format && fn && TREE_CODE (fn) == FUNCTION_DECL)
+ {
+ for(aa = TREE_CHAIN (a); aa; aa = TREE_CHAIN(aa))
+ if (is_attribute_p ("format", get_attribute_name (aa)) &&
+ fndecl && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL))
+ for(aa = TREE_CHAIN (a); aa; aa = TREE_CHAIN (aa))
+ if (is_attribute_p ("format", get_attribute_name (aa))
+ && fndecl_built_in_p (fn, BUILT_IN_NORMAL))
+ {
+ skipped_default_format = true;
+ break;
+ skipped_default_format = true;
+ break;
+ }
+ if (skipped_default_format)
+ continue;
@@ -118,5 +78,5 @@ index 98f28c0dcc6..f3adcf9642d 100644
{
/* FIXME: Rewrite all the internal functions in this file
--
2.35.3
2.38.1

View File

@@ -20,14 +20,14 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
$([[ "$_enable_jit" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-libgccjit")
)
#_snapshot=20181214
pkgver=12.2.0
pkgver=13.1.0
#_majorver=${pkgver:0:1}
#_sourcedir=${_realname}-${_majorver}-${_snapshot}
_sourcedir=${_realname}-${pkgver}
pkgrel=11
pkgrel=1
pkgdesc="GCC for the MinGW-w64"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
mingw_arch=('mingw64' 'ucrt64')
url="https://gcc.gnu.org"
license=('GPL' 'LGPL' 'FDL' 'custom')
groups=("${MINGW_PACKAGE_PREFIX}-toolchain")
@@ -53,12 +53,10 @@ source=("https://ftp.gnu.org/gnu/gcc/${_realname}-${pkgver%%+*}/${_realname}-${p
"gdbinit"
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-Windows-New-feature-to-allow-overriding.patch
0007-Build-EXTRA_GNATTOOLS-for-Ada.patch
0008-Prettify-linking-no-undefined.patch
0010-Fix-using-large-PCH.patch
0011-Enable-shared-gnat-implib.patch
0012-Handle-spaces-in-path-for-default-manifest.patch
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch
@@ -67,25 +65,23 @@ source=("https://ftp.gnu.org/gnu/gcc/${_realname}-${pkgver%%+*}/${_realname}-${p
0140-gcc-diagnostic-color.patch
0200-add-m-no-align-vector-insn-option-for-i386.patch
0300-override-builtin-printf-format.patch)
sha256sums=('e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff'
sha256sums=('61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86'
'SKIP'
'bce81824fc89e5e62cca350de4c17a27e27a18a1a1ad5ca3492aec1fc5af3234'
'2c1a5fdb39d8ecf449632b0ebdd4b41bf9e070aea4093f299513cad95484b5c3'
'3f55d6493d459f6b875f750735231df140339b62eb0d2cc5edfbf10332c1bd5f'
'be1dd73bca4e802df5e263a2b27355c3b42d7298491b94fdcc35e00be2e2cb68'
'2a208d5b13f370c6b2187c7932a13d6caedfc3722f02afc8e5ee9426fb8e64cc'
'56832cb8f939fe14eaadf8fb2d4c784012acc87e1661320398b42b7389643bb7'
'87472619bb0f9520cce20e3e5f5f57b9ab1fbea297bc81cb00216697d64084b1'
'd7066b206d7b4d81a25d4f9c2ee88751e041b81176d915d8175b9b85f5cbc425'
'acaf6f1b8df91bf0fe7c363b2abd10c2f7b967b563761160892559358da9bf91'
'b1ddd82c9a4f0cd7ba3a4877510b56b019304d04ed1d804626eb511ae206dd60'
'0483451eaed8b36b8fbdc30d10a04d73424d58ca83dde0320902d39f0ef623a6'
'b3c6dc1fe61ba3c46d15b5bd38f4a94cd8133923eb9832679944f534d46f7318'
'a501666d1f5cae726f2b2f1618d187a397c3525c0ffa1bcb03a441fd8e8020cf'
'a4b4f7e97635ddf0443ee17cd093b9d10953f97eb290466999585d02ef8bf72d'
'3fab890be4b0d4e9e309749c4de5ce00f069eee4fe6080baa100f768264e6218'
'3fc35067823f87e48dd3bfd265e7593000dc110fa9ad5f16c81b896765fc897a'
'57f0081655ba9a94ed7cc3d8b67a79aee8442a56613bd17f9809a7b0e68e43cd'
'a3637466910fae6145c947095051e3b91b16e4715d4abddc474eeb00539e9dc2'
'90d5cb570083f9dea4ac0f0f87e3e8d2230f5052e6f9b946061a20a224a9d195'
'8a40ea004a803b7e6aabd6c58d859502a57c87755dbcfedbdfed161f2fb7eb62'
'5ef4148acc4a2b7ed648d4fe75fab5545e84b4b93a12d6ba4e4ea6061dd635fa'
'e98805ead7d78ee2a92f237894c4b2b7ddc1688e1b517d8c04f28d440202e40f'
'fd9bdecb2bbc4796bbc9f00b708dac42ef9e3464a06d6d27e5475cee117de5be'
'ad1f7b5e7afaaec008b7cbd14feea13a10989fa91bda7003af72d457619bb199'
'6c272078340a27b3f147e497115b0a6e9fc0da720a2602f12b086524522caa59'
'e0a5b470f49a29f20215cc9f9d04c1cb9969dff6f0e546542799d3a693ef1c84'
'ce832a1be7271a2249e4dd46647474b37cf51f578678d9bd9433b32aacefb528'
'0d82cf1d748c9f1d4d3c7ee43ca3be1b6efbd431dc13ce652ae00ee489d67eec')
'c34f9e71b5a092be1987ad4c65891742c74c9eb8ef6560100e751cd31375f579'
'f73c8d1701762fed7d8102d17d8e4416a4cc5e600e297a89c2e1fe09cd743a1c')
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.org
86CFFCA918CF3AF47147588051E8B148A9999C34 # evangelos@foutrelis.com
13975A70E63C361C73AE69EF6EEB81F8981C74C7 # richard.guenther@gmail.com
@@ -110,7 +106,6 @@ del_file_exists() {
}
# =========================================== #
prepare() {
cd ${srcdir}/${_sourcedir}
del_file_exists intl/canonicalize.c intl/canonicalize.h \
@@ -119,12 +114,10 @@ prepare() {
apply_patch_with_msg \
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-Windows-New-feature-to-allow-overriding.patch \
0007-Build-EXTRA_GNATTOOLS-for-Ada.patch \
0008-Prettify-linking-no-undefined.patch \
0010-Fix-using-large-PCH.patch \
0011-Enable-shared-gnat-implib.patch \
0012-Handle-spaces-in-path-for-default-manifest.patch \
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch \
@@ -216,9 +209,6 @@ build() {
# TODO: This can be removed once we drop libssp all together
CFLAGS+=" -fno-stack-protector"
# TODO: remove this with gcc 13.x, which includes a proper fix:
# https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=902c755930326cb4405672aa3ea13c35c653cbff
CPPFLAGS+=" -DWIN32_LEAN_AND_MEAN"
# In addition adaint.c does `#include <accctrl.h>` which pulls in msxml.h, hacky hack:
CPPFLAGS+=" -DCOM_NO_WINDOWS_H"