Skip to content

[libc++abi] Introduce LIBCXXABI_ENABLE_DEMANGLER #132130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions libcxxabi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ include(CMakeDependentOption)
include(HandleCompilerRT)

# Define options.
option(LIBCXXABI_ENABLE_DEMANGLER
"Provide support for demangling in the runtime.
When disabled, libc++abi does not support the name demangler API." ON)
option(LIBCXXABI_ENABLE_EXCEPTIONS
"Provide support for exceptions in the runtime.
When disabled, libc++abi does not support stack unwinding and other exceptions-related features." ON)
Expand Down Expand Up @@ -129,8 +132,6 @@ option(LIBCXXABI_BAREMETAL "Build libc++abi for baremetal targets." OFF)
# The default terminate handler attempts to demangle uncaught exceptions, which
# causes extra I/O and demangling code to be pulled in.
option(LIBCXXABI_SILENT_TERMINATE "Set this to make the terminate handler default to a silent alternative" OFF)
option(LIBCXXABI_NON_DEMANGLING_TERMINATE "Set this to make the terminate handler
avoid demangling" OFF)

if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
Expand Down Expand Up @@ -431,7 +432,7 @@ if (LIBCXXABI_SILENT_TERMINATE)
add_definitions(-DLIBCXXABI_SILENT_TERMINATE)
endif()

if (LIBCXXABI_NON_DEMANGLING_TERMINATE)
if (NOT LIBCXXABI_ENABLE_DEMANGLER)
add_definitions(-DLIBCXXABI_NON_DEMANGLING_TERMINATE)
endif()

Expand Down
7 changes: 6 additions & 1 deletion libcxxabi/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ set(LIBCXXABI_SOURCES
# C++ABI files
cxa_aux_runtime.cpp
cxa_default_handlers.cpp
cxa_demangle.cpp
cxa_exception_storage.cpp
cxa_guard.cpp
cxa_handlers.cpp
Expand All @@ -19,6 +18,12 @@ set(LIBCXXABI_SOURCES
private_typeinfo.cpp
)

if (LIBCXXABI_ENABLE_DEMANGLER)
list(APPEND LIBCXXABI_SOURCES
cxa_demangle.cpp
)
endif()

if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
list(APPEND LIBCXXABI_SOURCES
stdlib_new_delete.cpp
Expand Down