[llvm] ced0327 - [CMake] Enforce LLVM_ENABLE_UNWIND_TABLES

Luís Marques via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 04:14:53 PST 2023


Author: Luís Marques
Date: 2023-03-06T12:14:20Z
New Revision: ced0327dd4a380e1702dccbb4072fd99b201e22c

URL: https://github.com/llvm/llvm-project/commit/ced0327dd4a380e1702dccbb4072fd99b201e22c
DIFF: https://github.com/llvm/llvm-project/commit/ced0327dd4a380e1702dccbb4072fd99b201e22c.diff

LOG: [CMake] Enforce LLVM_ENABLE_UNWIND_TABLES

In D61448 the cmake option `LLVM_ENABLE_UNWIND_TABLES` was added.
Despite the name suggesting that the option enables unwind tables, that
patch only uses it to disable them. That makes a difference for
architectures where unwind tables aren't enabled by default. The lack of
unwind tables impacts backtraces and the current handling of the option
doesn't allow enabling them. This patch makes an ON value of
`LLVM_ENABLE_UNWIND_TABLES` actually enable unwind tables.

Differential Revision: https://reviews.llvm.org/D144178

Added: 
    

Modified: 
    llvm/cmake/modules/AddLLVM.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 750838875cd0e..c4c9b375ba929 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -25,7 +25,9 @@ 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)
+      if(LLVM_ENABLE_UNWIND_TABLES)
+        list(APPEND LLVM_COMPILE_FLAGS "-funwind-tables")
+      else()
         list(APPEND LLVM_COMPILE_FLAGS "-fno-unwind-tables")
         list(APPEND LLVM_COMPILE_FLAGS "-fno-asynchronous-unwind-tables")
       endif()


        


More information about the llvm-commits mailing list