gcc-cross: Update to 14.2.0

sync patches with the mingw build
This commit is contained in:
Christoph Reiter 2024-08-04 14:05:34 +02:00
parent 1588d231cf
commit 6ebdfc2f6a
3 changed files with 6 additions and 138 deletions

View File

@ -1,44 +0,0 @@
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/16] master 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
always using msvcrt.dll
---
gcc/config/i386/cygming.opt | 3 +++
gcc/config/i386/mingw32.h | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/config/i386/cygming.opt b/gcc/config/i386/cygming.opt
index 12435d813f5..5dff2ac1551 100644
--- a/gcc/config/i386/cygming.opt
+++ b/gcc/config/i386/cygming.opt
@@ -22,6 +22,9 @@ mconsole
Target RejectNegative
Create console application.
+mcrtdll=
+Target RejectNegative Joined
+
mdll
Target RejectNegative
Generate code for a DLL.
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index b5f31c3da0a..baf80400862 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -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 " MCFGTHREAD_SPEC
+ -lmoldname -lmingwex %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*} -lkernel32 " MCFGTHREAD_SPEC
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
--
2.38.1

View File

@ -1,82 +0,0 @@
From b053e90d5db4e9fe844d1dd1203792197873d51f Mon Sep 17 00:00:00 2001
From: Tomas Kalibera <tomas.kalibera@gmail.com>
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 checks both formats,
which means that 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-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-format.cc | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/gcc/c-family/c-format.cc b/gcc/c-family/c-format.cc
index 01adea4ff41..613b7c827bb 100644
--- a/gcc/c-family/c-format.cc
+++ b/gcc/c-family/c-format.cc
@@ -1173,9 +1173,10 @@ void
check_function_format (const_tree fn, tree attrs, int nargs,
tree *argarray, vec<location_t> *arglocs)
{
- tree a;
+ tree a, aa;
tree atname = get_identifier ("format");
+ bool skipped_default_format = false;
/* See if this function has any format attributes. */
for (a = attrs; a; a = TREE_CHAIN (a))
@@ -1186,6 +1187,32 @@ check_function_format (const_tree fn, tree attrs, int nargs,
function_format_info 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 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 (but note that GCC ms_printf already supports
+ %llu) and PR 92292. */
+
+ 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_built_in_p (fn, BUILT_IN_NORMAL))
+ {
+ skipped_default_format = true;
+ break;
+ }
+ if (skipped_default_format)
+ continue;
+ }
+
if (warn_format)
{
/* FIXME: Rewrite all the internal functions in this file
--
2.38.1

View File

@ -3,8 +3,8 @@
_realname=gcc _realname=gcc
_mingw_suff=mingw-w64-cross _mingw_suff=mingw-w64-cross
pkgname=("${_mingw_suff}-${_realname}") pkgname=("${_mingw_suff}-${_realname}")
pkgver=13.3.0 pkgver=14.2.0
pkgrel=2 pkgrel=1
pkgdesc="Cross GCC for the MinGW-w64" pkgdesc="Cross GCC for the MinGW-w64"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="https://gcc.gnu.org" url="https://gcc.gnu.org"
@ -37,13 +37,11 @@ source=(https://ftp.gnu.org/gnu/gcc/gcc-${pkgver}/gcc-${pkgver}.tar.gz
0011-Cygwin-define-STD_UNIX.patch 0011-Cygwin-define-STD_UNIX.patch
0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch 0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch
0102-Cygwin-testsuite-fixes-for-libgccjit.patch 0102-Cygwin-testsuite-fixes-for-libgccjit.patch
0006-Windows-New-feature-to-allow-overriding.patch
0012-Handle-spaces-in-path-for-default-manifest.patch 0012-Handle-spaces-in-path-for-default-manifest.patch
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch 0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch 0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
0200-add-m-no-align-vector-insn-option-for-i386.patch 0200-add-m-no-align-vector-insn-option-for-i386.patch)
0300-override-builtin-printf-format.patch) sha256sums=('7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293'
sha256sums=('3a2b10cab86e32358fdac871546d57e2700e9bdb5875ef33fff5b601265b9e32'
'bc788aa466a83184d285cc2f6c1ffc40c6ed416dd08c6999015262a53f1ab1b5' 'bc788aa466a83184d285cc2f6c1ffc40c6ed416dd08c6999015262a53f1ab1b5'
'704acfaeb11d24d3fe5aab34bc883c184ca93aff03d752016c9a50fdd82c5655' '704acfaeb11d24d3fe5aab34bc883c184ca93aff03d752016c9a50fdd82c5655'
'c5676fd62d5f7f69be26062b95d42ef47f28151af83b83efa3998ecd8e939e19' 'c5676fd62d5f7f69be26062b95d42ef47f28151af83b83efa3998ecd8e939e19'
@ -57,12 +55,10 @@ sha256sums=('3a2b10cab86e32358fdac871546d57e2700e9bdb5875ef33fff5b601265b9e32'
'83b6aea4a462ae80121fd68d42c6234d02e20865132197a10575bbf95fd33b7e' '83b6aea4a462ae80121fd68d42c6234d02e20865132197a10575bbf95fd33b7e'
'c5aeab9609f90a8430c43bb50172b63c3155eb10082369f81fac58a395d2e2ee' 'c5aeab9609f90a8430c43bb50172b63c3155eb10082369f81fac58a395d2e2ee'
'3707b0aab99b203cbd9e513be46c7d4600de06e6c8344160b7fb1779061d08da' '3707b0aab99b203cbd9e513be46c7d4600de06e6c8344160b7fb1779061d08da'
'a3637466910fae6145c947095051e3b91b16e4715d4abddc474eeb00539e9dc2'
'e98805ead7d78ee2a92f237894c4b2b7ddc1688e1b517d8c04f28d440202e40f' 'e98805ead7d78ee2a92f237894c4b2b7ddc1688e1b517d8c04f28d440202e40f'
'fd9bdecb2bbc4796bbc9f00b708dac42ef9e3464a06d6d27e5475cee117de5be' 'fd9bdecb2bbc4796bbc9f00b708dac42ef9e3464a06d6d27e5475cee117de5be'
'ad1f7b5e7afaaec008b7cbd14feea13a10989fa91bda7003af72d457619bb199' 'ad1f7b5e7afaaec008b7cbd14feea13a10989fa91bda7003af72d457619bb199'
'c34f9e71b5a092be1987ad4c65891742c74c9eb8ef6560100e751cd31375f579' 'c34f9e71b5a092be1987ad4c65891742c74c9eb8ef6560100e751cd31375f579')
'f73c8d1701762fed7d8102d17d8e4416a4cc5e600e297a89c2e1fe09cd743a1c')
_threads="win32" _threads="win32"
_targets="x86_64-w64-mingw32ucrt i686-w64-mingw32 x86_64-w64-mingw32" _targets="x86_64-w64-mingw32ucrt i686-w64-mingw32 x86_64-w64-mingw32"
@ -96,12 +92,10 @@ prepare() {
# MinGW Patches # MinGW Patches
apply_patch_with_msg \ apply_patch_with_msg \
0006-Windows-New-feature-to-allow-overriding.patch \
0012-Handle-spaces-in-path-for-default-manifest.patch \ 0012-Handle-spaces-in-path-for-default-manifest.patch \
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch \ 0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch \
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch \ 0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch \
0200-add-m-no-align-vector-insn-option-for-i386.patch \ 0200-add-m-no-align-vector-insn-option-for-i386.patch
0300-override-builtin-printf-format.patch
} }
build() { build() {