[PATCH] D112126: [libunwind] Try to add -unwindlib=none while configuring and building libunwind

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 12:09:05 PDT 2021


mstorsjo added inline comments.


================
Comment at: libunwind/cmake/config-ix.cmake:20-25
+set(CMAKE_REQUIRED_FLAGS_ORIG "${CMAKE_REQUIRED_FLAGS}")
+set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} --unwindlib=none")
+check_c_compiler_flag("" LIBUNWIND_SUPPORTS_UNWINDLIB_NONE_FLAG)
+if (NOT LIBUNWIND_SUPPORTS_UNWINDLIB_NONE_FLAG)
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIG}")
+endif()
----------------
phosek wrote:
> You could also use `cmake_push_check_state` and `cmake_pop_check_state` to save and restore the state instead of separate variable, but either way is fine.
Hmm, thanks - that's maybe nicer - although one ends up duplicating the flag that is added). But if abstracted into a macro/function that doesn't matter.

It's a shame that `cmake_push_check_state()` doesn't handle `CMAKE_TRY_COMPILE_TARGET_TYPE` though, because that one is scattered a bit more and would also benefit from a cleaner push/pop.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112126/new/

https://reviews.llvm.org/D112126



More information about the llvm-commits mailing list