Skip to content

Commit a4dcc5e

Browse files
ARC: MWDT: fix include path for the case of C/C++ lib usage
Fix include path of headers provided by MWDT toolchain for the case of MWDT C/C++ lib usage. Signed-off-by: Eugeniy Paltsev <[email protected]> Signed-off-by: Evgeniy Paltsev <[email protected]>
1 parent 85053fd commit a4dcc5e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cmake/compiler/arcmwdt/compiler_flags.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,11 @@ set_compiler_property(PROPERTY warning_error_misra_sane -Werror=vla)
115115

116116
set_compiler_property(PROPERTY cstd -std=)
117117

118-
if (NOT CONFIG_NEWLIB_LIBC AND
119-
NOT CONFIG_NATIVE_APPLICATION)
118+
if (NOT CONFIG_ARCMWDT_LIBC)
120119
set_compiler_property(PROPERTY nostdinc -Hno_default_include -Hnoarcexlib)
121-
set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC})
122120
endif()
123121

122+
set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC})
124123

125124
# C++ std options
126125
set_property(TARGET compiler-cpp PROPERTY dialect_cpp98 "-std=c++98")
@@ -173,7 +172,7 @@ set_compiler_property(PROPERTY security_canaries -fstack-protector-all)
173172
set_compiler_property(PROPERTY security_fortify "")
174173

175174
# Required C++ flags when using mwdt
176-
set_property(TARGET compiler-cpp PROPERTY required "")
175+
set_property(TARGET compiler-cpp PROPERTY required "-Hcplus" "-Hoff=Stackcheck_alloca")
177176

178177
# Compiler flag for turning off thread-safe initialization of local statics
179178
set_property(TARGET compiler-cpp PROPERTY no_threadsafe_statics "-fno-threadsafe-statics")

cmake/compiler/arcmwdt/target.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ set(NOSTDINC "")
2626

2727
list(APPEND NOSTDINC ${TOOLCHAIN_HOME}/arc/inc)
2828

29+
if(CONFIG_ARCMWDT_LIBC AND CONFIG_LIB_CPLUSPLUS)
30+
list(APPEND NOSTDINC ${TOOLCHAIN_HOME}/arc/lib/src/c++/inc)
31+
endif()
32+
2933
# For CMake to be able to test if a compiler flag is supported by the
3034
# toolchain we need to give CMake the necessary flags to compile and
3135
# link a dummy C file.

0 commit comments

Comments
 (0)