summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Mingyu <wangmy@cn.fujitsu.com>2021-03-15 09:02:04 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-20 18:54:56 +0000
commit2cb12498f911c166286fb2cf7b41bba269ffb7bd (patch)
tree217bc291691ecca3590a90cfb1960143ef321ec3
parent4b382a05dde38704ed1448e658c54d3baf7aeb19 (diff)
downloadpoky-2cb12498f911c166286fb2cf7b41bba269ffb7bd.tar.gz
gcc: Update patch to only patch files once
This fixes an error in do_patch when using "PATCHTOOL = "patch"" error message: checking file gcc/configure.ac Hunk #1 FAILED at 6602. (From OE-Core rev: f75a1eddc7c01d9a83d0a1114fc0d6aaa79d8806) Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch105
1 files changed, 43 insertions, 62 deletions
diff --git a/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
index 333d543dd9..697bdc8219 100644
--- a/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
+++ b/meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch
@@ -13,20 +13,21 @@ wants this to be a failure, they can add "-Werror=poison-system-directories".
13 13
14Signed-off-by: Mark Hatle <mark.hatle@windriver.com> 14Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
15Signed-off-by: Khem Raj <raj.khem@gmail.com> 15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
16 17
17Upstream-Status: Pending 18Upstream-Status: Pending
18--- 19---
19 gcc/common.opt | 4 ++++ 20 gcc/common.opt | 4 ++++
20 gcc/config.in | 6 ++++++ 21 gcc/config.in | 10 ++++++++++
21 gcc/configure | 16 ++++++++++++++++ 22 gcc/configure | 19 +++++++++++++++++++
22 gcc/configure.ac | 10 ++++++++++ 23 gcc/configure.ac | 16 ++++++++++++++++
23 gcc/doc/invoke.texi | 9 +++++++++ 24 gcc/doc/invoke.texi | 9 +++++++++
24 gcc/gcc.c | 2 ++ 25 gcc/gcc.c | 9 +++++++--
25 gcc/incpath.c | 21 +++++++++++++++++++++ 26 gcc/incpath.c | 21 +++++++++++++++++++++
26 7 files changed, 68 insertions(+) 27 7 files changed, 86 insertions(+), 2 deletions(-)
27 28
28diff --git a/gcc/common.opt b/gcc/common.opt 29diff --git a/gcc/common.opt b/gcc/common.opt
29index 65a82410abc..415f38fa1f4 100644 30index 3ec7743ea..d3c3e51dc 100644
30--- a/gcc/common.opt 31--- a/gcc/common.opt
31+++ b/gcc/common.opt 32+++ b/gcc/common.opt
32@@ -682,6 +682,10 @@ Wreturn-local-addr 33@@ -682,6 +682,10 @@ Wreturn-local-addr
@@ -41,7 +42,7 @@ index 65a82410abc..415f38fa1f4 100644
41 Common Var(warn_shadow) Warning 42 Common Var(warn_shadow) Warning
42 Warn when one variable shadows another. Same as -Wshadow=global. 43 Warn when one variable shadows another. Same as -Wshadow=global.
43diff --git a/gcc/config.in b/gcc/config.in 44diff --git a/gcc/config.in b/gcc/config.in
44index 809e7b26823..5adeaeed36b 100644 45index 364eba477..7d2c3bbf1 100644
45--- a/gcc/config.in 46--- a/gcc/config.in
46+++ b/gcc/config.in 47+++ b/gcc/config.in
47@@ -224,6 +224,16 @@ 48@@ -224,6 +224,16 @@
@@ -62,7 +63,7 @@ index 809e7b26823..5adeaeed36b 100644
62 optimizer and back end) to be checked for dynamic type safety at runtime. 63 optimizer and back end) to be checked for dynamic type safety at runtime.
63 This is quite expensive. */ 64 This is quite expensive. */
64diff --git a/gcc/configure b/gcc/configure 65diff --git a/gcc/configure b/gcc/configure
65index cd3d9516fce..8de766a942c 100755 66index 2a9d646b4..a848792f2 100755
66--- a/gcc/configure 67--- a/gcc/configure
67+++ b/gcc/configure 68+++ b/gcc/configure
68@@ -1010,6 +1010,7 @@ with_system_zlib 69@@ -1010,6 +1010,7 @@ with_system_zlib
@@ -82,7 +83,7 @@ index cd3d9516fce..8de766a942c 100755
82 --enable-plugin enable plugin support 83 --enable-plugin enable plugin support
83 --enable-host-shared build host code as shared libraries 84 --enable-host-shared build host code as shared libraries
84 --disable-libquadmath-support 85 --disable-libquadmath-support
85@@ -30235,6 +30238,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : 86@@ -30280,6 +30283,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
86 fi 87 fi
87 88
88 89
@@ -106,31 +107,37 @@ index cd3d9516fce..8de766a942c 100755
106 107
107 108
108diff --git a/gcc/configure.ac b/gcc/configure.ac 109diff --git a/gcc/configure.ac b/gcc/configure.ac
109index 0de3b4bf97b..8bfd6feb780 100644 110index 51cce36ce..66ffde305 100644
110--- a/gcc/configure.ac 111--- a/gcc/configure.ac
111+++ b/gcc/configure.ac 112+++ b/gcc/configure.ac
112@@ -6595,6 +6595,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs, 113@@ -6614,6 +6614,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
113 [specify that runtime libraries should be 114 [specify that runtime libraries should be
114 installed in a compiler-specific directory])]) 115 installed in a compiler-specific directory])])
115 116
116+AC_ARG_ENABLE([poison-system-directories], 117+AC_ARG_ENABLE([poison-system-directories],
117+ AS_HELP_STRING([--enable-poison-system-directories], 118+ AS_HELP_STRING([--enable-poison-system-directories],
118+ [warn for use of native system header directories]),, 119+ [warn for use of native system header directories (no/yes/error)]),,
119+ [enable_poison_system_directories=no]) 120+ [enable_poison_system_directories=no])
120+if test "x${enable_poison_system_directories}" = "xyes"; then 121+AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories])
122+if test "x${enable_poison_system_directories}" != "xno"; then
123+ AC_MSG_NOTICE([poisoned directories enabled])
121+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES], 124+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
122+ [1], 125+ [1],
123+ [Define to warn for use of native system header directories]) 126+ [Define to warn for use of native system header directories])
127+ if test $enable_poison_system_directories = "error"; then
128+ AC_MSG_NOTICE([poisoned directories are fatal])
129+ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors])
130+ fi
124+fi 131+fi
125+ 132+
126 # Substitute configuration variables 133 # Substitute configuration variables
127 AC_SUBST(subdirs) 134 AC_SUBST(subdirs)
128 AC_SUBST(srcdir) 135 AC_SUBST(srcdir)
129diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi 136diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
130index f98161391a0..f12d8d12150 100644 137index d929eb109..aa5ff88b1 100644
131--- a/gcc/doc/invoke.texi 138--- a/gcc/doc/invoke.texi
132+++ b/gcc/doc/invoke.texi 139+++ b/gcc/doc/invoke.texi
133@@ -348,6 +348,7 @@ Objective-C and Objective-C++ Dialects}. 140@@ -351,6 +351,7 @@ Objective-C and Objective-C++ Dialects}.
134 -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol 141 -Wpacked -Wno-packed-bitfield-compat -Wpacked-not-aligned -Wpadded @gol
135 -Wparentheses -Wno-pedantic-ms-format @gol 142 -Wparentheses -Wno-pedantic-ms-format @gol
136 -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol 143 -Wpointer-arith -Wno-pointer-compare -Wno-pointer-to-int-cast @gol
@@ -138,7 +145,7 @@ index f98161391a0..f12d8d12150 100644
138 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol 145 -Wno-pragmas -Wno-prio-ctor-dtor -Wredundant-decls @gol
139 -Wrestrict -Wno-return-local-addr -Wreturn-type @gol 146 -Wrestrict -Wno-return-local-addr -Wreturn-type @gol
140 -Wno-scalar-storage-order -Wsequence-point @gol 147 -Wno-scalar-storage-order -Wsequence-point @gol
141@@ -6924,6 +6925,14 @@ made up of data only and thus requires no special treatment. But, for 148@@ -6928,6 +6929,14 @@ made up of data only and thus requires no special treatment. But, for
142 most targets, it is made up of code and thus requires the stack to be 149 most targets, it is made up of code and thus requires the stack to be
143 made executable in order for the program to work properly. 150 made executable in order for the program to work properly.
144 151
@@ -154,10 +161,10 @@ index f98161391a0..f12d8d12150 100644
154 @opindex Wfloat-equal 161 @opindex Wfloat-equal
155 @opindex Wno-float-equal 162 @opindex Wno-float-equal
156diff --git a/gcc/gcc.c b/gcc/gcc.c 163diff --git a/gcc/gcc.c b/gcc/gcc.c
157index 9f790db0daf..b2200c5185a 100644 164index 49c9c6c17..24a92bf27 100644
158--- a/gcc/gcc.c 165--- a/gcc/gcc.c
159+++ b/gcc/gcc.c 166+++ b/gcc/gcc.c
160@@ -1041,6 +1041,8 @@ proper position among the other output files. */ 167@@ -1044,6 +1044,8 @@ proper position among the other output files. */
161 "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ 168 "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
162 "%X %{o*} %{e*} %{N} %{n} %{r}\ 169 "%X %{o*} %{e*} %{N} %{n} %{r}\
163 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ 170 %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
@@ -166,8 +173,22 @@ index 9f790db0daf..b2200c5185a 100644
166 %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \ 173 %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \
167 VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ 174 VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \
168 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ 175 %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\
176@@ -1138,8 +1140,11 @@ static const char *cpp_unique_options =
177 static const char *cpp_options =
178 "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
179 %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\
180- %{!fno-working-directory:-fworking-directory}}} %{O*}\
181- %{undef} %{save-temps*:-fpch-preprocess}";
182+ %{!fno-working-directory:-fworking-directory}}} %{O*}"
183+#ifdef POISON_BY_DEFAULT
184+ " -Werror=poison-system-directories"
185+#endif
186+ " %{undef} %{save-temps*:-fpch-preprocess}";
187
188 /* This contains cpp options which are not passed when the preprocessor
189 output will be used by another program. */
169diff --git a/gcc/incpath.c b/gcc/incpath.c 190diff --git a/gcc/incpath.c b/gcc/incpath.c
170index 8a2bda00f80..9098ab044ab 100644 191index 94eaba7b1..bfad4ebe3 100644
171--- a/gcc/incpath.c 192--- a/gcc/incpath.c
172+++ b/gcc/incpath.c 193+++ b/gcc/incpath.c
173@@ -26,6 +26,7 @@ 194@@ -26,6 +26,7 @@
@@ -205,46 +226,6 @@ index 8a2bda00f80..9098ab044ab 100644
205 } 226 }
206 227
207 /* Use given -I paths for #include "..." but not #include <...>, and 228 /* Use given -I paths for #include "..." but not #include <...>, and
208diff --git a/gcc/configure.ac b/gcc/configure.ac 229--
209index f42006e5476..de7e176ea53 100644 2302.25.1
210--- a/gcc/configure.ac 231
211+++ b/gcc/configure.ac
212@@ -6602,12 +6602,18 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
213
214 AC_ARG_ENABLE([poison-system-directories],
215 AS_HELP_STRING([--enable-poison-system-directories],
216- [warn for use of native system header directories]),,
217+ [warn for use of native system header directories (no/yes/error)]),,
218 [enable_poison_system_directories=no])
219+AC_MSG_NOTICE([poisoned directories $enable_poison_system_directories])
220-if test "x${enable_poison_system_directories}" = "xyes"; then
221+if test "x${enable_poison_system_directories}" != "xno"; then
222+ AC_MSG_NOTICE([poisoned directories enabled])
223 AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
224 [1],
225 [Define to warn for use of native system header directories])
226+ if test $enable_poison_system_directories = "error"; then
227+ AC_MSG_NOTICE([poisoned directories are fatal])
228+ AC_DEFINE([POISON_BY_DEFAULT], [1], [Define to make poison warnings errors])
229+ fi
230 fi
231
232 # Substitute configuration variables
233diff --git a/gcc/gcc.c b/gcc/gcc.c
234index b2200c5185a..fa7b6fc8ddb 100644
235--- a/gcc/gcc.c
236+++ b/gcc/gcc.c
237@@ -1136,8 +1136,11 @@ static const char *cpp_unique_options =
238 static const char *cpp_options =
239 "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
240 %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\
241- %{!fno-working-directory:-fworking-directory}}} %{O*}\
242- %{undef} %{save-temps*:-fpch-preprocess}";
243+ %{!fno-working-directory:-fworking-directory}}} %{O*}"
244+#ifdef POISON_BY_DEFAULT
245+ " -Werror=poison-system-directories"
246+#endif
247+ " %{undef} %{save-temps*:-fpch-preprocess}";
248
249 /* This contains cpp options which are not passed when the preprocessor
250 output will be used by another program. */