]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
gcc: fix local include path for nativesdk-gcc
authorGregor Herburger <gregor.herburger@ew.tq-group.com>
Wed, 10 Sep 2025 11:38:02 +0000 (13:38 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 15 Sep 2025 16:52:52 +0000 (17:52 +0100)
commitdadd1e0ec6ad4cf572964c18fa304be9f382f885
treeb81b1b58c0aa6b4adfad87d98ce8dd204950a6b5
parent0a886fcacaab0fbce1306c0f99d482f940a8f705
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.

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>
meta/recipes-devtools/gcc/gcc-configure-common.inc