summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-8.1/0004-gcc-poison-dir-extend.patch
blob: 1072d5b18fb9ba4afcd9f815cc6dc4d4a26df4a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 97370eadcd10da5da529dfb734df56993ce24644 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 09:00:34 +0400
Subject: [PATCH 04/39] gcc-poison-dir-extend

Add /sw/include and /opt/include based on the original
zecke-no-host-includes.patch patch.  The original patch checked for
/usr/include, /sw/include and /opt/include and then triggered a failure and
aborted.

Instead, we add the two missing items to the current scan.  If the user
wants this to be a failure, they can add "-Werror=poison-system-directories".

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>

Upstream-Status: Pending
---
 gcc/incpath.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/incpath.c b/gcc/incpath.c
index e3b7a21966f..9a457e02dd3 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -404,7 +404,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
          {
           if ((!strncmp (p->name, "/usr/include", 12))
               || (!strncmp (p->name, "/usr/local/include", 18))
-              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
+              || (!strncmp (p->name, "/usr/X11R6/include", 18))
+              || (!strncmp (p->name, "/sw/include", 11))
+              || (!strncmp (p->name, "/opt/include", 12)))
             warning (OPT_Wpoison_system_directories,
                      "include location \"%s\" is unsafe for "
                      "cross-compilation",
-- 
2.17.0