Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 1 | From d27ba49e2e5c608c43265462d6831363cc7f565b Mon Sep 17 00:00:00 2001 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 20 Feb 2015 10:25:11 +0000 |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 4 | Subject: [PATCH 19/36] Ensure target gcc headers can be included |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 5 | |
| 6 | There are a few headers installed as part of the OpenEmbedded |
| 7 | gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe |
| 8 | built for the target architecture, these are within the target |
| 9 | sysroot and not cross/nativesdk; thus they weren't able to be |
| 10 | found by gcc with the existing search paths. Add support for |
| 11 | picking up these headers under the sysroot supplied on the gcc |
| 12 | command line in order to resolve this. |
| 13 | |
| 14 | Upstream-Status: Pending |
| 15 | |
| 16 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 18 | --- |
| 19 | gcc/Makefile.in | 2 ++ |
| 20 | gcc/cppdefault.c | 4 ++++ |
| 21 | gcc/defaults.h | 9 +++++++++ |
| 22 | gcc/gcc.c | 7 ------- |
| 23 | 4 files changed, 15 insertions(+), 7 deletions(-) |
| 24 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 25 | --- a/gcc/Makefile.in |
| 26 | +++ b/gcc/Makefile.in |
| 27 | @@ -618,6 +618,7 @@ libexecdir = @libexecdir@ |
| 28 | |
| 29 | # Directory in which the compiler finds libraries etc. |
| 30 | libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) |
Brad Bishop | c68388fc | 2019-08-26 01:33:31 -0400 | [diff] [blame] | 31 | +libsubdir_target = $(target_noncanonical)/$(version) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 32 | # Directory in which the compiler finds executables |
| 33 | libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) |
| 34 | # Directory in which all plugin resources are installed |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 35 | @@ -2866,6 +2867,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localed |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 36 | |
| 37 | PREPROCESSOR_DEFINES = \ |
| 38 | -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \ |
| 39 | + -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \ |
| 40 | -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \ |
| 41 | -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ |
| 42 | -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 43 | --- a/gcc/cppdefault.c |
| 44 | +++ b/gcc/cppdefault.c |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 45 | @@ -59,6 +59,10 @@ const struct default_include cpp_include |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 46 | /* This is the dir for gcc's private headers. */ |
| 47 | { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, |
| 48 | #endif |
| 49 | +#ifdef GCC_INCLUDE_SUBDIR_TARGET |
| 50 | + /* This is the dir for gcc's private headers under the specified sysroot. */ |
| 51 | + { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 }, |
| 52 | +#endif |
| 53 | #ifdef LOCAL_INCLUDE_DIR |
| 54 | /* /usr/local/include comes before the fixincluded header files. */ |
| 55 | { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, |