summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregor Herburger <gregor.herburger@ew.tq-group.com>2025-09-10 13:38:02 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-15 17:57:23 +0100
commit6c9726de09babd9cc4e81521c5762b32c42d7649 (patch)
treef4ff32624bc330921388cee32b41935043f4dd93
parentdcb834c4f8ebbef967c9e92e008d288ad5278e90 (diff)
downloadpoky-6c9726de09babd9cc4e81521c5762b32c42d7649.tar.gz
gcc: fix local include path for nativesdk-gcc
By default GCC uses /usr/local/include as the local include prefix. When building the nativesdk-gcc package, this makes gcc look in the hosts /usr/local/include and may use non-SDK headers. Example from current poky: $# x86_64-pokysdk-linux-gcc -v -E - </dev/null #include <...> search starts here: /opt/poky/5.2.99+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/15.2.0/include /usr/local/include /opt/poky/5.2.99+snapshot/sysroots/x86_64-pokysdk-linux/usr/include /opt/poky/5.2.99+snapshot/sysroots/x86_64-pokysdk-linux/usr/lib/gcc/x86_64-pokysdk-linux/15.2.0/include-fixed Define LOCAL_INCLUDE_DIR along with the other include directories in defaults.h to set the local include directory to the directory in the sysroot. (From OE-Core rev: dadd1e0ec6ad4cf572964c18fa304be9f382f885) Signed-off-by: Gregor Herburger <gregor.herburger@ew.tq-group.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-configure-common.inc2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 50ff0d2e82..f152ae5555 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -72,6 +72,7 @@ CPPFLAGS = ""
72SYSTEMHEADERS = "${target_includedir}" 72SYSTEMHEADERS = "${target_includedir}"
73SYSTEMLIBS = "${target_base_libdir}/" 73SYSTEMLIBS = "${target_base_libdir}/"
74SYSTEMLIBS1 = "${target_libdir}/" 74SYSTEMLIBS1 = "${target_libdir}/"
75SYSTEMLOCALHEADERS = "${target_prefix}/local/include"
75 76
76do_configure:prepend () { 77do_configure:prepend () {
77 # teach gcc to find correct target includedir when checking libc ssp support 78 # teach gcc to find correct target includedir when checking libc ssp support
@@ -83,6 +84,7 @@ do_configure:prepend () {
83#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}" 84#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
84#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}" 85#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
85#define SYSTEMLIBS_DIR "${SYSTEMLIBS}" 86#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
87#define LOCAL_INCLUDE_DIR "${SYSTEMLOCALHEADERS}"
86#endif /* ! GCC_DEFAULTS_H */ 88#endif /* ! GCC_DEFAULTS_H */
87_EOF 89_EOF
88 mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h 90 mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h