llvm.org GIT mirror llvm / 86b49e2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359819 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool 5 months ago
3 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
350350 set(ENABLE_BACKTRACES 1)
351351 endif()
352352
353 option(LLVM_ENABLE_UNWIND_TABLES "Emit unwind tables for the libraries" ON)
354
353355 option(LLVM_ENABLE_CRASH_OVERRIDES "Enable crash overrides." ON)
354356 if(LLVM_ENABLE_CRASH_OVERRIDES)
355357 set(ENABLE_CRASH_OVERRIDES 1)
2020 else()
2121 if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
2222 list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions")
23 if(NOT LLVM_ENABLE_UNWIND_TABLES)
24 list(APPEND LLVM_COMPILE_FLAGS "-fno-unwind-tables")
25 list(APPEND LLVM_COMPILE_FLAGS "-fno-asynchronous-unwind-tables")
26 endif()
2327 elseif(MSVC)
2428 list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
2529 list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-")
264264
265265 **LLVM_ENABLE_THREADS**:BOOL
266266 Build with threads support, if available. Defaults to ON.
267
268 **LLVM_ENABLE_UNWIND_TABLES**:BOOL
269 Enable unwind tables in the binary. Disabling unwind tables can reduce the
270 size of the libraries. Defaults to ON.
267271
268272 **LLVM_CXX_STD**:STRING
269273 Build with the specified C++ standard. Defaults to "c++11".