Skip to content
Snippets Groups Projects
Unverified Commit f8e1419a authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

newlib.mk: llvm, fix newlib-nano header not used

In the previous state, with llvm and arm for example, newlib-nano include dir
NEWLIB_NANO_INCLUDE_DIR is placed after NEWLIB_INCLUDES and so the default
'newlib.h' is used instead of the nano version.
parent 0a53b614
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,13 @@ ifeq ($(TOOLCHAIN),llvm) ...@@ -69,6 +69,13 @@ ifeq ($(TOOLCHAIN),llvm)
# in case some header is missing from the cross tool chain # in case some header is missing from the cross tool chain
NEWLIB_INCLUDES := -isystem $(NEWLIB_INCLUDE_DIR) -nostdinc NEWLIB_INCLUDES := -isystem $(NEWLIB_INCLUDE_DIR) -nostdinc
NEWLIB_INCLUDES += $(addprefix -isystem ,$(abspath $(wildcard $(dir $(NEWLIB_INCLUDE_DIR))/usr/include))) NEWLIB_INCLUDES += $(addprefix -isystem ,$(abspath $(wildcard $(dir $(NEWLIB_INCLUDE_DIR))/usr/include)))
# Newlib includes should go before GCC includes. This is especially important
# when using Clang, because Clang will yield compilation errors on some GCC-
# bundled headers. Clang compatible versions of those headers are already
# provided by Newlib, so placing this directory first will eliminate those problems.
# The above problem was observed with LLVM 3.9.1 when building against GCC 6.3.0 headers.
INCLUDES := $(NEWLIB_INCLUDES) $(INCLUDES)
endif endif
ifeq (1,$(USE_NEWLIB_NANO)) ifeq (1,$(USE_NEWLIB_NANO))
...@@ -79,10 +86,3 @@ ifeq (1,$(USE_NEWLIB_NANO)) ...@@ -79,10 +86,3 @@ ifeq (1,$(USE_NEWLIB_NANO))
# the regular system include dirs. # the regular system include dirs.
INCLUDES := -isystem $(NEWLIB_NANO_INCLUDE_DIR) $(INCLUDES) INCLUDES := -isystem $(NEWLIB_NANO_INCLUDE_DIR) $(INCLUDES)
endif endif
# Newlib includes should go before GCC includes. This is especially important
# when using Clang, because Clang will yield compilation errors on some GCC-
# bundled headers. Clang compatible versions of those headers are already
# provided by Newlib, so placing this directory first will eliminate those problems.
# The above problem was observed with LLVM 3.9.1 when building against GCC 6.3.0 headers.
export INCLUDES := $(NEWLIB_INCLUDES) $(INCLUDES)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment