From ced0327dd4a380e1702dccbb4072fd99b201e22c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lu=C3=ADs=20Marques?= Date: Mon, 6 Mar 2023 13:08:28 +0100 Subject: [PATCH] [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 --- llvm/cmake/modules/AddLLVM.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 7508388..c4c9b375 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() -- 2.7.4