[PATCH] D61448: build: disable unwind tables whenever possible

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 09:31:02 PDT 2019


compnerd created this revision.
compnerd added reviewers: smeenai, beanz.
Herald added subscribers: kristof.beyls, javed.absar, mgorny.
Herald added a project: LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D61448

Files:
  cmake/modules/AddLLVM.cmake


Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -21,6 +21,8 @@
   else()
     if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
       list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions")
+      list(APPEND LLVM_COMPILE_FLAGS "-fno-unwind-tables")
+      list(APPEND LLVM_COMPILE_FLAGS "-fno-asynchronous-unwind-tables")
     elseif(MSVC)
       list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
       list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61448.197804.patch
Type: text/x-patch
Size: 556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190502/65eb58b5/attachment.bin>


More information about the llvm-commits mailing list