diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-11-16 19:22:42 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2016-06-22 07:53:22 +0200 |
commit | 65c27afba3d7287d85818d6a08b6169ebbbdd37b (patch) | |
tree | e22e8f8f5c6975609df6d47a911266887fb9ec19 /patches/gcc-5.4.0/0200-no-host-includes.patch | |
parent | 08b2c355cfd49ca3037619dece7119c80b47863d (diff) | |
download | OSELAS.Toolchain-65c27afba3d7287d85818d6a08b6169ebbbdd37b.tar.gz OSELAS.Toolchain-65c27afba3d7287d85818d6a08b6169ebbbdd37b.tar.xz |
gcc-5.4.0 patches
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/gcc-5.4.0/0200-no-host-includes.patch')
-rw-r--r-- | patches/gcc-5.4.0/0200-no-host-includes.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/patches/gcc-5.4.0/0200-no-host-includes.patch b/patches/gcc-5.4.0/0200-no-host-includes.patch new file mode 100644 index 0000000..6bc70de --- /dev/null +++ b/patches/gcc-5.4.0/0200-no-host-includes.patch @@ -0,0 +1,55 @@ +From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> +Date: Tue, 1 Nov 2011 18:25:06 +0100 +Subject: [PATCH] no host includes + +With this patch gcc bails out if you include a host include path into +the searchlist (-I). This patch is not intended for upstream and was +inspired by + +http://www.openembedded.org/repo/org.openembedded.dev/packages/gcc/gcc-4.1.1/zecke-no-host-includes.patch + +Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de> +Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> +--- + gcc/incpath.c | 28 ++++++++++++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/gcc/incpath.c b/gcc/incpath.c +index 6c54ca6c1434..3a71eda7a1ff 100644 +--- a/gcc/incpath.c ++++ b/gcc/incpath.c +@@ -451,6 +451,34 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p) + p->construct = 0; + p->user_supplied_p = user_supplied_p; + ++#ifdef CROSS_COMPILE ++ /* A common error when cross compiling is including ++ host headers. This code below will try to fail fast ++ for cross compiling. Currently we consider /usr/include, ++ /opt/include and /sw/include as harmful. */ ++ { ++ unsigned int i; ++ const char *bad_path[] = { ++ "/usr/include", ++ "/usr/local/include", ++ "/sw/include", ++ "/opt/include", ++ }; ++ ++ for (i = 0; i < sizeof(bad_path)/sizeof(bad_path[0]); i++) { ++ if( strstr(p->name, bad_path[i]) == p->name ) { ++ fprintf(stderr,_("\n" ++ "CROSS COMPILE Badness: %s in INCLUDEPATH: %s\n" ++ "\n"), ++ ++ bad_path[i], p->name); ++ ++ exit (FATAL_EXIT_CODE); ++ } ++ } ++ } ++#endif ++ + add_cpp_dir_path (p, chain); + } + |