diff --git a/cmake/linker/ld/linker_libraries.cmake b/cmake/linker/ld/linker_libraries.cmake index 1305d682ab5..489f1f3859b 100644 --- a/cmake/linker/ld/linker_libraries.cmake +++ b/cmake/linker/ld/linker_libraries.cmake @@ -16,7 +16,6 @@ if(NOT CONFIG_NATIVE_BUILD) endif() if(CONFIG_CPP - AND NOT CONFIG_MINIMAL_LIBCPP AND NOT CONFIG_NATIVE_LIBRARY # When new link principle is fully introduced, then the below condition can # be removed, and instead the external module c++ should use: diff --git a/cmake/linker/lld/linker_flags.cmake b/cmake/linker/lld/linker_flags.cmake index f11139aa1e2..48085df4443 100644 --- a/cmake/linker/lld/linker_flags.cmake +++ b/cmake/linker/lld/linker_flags.cmake @@ -7,7 +7,7 @@ # and adjust for lld specifics afterwards. include(${ZEPHYR_BASE}/cmake/linker/ld/linker_flags.cmake OPTIONAL) -if(NOT CONFIG_MINIMAL_LIBCPP AND NOT CONFIG_NATIVE_LIBRARY AND NOT CONFIG_EXTERNAL_MODULE_LIBCPP) +if(NOT CONFIG_NATIVE_LIBRARY AND NOT CONFIG_EXTERNAL_MODULE_LIBCPP) set_property(TARGET linker PROPERTY cpp_base ${LINKERFLAGPREFIX},-z,norelro) endif() diff --git a/cmake/linker/lld/linker_libraries.cmake b/cmake/linker/lld/linker_libraries.cmake index 2347898ad64..69690d2a051 100644 --- a/cmake/linker/lld/linker_libraries.cmake +++ b/cmake/linker/lld/linker_libraries.cmake @@ -8,7 +8,6 @@ set_linker_property(NO_CREATE TARGET linker PROPERTY rt_library "") set_linker_property(TARGET linker PROPERTY c++_library "-lc++;-lc++abi") if(CONFIG_CPP - AND NOT CONFIG_MINIMAL_LIBCPP AND NOT CONFIG_NATIVE_LIBRARY # When new link principle is fully introduced, then the below condition can # be removed, and instead the external module c++ should use: diff --git a/cmake/linker/xt-ld/linker_flags.cmake b/cmake/linker/xt-ld/linker_flags.cmake index af464509b87..ab66461e452 100644 --- a/cmake/linker/xt-ld/linker_flags.cmake +++ b/cmake/linker/xt-ld/linker_flags.cmake @@ -7,7 +7,7 @@ check_set_linker_property(TARGET linker PROPERTY base ${LINKERFLAGPREFIX},--build-id=none ) -if(NOT CONFIG_MINIMAL_LIBCPP AND NOT CONFIG_NATIVE_LIBRARY AND NOT CONFIG_EXTERNAL_MODULE_LIBCPP) +if(NOT CONFIG_NATIVE_LIBRARY AND NOT CONFIG_EXTERNAL_MODULE_LIBCPP) set_property(TARGET linker PROPERTY cpp_base -lstdc++) endif() diff --git a/lib/cpp/minimal/CMakeLists.txt b/lib/cpp/minimal/CMakeLists.txt index a79ca36d5e1..850087bcafa 100644 --- a/lib/cpp/minimal/CMakeLists.txt +++ b/lib/cpp/minimal/CMakeLists.txt @@ -1,5 +1,9 @@ # SPDX-License-Identifier: Apache-2.0 +# Clear the toolchain defined C++ library property when using minimal C++ lib. +set_linker_property(PROPERTY c++_library "") +set_linker_property(PROPERTY cpp_base "") + zephyr_system_include_directories(include) zephyr_sources(