Skip to content

Commit

Permalink
main/gcc: upgrade to 12.1.1_git20220630
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeum authored and kaniini committed Aug 11, 2022
1 parent 297a19c commit 8acb21b
Show file tree
Hide file tree
Showing 63 changed files with 853 additions and 1,780 deletions.
7 changes: 2 additions & 5 deletions main/gcc/0001-posix_memalign.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From feb04e50d907683385cc4dc0163cf1d82258073a Mon Sep 17 00:00:00 2001
From 74c7b0df9971b6bc75d7d172c2819ffd21d51050 Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <[email protected]>
Date: Fri, 26 Jan 2018 20:32:50 +0000
Subject: [PATCH] posix_memalign
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH] posix_memalign
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
index 1b0bfe37852..d7b2b19bb3c 100644
index 3b2e4f47915..20f790904a2 100644
--- a/gcc/config/i386/pmm_malloc.h
+++ b/gcc/config/i386/pmm_malloc.h
@@ -27,12 +27,13 @@
Expand Down Expand Up @@ -37,6 +37,3 @@ index 1b0bfe37852..d7b2b19bb3c 100644
return __ptr;
else
return NULL;
--
2.35.1

55 changes: 26 additions & 29 deletions main/gcc/0002-gcc-poison-system-directories.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d64825212f807435a4b2f8e068c0f65195c8e2e6 Mon Sep 17 00:00:00 2001
From dd1e75ff4ecda96957465b34681f245e818928bd Mon Sep 17 00:00:00 2001
From: Khem Raj <[email protected]>
Date: Fri, 29 Mar 2013 08:59:00 +0400
Subject: [PATCH] gcc: poison-system-directories
Expand All @@ -21,15 +21,15 @@ Upstream-Status: Pending
gcc/configure | 16 ++++++++++++++++
gcc/configure.ac | 10 ++++++++++
gcc/doc/invoke.texi | 9 +++++++++
gcc/gcc.c | 2 ++
gcc/incpath.c | 21 +++++++++++++++++++++
gcc/gcc.cc | 2 ++
gcc/incpath.cc | 21 +++++++++++++++++++++
7 files changed, 68 insertions(+)

diff --git a/gcc/common.opt b/gcc/common.opt
index a75b44ee47e..d15105a73f3 100644
index 8a0dafc522d..0357868e22c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -683,6 +683,10 @@ Wreturn-local-addr
@@ -710,6 +710,10 @@ Wreturn-local-addr
Common Var(warn_return_local_addr) Init(1) Warning
Warn about returning a pointer/reference to a local or temporary variable.

Expand All @@ -41,10 +41,10 @@ index a75b44ee47e..d15105a73f3 100644
Common Var(warn_shadow) Warning
Warn when one variable shadows another. Same as -Wshadow=global.
diff --git a/gcc/config.in b/gcc/config.in
index 2de5a463315..059c818c895 100644
index 64c27c9cfac..f0fbf123aa8 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -218,6 +218,12 @@
@@ -230,6 +230,12 @@
#endif


Expand All @@ -58,18 +58,18 @@ index 2de5a463315..059c818c895 100644
optimizer and back end) to be checked for dynamic type safety at runtime.
This is quite expensive. */
diff --git a/gcc/configure b/gcc/configure
index 708328e1670..4b977e313b5 100755
index 5ce0557719a..e9060112384 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1020,6 +1020,7 @@ enable_maintainer_mode
@@ -1023,6 +1023,7 @@ enable_maintainer_mode
enable_link_mutex
enable_link_serialization
enable_version_specific_runtime_libs
+enable_poison_system_directories
enable_plugin
enable_host_shared
enable_libquadmath_support
@@ -1782,6 +1783,8 @@ Optional Features:
@@ -1785,6 +1786,8 @@ Optional Features:
--enable-version-specific-runtime-libs
specify that runtime libraries should be installed
in a compiler-specific directory
Expand All @@ -78,7 +78,7 @@ index 708328e1670..4b977e313b5 100755
--enable-plugin enable plugin support
--enable-host-shared build host code as shared libraries
--disable-libquadmath-support
@@ -31790,6 +31793,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
@@ -31982,6 +31985,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
fi


Expand All @@ -99,10 +99,10 @@ index 708328e1670..4b977e313b5 100755


diff --git a/gcc/configure.ac b/gcc/configure.ac
index df1c9cc3200..5461bab88a9 100644
index 23bee7010a3..75a7048045c 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -7311,6 +7311,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
@@ -7421,6 +7421,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
[specify that runtime libraries should be
installed in a compiler-specific directory])])

