Skip to content

Commit

Permalink
[libunwind] Enable c18n sandbox.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstolfa committed Mar 21, 2024
1 parent 8d3ec3d commit c4b5cfd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libunwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ option(LIBUNWIND_IS_BAREMETAL "Build libunwind for baremetal targets." OFF)
option(LIBUNWIND_USE_FRAME_HEADER_CACHE "Cache frame headers for unwinding. Requires locking dl_iterate_phdr." OFF)
option(LIBUNWIND_REMEMBER_HEAP_ALLOC "Use heap instead of the stack for .cfi_remember_state." OFF)
option(LIBUNWIND_INSTALL_HEADERS "Install the libunwind headers." OFF)
option(LIBUNWIND_SANDBOX_OTYPES "Use a libunwind implementation that assumes a c18n RTLD using otypes." ON)
option(LIBUNWIND_SANDBOX_HARDENED "Harden the current sandbox implementation." ON)

set(LIBUNWIND_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
"Define suffix of library directory name (32/64)")
Expand Down Expand Up @@ -293,6 +295,16 @@ if (NOT LIBUNWIND_ENABLE_THREADS)
add_compile_flags(-D_LIBUNWIND_HAS_NO_THREADS)
endif()

# Sandboxing and c18n support
if (LIBUNWIND_SANDBOX_OTYPES)
add_compile_flags(-D_LIBUNWIND_SANDBOX_OTYPES)
endif()

# Hardening
if (LIBUNWIND_SANDBOX_HARDENED)
add_compile_flags(-D_LIBUNWIND_SANDBOX_HARDENED)
endif()

# ARM WMMX register support
if (LIBUNWIND_ENABLE_ARM_WMMX)
# __ARM_WMMX is a compiler pre-define (as per the ACLE 2.0). Clang does not
Expand Down

0 comments on commit c4b5cfd

Please sign in to comment.