7aa8e43add
When we build with newlib we don't set -nostdinc. In that case make sure that we leave it to the toolchain to set the system include paths. The one exception to leaving to the toolchain to set the system include paths is the path to the newlib headers. Since we build with -ffreestanding we need to make sure the newlib header path is the before the toolchain headers. Otherwise the toolchain's 'freestanding' headers get picked up and that causes issues (for example getting PRI*64 defined properly from inttypes.h due to __STDC_HOSTED__ being '0'). For newlib we accomplish this by having the only system header specified by zephyr_system_include_directories() being just the newlib headers. Note: for minlibc we leave things alone as things just happen to work as the -I include of the libc headers takes precedence over -isystem so we get the libc headers over the toolchain ones. For the newlib case it appears that setting both -I and -isystem for the same dir causes the -I to be ignored. Fixes #14310 Signed-off-by: Kumar Gala <kumar.gala@linaro.org> |
||
---|---|---|
.. | ||
minimal | ||
newlib | ||
CMakeLists.txt | ||
Kconfig |