0019-Ensure-target-gcc-headers-can-be-included.patch 2.4 KB

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