diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-05-02 19:37:26 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-05-02 19:37:26 +0000 |
| commit | a7c766b51dfb7b060d5c5ccfbe5a0dcf00653018 (patch) | |
| tree | edee9b5f5449a2923ac06d9b43dcbfae9985c9c3 /llvm/cmake | |
| parent | 366212726a1a7caef08ebb1ebf84d511841d4f99 (diff) | |
| download | bcm5719-llvm-a7c766b51dfb7b060d5c5ccfbe5a0dcf00653018.tar.gz bcm5719-llvm-a7c766b51dfb7b060d5c5ccfbe5a0dcf00653018.zip | |
build: add option to disable unwind tables
The unwind tables (`.eh_frame`, `.arm.extab`) add a significant chunk of data to
the final binaries. These should not be needed normally, particularly when
exceptions are disabled. This enables shrinking `lldb-server` by ~18% (3 MiB)
when built with gold.
llvm-svn: 359819
Diffstat (limited to 'llvm/cmake')
| -rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 2fefe838ee4..d10831ff028 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -21,6 +21,10 @@ function(llvm_update_compile_flags name) else() if(LLVM_COMPILER_IS_GCC_COMPATIBLE) list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions") + if(NOT LLVM_ENABLE_UNWIND_TABLES) + list(APPEND LLVM_COMPILE_FLAGS "-fno-unwind-tables") + list(APPEND LLVM_COMPILE_FLAGS "-fno-asynchronous-unwind-tables") + endif() elseif(MSVC) list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0) list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-") |

