diff options
author | Peter Kjellerstedt <pkj@axis.com> | 2022-10-13 15:29:26 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-10-25 13:42:03 +0100 |
commit | 5c8103695de8861e9330d1ea9e2f42a38e1d9897 (patch) | |
tree | 737463de5a6993f9922b9022db3e09e89bad4f91 /meta | |
parent | dc0af3be0f5477adf4e2ac8a2d7c1b7c36fe4d8e (diff) | |
download | poky-5c8103695de8861e9330d1ea9e2f42a38e1d9897.tar.gz |
gcc: Allow -Wno-error=poison-system-directories to take effect
The change in commit e903b29f (gcc-cross: pass
-Werror=poison-system-directories to compiler stages) made it impossible
to disable the error using -Wno-error=poison-system-directories.
(From OE-Core rev: 1cb0245539f7d5277fae4e9abc7f2a0130d0caa8)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc/0002-gcc-poison-system-directories.patch | 36 |
1 files changed, 18 insertions, 18 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 bfec4477c1..5aa635b3d4 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 | |||
@@ -1,4 +1,4 @@ | |||
1 | From e1dbdcd0ea667bab4b551294354e04c6fe288ab6 Mon Sep 17 00:00:00 2001 | 1 | From 99f1e61b2957226254a116fde7fd73bf07034012 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Mon, 8 Mar 2021 16:04:20 -0800 | 3 | Date: Mon, 8 Mar 2021 16:04:20 -0800 |
4 | Subject: [PATCH] gcc: poison-system-directories | 4 | Subject: [PATCH] gcc: poison-system-directories |
@@ -20,12 +20,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
20 | gcc/configure | 19 +++++++++++++++++++ | 20 | gcc/configure | 19 +++++++++++++++++++ |
21 | gcc/configure.ac | 16 ++++++++++++++++ | 21 | gcc/configure.ac | 16 ++++++++++++++++ |
22 | gcc/doc/invoke.texi | 9 +++++++++ | 22 | gcc/doc/invoke.texi | 9 +++++++++ |
23 | gcc/gcc.cc | 9 +++++++-- | 23 | gcc/gcc.cc | 15 ++++++++++++--- |
24 | gcc/incpath.cc | 21 +++++++++++++++++++++ | 24 | gcc/incpath.cc | 21 +++++++++++++++++++++ |
25 | 7 files changed, 86 insertions(+), 2 deletions(-) | 25 | 7 files changed, 91 insertions(+), 3 deletions(-) |
26 | 26 | ||
27 | diff --git a/gcc/common.opt b/gcc/common.opt | 27 | diff --git a/gcc/common.opt b/gcc/common.opt |
28 | index 8a0dafc522d..0357868e22c 100644 | 28 | index 8a0dafc52..0357868e2 100644 |
29 | --- a/gcc/common.opt | 29 | --- a/gcc/common.opt |
30 | +++ b/gcc/common.opt | 30 | +++ b/gcc/common.opt |
31 | @@ -710,6 +710,10 @@ Wreturn-local-addr | 31 | @@ -710,6 +710,10 @@ Wreturn-local-addr |
@@ -40,7 +40,7 @@ index 8a0dafc522d..0357868e22c 100644 | |||
40 | Common Var(warn_shadow) Warning | 40 | Common Var(warn_shadow) Warning |
41 | Warn when one variable shadows another. Same as -Wshadow=global. | 41 | Warn when one variable shadows another. Same as -Wshadow=global. |
42 | diff --git a/gcc/config.in b/gcc/config.in | 42 | diff --git a/gcc/config.in b/gcc/config.in |
43 | index 64c27c9cfac..a693cb8a886 100644 | 43 | index 64c27c9cf..a693cb8a8 100644 |
44 | --- a/gcc/config.in | 44 | --- a/gcc/config.in |
45 | +++ b/gcc/config.in | 45 | +++ b/gcc/config.in |
46 | @@ -230,6 +230,16 @@ | 46 | @@ -230,6 +230,16 @@ |
@@ -61,7 +61,7 @@ index 64c27c9cfac..a693cb8a886 100644 | |||
61 | optimizer and back end) to be checked for dynamic type safety at runtime. | 61 | optimizer and back end) to be checked for dynamic type safety at runtime. |
62 | This is quite expensive. */ | 62 | This is quite expensive. */ |
63 | diff --git a/gcc/configure b/gcc/configure | 63 | diff --git a/gcc/configure b/gcc/configure |
64 | index 5ce0557719a..dc2d59701ad 100755 | 64 | index 2b83acfb0..8bb97578c 100755 |
65 | --- a/gcc/configure | 65 | --- a/gcc/configure |
66 | +++ b/gcc/configure | 66 | +++ b/gcc/configure |
67 | @@ -1023,6 +1023,7 @@ enable_maintainer_mode | 67 | @@ -1023,6 +1023,7 @@ enable_maintainer_mode |
@@ -81,7 +81,7 @@ index 5ce0557719a..dc2d59701ad 100755 | |||
81 | --enable-plugin enable plugin support | 81 | --enable-plugin enable plugin support |
82 | --enable-host-shared build host code as shared libraries | 82 | --enable-host-shared build host code as shared libraries |
83 | --disable-libquadmath-support | 83 | --disable-libquadmath-support |
84 | @@ -31982,6 +31985,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : | 84 | @@ -31996,6 +31999,22 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then : |
85 | fi | 85 | fi |
86 | 86 | ||
87 | 87 | ||
@@ -105,10 +105,10 @@ index 5ce0557719a..dc2d59701ad 100755 | |||
105 | 105 | ||
106 | 106 | ||
107 | diff --git a/gcc/configure.ac b/gcc/configure.ac | 107 | diff --git a/gcc/configure.ac b/gcc/configure.ac |
108 | index 23bee7010a3..36ce78924de 100644 | 108 | index daf2a708c..6155b83a7 100644 |
109 | --- a/gcc/configure.ac | 109 | --- a/gcc/configure.ac |
110 | +++ b/gcc/configure.ac | 110 | +++ b/gcc/configure.ac |
111 | @@ -7421,6 +7421,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, | 111 | @@ -7435,6 +7435,22 @@ AC_ARG_ENABLE(version-specific-runtime-libs, |
112 | [specify that runtime libraries should be | 112 | [specify that runtime libraries should be |
113 | installed in a compiler-specific directory])]) | 113 | installed in a compiler-specific directory])]) |
114 | 114 | ||
@@ -132,7 +132,7 @@ index 23bee7010a3..36ce78924de 100644 | |||
132 | AC_SUBST(subdirs) | 132 | AC_SUBST(subdirs) |
133 | AC_SUBST(srcdir) | 133 | AC_SUBST(srcdir) |
134 | diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi | 134 | diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi |
135 | index 07b440190c3..b2de464798a 100644 | 135 | index ff6c338be..a8ebfa59a 100644 |
136 | --- a/gcc/doc/invoke.texi | 136 | --- a/gcc/doc/invoke.texi |
137 | +++ b/gcc/doc/invoke.texi | 137 | +++ b/gcc/doc/invoke.texi |
138 | @@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}. | 138 | @@ -379,6 +379,7 @@ Objective-C and Objective-C++ Dialects}. |
@@ -159,10 +159,10 @@ index 07b440190c3..b2de464798a 100644 | |||
159 | @opindex Wfloat-equal | 159 | @opindex Wfloat-equal |
160 | @opindex Wno-float-equal | 160 | @opindex Wno-float-equal |
161 | diff --git a/gcc/gcc.cc b/gcc/gcc.cc | 161 | diff --git a/gcc/gcc.cc b/gcc/gcc.cc |
162 | index bb07cc244e3..ce161d3c853 100644 | 162 | index beefde7f6..4e6557b3c 100644 |
163 | --- a/gcc/gcc.cc | 163 | --- a/gcc/gcc.cc |
164 | +++ b/gcc/gcc.cc | 164 | +++ b/gcc/gcc.cc |
165 | @@ -1159,6 +1159,8 @@ proper position among the other output files. */ | 165 | @@ -1162,6 +1162,8 @@ proper position among the other output files. */ |
166 | "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ | 166 | "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ |
167 | "%X %{o*} %{e*} %{N} %{n} %{r}\ | 167 | "%X %{o*} %{e*} %{N} %{n} %{r}\ |
168 | %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ | 168 | %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \ |
@@ -171,7 +171,7 @@ index bb07cc244e3..ce161d3c853 100644 | |||
171 | %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \ | 171 | %{static|no-pie|static-pie:} %@{L*} %(mfwrap) %(link_libgcc) " \ |
172 | VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ | 172 | VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o "" \ |
173 | %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ | 173 | %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1):\ |
174 | @@ -1254,8 +1256,11 @@ static const char *cpp_unique_options = | 174 | @@ -1257,8 +1259,11 @@ static const char *cpp_unique_options = |
175 | static const char *cpp_options = | 175 | static const char *cpp_options = |
176 | "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ | 176 | "%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\ |
177 | %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ | 177 | %{f*} %{g*:%{%:debug-level-gt(0):%{g*}\ |
@@ -179,27 +179,27 @@ index bb07cc244e3..ce161d3c853 100644 | |||
179 | - %{undef} %{save-temps*:-fpch-preprocess}"; | 179 | - %{undef} %{save-temps*:-fpch-preprocess}"; |
180 | + %{!fno-working-directory:-fworking-directory}}} %{O*}" | 180 | + %{!fno-working-directory:-fworking-directory}}} %{O*}" |
181 | +#ifdef POISON_BY_DEFAULT | 181 | +#ifdef POISON_BY_DEFAULT |
182 | + " -Werror=poison-system-directories" | 182 | + " %{!Wno-error=poison-system-directories:-Werror=poison-system-directories}" |
183 | +#endif | 183 | +#endif |
184 | + " %{undef} %{save-temps*:-fpch-preprocess}"; | 184 | + " %{undef} %{save-temps*:-fpch-preprocess}"; |
185 | 185 | ||
186 | /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. | 186 | /* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al. |
187 | 187 | ||
188 | @@ -1265,7 +1270,11 @@ static const char *cc1_options = | 188 | @@ -1287,7 +1292,11 @@ static const char *cc1_options = |
189 | %{coverage:-fprofile-arcs -ftest-coverage}\ | 189 | %{coverage:-fprofile-arcs -ftest-coverage}\ |
190 | %{fprofile-arcs|fprofile-generate*|coverage:\ | 190 | %{fprofile-arcs|fprofile-generate*|coverage:\ |
191 | %{!fprofile-update=single:\ | 191 | %{!fprofile-update=single:\ |
192 | - %{pthread:-fprofile-update=prefer-atomic}}}"; | 192 | - %{pthread:-fprofile-update=prefer-atomic}}}"; |
193 | + %{pthread:-fprofile-update=prefer-atomic}}}" | 193 | + %{pthread:-fprofile-update=prefer-atomic}}}" |
194 | +#ifdef POISON_BY_DEFAULT | 194 | +#ifdef POISON_BY_DEFAULT |
195 | + " -Werror=poison-system-directories" | 195 | + " %{!Wno-error=poison-system-directories:-Werror=poison-system-directories}" |
196 | +#endif | 196 | +#endif |
197 | + ; | 197 | + ; |
198 | 198 | ||
199 | static const char *asm_options = | 199 | static const char *asm_options = |
200 | "%{-target-help:%:print-asm-header()} " | 200 | "%{-target-help:%:print-asm-header()} " |
201 | diff --git a/gcc/incpath.cc b/gcc/incpath.cc | 201 | diff --git a/gcc/incpath.cc b/gcc/incpath.cc |
202 | index bd2a97938eb..c80f100f476 100644 | 202 | index 622204a38..5ac03c086 100644 |
203 | --- a/gcc/incpath.cc | 203 | --- a/gcc/incpath.cc |
204 | +++ b/gcc/incpath.cc | 204 | +++ b/gcc/incpath.cc |
205 | @@ -26,6 +26,7 @@ | 205 | @@ -26,6 +26,7 @@ |