Skip to content

Commit 6945f41

Browse files
committed
xtensa: support for C++ library using Xtensa toolchain
Changes needed to build C++ code using Xtensa toolchain. Signed-off-by: William Tambe <williamt@cadence.com>
1 parent 9579c9e commit 6945f41

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmake/compiler/xt-clang/compiler_flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set_compiler_property(PROPERTY nostdinc_include)
1111
# For C++ code, re-add the standard includes directory which was
1212
# cleared up from nostdinc_inlcude in above lines with no
1313
# "include-fixed" this time"
14-
if(CONFIG_CPP)
14+
if(CONFIG_CPP AND NOT CONFIG_XTENSA_LIBC)
1515
execute_process(
1616
COMMAND ${CMAKE_C_COMPILER} --print-file-name=include/stddef.h
1717
OUTPUT_VARIABLE _OUTPUT

cmake/linker/xt-ld/linker_flags.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ check_set_linker_property(TARGET linker PROPERTY base
88
)
99

1010
if(NOT CONFIG_NATIVE_LIBRARY AND NOT CONFIG_EXTERNAL_MODULE_LIBCPP)
11-
set_property(TARGET linker PROPERTY cpp_base -lstdc++)
11+
if (CONFIG_XTENSA_LIBC)
12+
set_property(TARGET linker PROPERTY cpp_base -lstdc++11)
13+
else()
14+
set_property(TARGET linker PROPERTY cpp_base -lstdc++)
15+
endif()
1216
endif()
1317

1418
check_set_linker_property(TARGET linker PROPERTY baremetal

0 commit comments

Comments
 (0)