Skip to content

Commit d015bf8

Browse files
Il-Capitanovinay-deshmukh
authored andcommitted
[libunwind] Add CMake option to enable execute-only code generation on AArch64 (llvm#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
1 parent ff3eb6f commit d015bf8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

libunwind/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ if (C_SUPPORTS_COMMENT_LIB_PRAGMA)
332332
endif()
333333
endif()
334334

335+
if (RUNTIMES_EXECUTE_ONLY_CODE)
336+
add_compile_definitions(_LIBUNWIND_EXECUTE_ONLY_CODE)
337+
endif()
338+
335339
#===============================================================================
336340
# Setup Source Code
337341
#===============================================================================

libunwind/src/UnwindRegistersRestore.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#if defined(_AIX)
2020
.toc
21+
#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
22+
.section .text,"axy",@progbits,unique,0
2123
#else
2224
.text
2325
#endif

libunwind/src/UnwindRegistersSave.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#if defined(_AIX)
2020
.toc
21+
#elif defined(__aarch64__) && defined(__ELF__) && defined(_LIBUNWIND_EXECUTE_ONLY_CODE)
22+
.section .text,"axy",@progbits,unique,0
2123
#else
2224
.text
2325
#endif

0 commit comments

Comments
 (0)