@@ -185,6 +185,19 @@ index bb07cc244e3..ce161d3c853 100644
/* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
+@@ -1265,7 +1270,11 @@ static const char *cc1_options =
+ %{coverage:-fprofile-arcs -ftest-coverage}\
+ %{fprofile-arcs|fprofile-generate*|coverage:\
+ %{!fprofile-update=single:\
+- %{pthread:-fprofile-update=prefer-atomic}}}";
++ %{pthread:-fprofile-update=prefer-atomic}}}"
++#ifdef POISON_BY_DEFAULT
++ " -Werror=poison-system-directories"
++#endif
++ ;
+
+ static const char *asm_options =
+ "%{-target-help:%:print-asm-header()} "
diff --git a/gcc/incpath.cc b/gcc/incpath.cc
index bd2a97938eb..c80f100f476 100644
--- a/gcc/incpath.cc
The -Werror=poison-system-directories argument was being passed to runs where _just_ CPP was being invoked, so it wasn't passed to runs which also compile. Add the options to cc1_options so that compile runs also have fatal poisoning errors. Signed-off-by: Ross Burton <ross.burton@arm.com> --- .../gcc/0002-gcc-poison-system-directories.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+)