Skip to content

Commit

Permalink
treewide: Use CONFIG_CPP_EXCEPTIONS instead of CONFIG_EXCEPTIONS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stephanosio authored and cfriedt committed Jan 13, 2023
1 parent 26ede92 commit 404e7a9
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ if(CONFIG_CPP)
zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:${STD_CPP_DIALECT_FLAGS}>)
endif()

if(NOT CONFIG_EXCEPTIONS)
if(NOT CONFIG_CPP_EXCEPTIONS)
# @Intent: Obtain compiler specific flags related to C++ Exceptions
zephyr_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:compiler-cpp,no_exceptions>>)
endif()
Expand Down Expand Up @@ -1479,7 +1479,7 @@ if(CONFIG_BUILD_OUTPUT_ADJUST_LMA)
)
endif()

if(NOT CONFIG_EXCEPTIONS)
if(NOT CONFIG_CPP_EXCEPTIONS)
set(eh_frame_section ".eh_frame")
else()
set(eh_frame_section "")
Expand Down
2 changes: 1 addition & 1 deletion cmake/linker/ld/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif()
set_ifndef(LINKERFLAGPREFIX -Wl)

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
# are linked at specific locations.
# The location is so important that we cannot let this be controlled by normal
Expand Down
2 changes: 1 addition & 1 deletion doc/develop/languages/cpp/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ initialized but before the application :c:func:`main()` function. Therefore,
use of C++ is restricted to application code.

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.

Zephyr Minimal C++ Library
Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/arch/x86/ia32/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ SECTIONS
/*
* 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) }
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/arch/x86/intel64/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ SECTIONS
/*
* 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) }
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/zephyr/linker/cplusplus-ram.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
*(.gcc_except_table .gcc_except_table.*)
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)

#if defined (CONFIG_EXCEPTIONS)
#if defined (CONFIG_CPP_EXCEPTIONS)
SECTION_PROLOGUE(.tm_clone_table,,)
{
KEEP (*(SORT_NONE(EXCLUDE_FILE (*crtend.o) .tm_clone_table)))
KEEP (*(SORT_NONE(.tm_clone_table)))
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_EXCEPTIONS */
#endif /* CONFIG_CPP_EXCEPTIONS */

#endif /* CONFIG_CPP */
4 changes: 2 additions & 2 deletions include/zephyr/linker/cplusplus-rom.ld
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*(.gcc_except_table .gcc_except_table.*)
} GROUP_ROM_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)

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

#endif /* CONFIG_CPP */
2 changes: 1 addition & 1 deletion tests/lib/cpp/libcxx/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ZTEST(libcxx_tests, test_make_unique)
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)
{
throw 42;
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/cpp/libcxx/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tests:
tags: cpp
extra_configs:
- CONFIG_NEWLIB_LIBC=y
- CONFIG_EXCEPTIONS=y
- CONFIG_CPP_EXCEPTIONS=y
integration_platforms:
- mps2_an385
cpp.libcxx.newlib_nano:
Expand Down

0 comments on commit 404e7a9

Please sign in to comment.