[libunwind] Add CMake option to enable execute-only code generation on AArch64 (#140554)

For a full toolchain supporting execute-only code generation the runtime
libraries also need to be pre-compiled with it enabled. The generic
`RUNTIMES_EXECUTE_ONLY_CODE` CMake option can now be used during build
configuration to enable execute-only code generation in libunwind.

Related RFC:
https://discourse.llvm.org/t/rfc-execute-only-code-support-for-runtime-libraries-on-aarch64/86180
This commit is contained in:
Csanád Hajdú 2025-11-07 09:36:32 +01:00 committed by GitHub
parent 9d18e92ee7
commit 4508f44af7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View File

@ -332,6 +332,10 @@ if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
endif()
endif()
if (RUNTIMES_EXECUTE_ONLY_CODE)
add_compile_definitions(_LIBUNWIND_EXECUTE_ONLY_CODE)
endif()
#===============================================================================
# Setup Source Code
#===============================================================================

View File

@ -18,6 +18,8 @@
#if defined(_AIX)
.toc
#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
.section .text,"axy",@progbits,unique,0
#else
.text
#endif

View File

@ -18,6 +18,8 @@
#if defined(_AIX)
.toc
#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
.section .text,"axy",@progbits,unique,0
#else
.text
#endif