Expand All @@ -120,18 +120,18 @@ index df1c9cc3200..5461bab88a9 100644
AC_SUBST(subdirs)
AC_SUBST(srcdir)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index cf536a15116..7d3f1ccddf3 100644
index 07b440190c3..b2de464798a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -369,6 +369,7 @@ Objective-C and Objective-C++ Dialects}.
@@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}.
-Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
-Wparentheses -Wno-pedantic-ms-format @gol
-Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
+-Wno-poison-system-directories @gol
-Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
-Wrestrict -Wno-return-local-addr -Wreturn-type @gol
-Wno-scalar-storage-order -Wsequence-point @gol
@@ -7728,6 +7729,14 @@ made up of data only and thus requires no special treatment. But, for
@@ -8029,6 +8030,14 @@ made up of data only and thus requires no special treatment. But, for
most targets, it is made up of code and thus requires the stack to be
made executable in order for the program to work properly.

Expand All @@ -146,11 +146,11 @@ index cf536a15116..7d3f1ccddf3 100644
@item -Wfloat-equal
@opindex Wfloat-equal
@opindex Wno-float-equal
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 8ba410c9e17..a83ba34ac4b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1152,6 +1152,8 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index bb07cc244e3..47fb5802194 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1159,6 +1159,8 @@ proper position among the other output files. */
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
Expand All @@ -159,10 +159,10 @@ index 8ba410c9e17..a83ba34ac4b 100644
%{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
%{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
diff --git a/gcc/incpath.c b/gcc/incpath.c
index 446d280321d..fbfc0ce03b8 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
--- a/gcc/incpath.cc
+++ b/gcc/incpath.cc
@@ -26,6 +26,7 @@
#include "intl.h"
#include "incpath.h"
Expand All @@ -171,7 +171,7 @@ index 446d280321d..fbfc0ce03b8 100644

/* Microsoft Windows does not natively support inodes.
VMS has non-numeric inodes. */
@@ -395,6 +396,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
@@ -399,6 +400,26 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
}
fprintf (stderr, _("End of search list.\n"));
}
Expand All @@ -198,6 +198,3 @@ index 446d280321d..fbfc0ce03b8 100644
}

/* Use given -I paths for #include "..." but not #include <...>, and
--
2.35.1

21 changes: 9 additions & 12 deletions main/gcc/0003-specs-turn-on-Wl-z-now-by-default.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9675297b3a46b65a54e9df97f26ea445d53c67c6 Mon Sep 17 00:00:00 2001
From 40e45739e7d3787acd13b5b9a4c27d843de0ffe2 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <[email protected]>
Date: Fri, 21 Aug 2020 06:45:49 +0000
Subject: [PATCH] specs: turn on -Wl,-z,now by default
Expand All @@ -10,14 +10,14 @@ Binutils does not appear to have a similar option for enabling -z
now by default.
---
gcc/doc/invoke.texi | 3 +++
gcc/gcc.c | 1 +
gcc/gcc.cc | 1 +
2 files changed, 4 insertions(+)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 7d3f1ccddf3..485d2d6b742 100644
index b2de464798a..83bd1bde433 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15921,6 +15921,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
@@ -16872,6 +16872,9 @@ For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
linker. When using the GNU linker, you can also get the same effect with
@option{-Wl,-Map=output.map}.

Expand All @@ -27,18 +27,15 @@ index 7d3f1ccddf3..485d2d6b742 100644
@item -u @var{symbol}
@opindex u
Pretend the symbol @var{symbol} is undefined, to force linking of
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a83ba34ac4b..faf9ce76b3d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1150,6 +1150,7 @@ proper position among the other output files. */
diff --git a/gcc/gcc.cc b/gcc/gcc.cc
index 47fb5802194..d18b5d7b59a 100644
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
@@ -1157,6 +1157,7 @@ proper position among the other output files. */
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+ "-z now " \
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{Wno-poison-system-directories:--no-poison-system-directories} \
--
2.35.1

Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
From 4eb1b3849325b77c4cb66b675119299de35125bb Mon Sep 17 00:00:00 2001
From 666d0aeb808ac9c10d065ae7b196695c81a25a20 Mon Sep 17 00:00:00 2001
From: Ariadne Conill <[email protected]>
Date: Fri, 21 Aug 2020 06:46:22 +0000
Subject: [PATCH] Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC,
ObjC++, if the optimization level is > 0

---
gcc/c-family/c-cppbuiltin.c | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
gcc/c-family/c-cppbuiltin.cc | 4 ++++
gcc/doc/invoke.texi | 6 ++++++
2 files changed, 10 insertions(+)

diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 11e015bdb87..de8b7bf246f 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1427,6 +1427,10 @@ c_cpp_builtins (cpp_reader *pfile)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 4672ae8486a..573c021e1e8 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1510,6 +1510,10 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);

Expand All @@ -25,10 +25,10 @@ index 11e015bdb87..de8b7bf246f 100644
if (flag_gnu89_inline)
cpp_define (pfile, "__GNUC_GNU_INLINE__");
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 485d2d6b742..164929f7583 100644
index 83bd1bde433..dda299a9987 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10225,6 +10225,12 @@ also turns on the following optimization flags:
@@ -10896,6 +10896,12 @@ also turns on the following optimization flags:
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.

Expand All @@ -41,6 +41,3 @@ index 485d2d6b742..164929f7583 100644
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified
--
2.35.1

Loading

0 comments on commit 8acb21b

Please sign in to comment.