treewide: Use CONFIG_CPP_EXCEPTIONS instead of CONFIG_EXCEPTIONS

This commit updates all in-tree code to use `CONFIG_CPP_EXCEPTIONS`
instead of `CONFIG_EXCEPTIONS`, which is now deprecated.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit is contained in:
Stephanos Ioannidis 2022-12-09 19:43:43 +09:00 committed by Christopher Friedt
commit 404e7a9bf7
9 changed files with 12 additions and 12 deletions

View file

@ -253,7 +253,7 @@ if(CONFIG_CPP)
zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:${STD_CPP_DIALECT_FLAGS}>) zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:${STD_CPP_DIALECT_FLAGS}>)
endif() endif()
if(NOT CONFIG_EXCEPTIONS) if(NOT CONFIG_CPP_EXCEPTIONS)
# @Intent: Obtain compiler specific flags related to C++ Exceptions # @Intent: Obtain compiler specific flags related to C++ Exceptions
zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,no_exceptions>>) zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,no_exceptions>>)
endif() endif()
@ -1479,7 +1479,7 @@ if(CONFIG_BUILD_OUTPUT_ADJUST_LMA)
) )
endif() endif()
if(NOT CONFIG_EXCEPTIONS) if(NOT CONFIG_CPP_EXCEPTIONS)
set(eh_frame_section ".eh_frame") set(eh_frame_section ".eh_frame")
else() else()
set(eh_frame_section "") set(eh_frame_section "")

View file

@ -15,7 +15,7 @@ endif()
set_ifndef(LINKERFLAGPREFIX -Wl) set_ifndef(LINKERFLAGPREFIX -Wl)
if(NOT "${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "host") if(NOT "${ZEPHYR_TOOLCHAIN_VARIANT}" STREQUAL "host")
if(CONFIG_EXCEPTIONS) if(CONFIG_CPP_EXCEPTIONS)
# When building with C++ Exceptions, it is important that crtbegin and crtend # When building with C++ Exceptions, it is important that crtbegin and crtend
# are linked at specific locations. # are linked at specific locations.
# The location is so important that we cannot let this be controlled by normal # The location is so important that we cannot let this be controlled by normal

View file

@ -60,7 +60,7 @@ initialized but before the application :c:func:`main()` function. Therefore,
use of C++ is restricted to application code. use of C++ is restricted to application code.
In order to make use of the C++ exceptions, the In order to make use of the C++ exceptions, the
:kconfig:option:`CONFIG_EXCEPTIONS` must be selected in the application :kconfig:option:`CONFIG_CPP_EXCEPTIONS` must be selected in the application
configuration file. configuration file.
Zephyr Minimal C++ Library Zephyr Minimal C++ Library

View file

@ -544,7 +544,7 @@ SECTIONS
/* /*
* eh_frame section won't be removed even with "--gc-sections" by LLVM lld. * eh_frame section won't be removed even with "--gc-sections" by LLVM lld.
*/ */
#if !defined(CONFIG_EXCEPTIONS) #if !defined(CONFIG_CPP_EXCEPTIONS)
/DISCARD/ : { *(.eh_frame) } /DISCARD/ : { *(.eh_frame) }
#endif #endif

View file

@ -220,7 +220,7 @@ SECTIONS
/* /*
* eh_frame section won't be removed even with "--gc-sections" by LLVM lld. * eh_frame section won't be removed even with "--gc-sections" by LLVM lld.
*/ */
#if !defined(CONFIG_EXCEPTIONS) #if !defined(CONFIG_CPP_EXCEPTIONS)
/DISCARD/ : { *(.eh_frame) } /DISCARD/ : { *(.eh_frame) }
#endif #endif

View file

@ -10,12 +10,12 @@
*(.gcc_except_table .gcc_except_table.*) *(.gcc_except_table .gcc_except_table.*)
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#if defined (CONFIG_EXCEPTIONS) #if defined (CONFIG_CPP_EXCEPTIONS)
SECTION_PROLOGUE(.tm_clone_table,,) SECTION_PROLOGUE(.tm_clone_table,,)
{ {
KEEP (*(SORT_NONE(EXCLUDE_FILE (*crtend.o) .tm_clone_table))) KEEP (*(SORT_NONE(EXCLUDE_FILE (*crtend.o) .tm_clone_table)))
KEEP (*(SORT_NONE(.tm_clone_table))) KEEP (*(SORT_NONE(.tm_clone_table)))
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_EXCEPTIONS */ #endif /* CONFIG_CPP_EXCEPTIONS */
#endif /* CONFIG_CPP */ #endif /* CONFIG_CPP */

View file

@ -10,7 +10,7 @@
*(.gcc_except_table .gcc_except_table.*) *(.gcc_except_table .gcc_except_table.*)
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#if defined (CONFIG_EXCEPTIONS) #if defined (CONFIG_CPP_EXCEPTIONS)
SECTION_PROLOGUE(.eh_frame_hdr,,) SECTION_PROLOGUE(.eh_frame_hdr,,)
{ {
*(.eh_frame_hdr) *(.eh_frame_hdr)
@ -21,6 +21,6 @@
KEEP (*(SORT_NONE(EXCLUDE_FILE (*crtend.o) .eh_frame))) KEEP (*(SORT_NONE(EXCLUDE_FILE (*crtend.o) .eh_frame)))
KEEP (*(SORT_NONE(.eh_frame))) KEEP (*(SORT_NONE(.eh_frame)))
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) } GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_EXCEPTIONS */ #endif /* CONFIG_CPP_EXCEPTIONS */
#endif /* CONFIG_CPP */ #endif /* CONFIG_CPP */

View file

@ -67,7 +67,7 @@ ZTEST(libcxx_tests, test_make_unique)
zassert_equal(make_unique_data::dtors, 1, "dtor count not incremented"); zassert_equal(make_unique_data::dtors, 1, "dtor count not incremented");
} }
#if defined(CONFIG_EXCEPTIONS) && !defined(CONFIG_BOARD_M2GL025_MIV) #if defined(CONFIG_CPP_EXCEPTIONS) && !defined(CONFIG_BOARD_M2GL025_MIV)
static void throw_exception(void) static void throw_exception(void)
{ {
throw 42; throw 42;

View file

@ -7,7 +7,7 @@ tests:
tags: cpp tags: cpp
extra_configs: extra_configs:
- CONFIG_NEWLIB_LIBC=y - CONFIG_NEWLIB_LIBC=y
- CONFIG_EXCEPTIONS=y - CONFIG_CPP_EXCEPTIONS=y
integration_platforms: integration_platforms:
- mps2_an385 - mps2_an385
cpp.libcxx.newlib_nano: cpp.libcxx.newlib_nano: