[compiler-rt] Reapply [compiler-rt] Check for and use -lunwind when linking with -nodefaultlibs (PR #66584)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 21 01:37:40 PDT 2023


================
@@ -63,6 +63,16 @@ if (C_SUPPORTS_NODEFAULTLIBS_FLAG)
                         moldname mingwex msvcrt)
     list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
   endif()
+  if (NOT TARGET unwind)
+    # Don't check for a library named unwind, if there's a target with that name within
+    # the same build.
+    check_library_exists(unwind _Unwind_RaiseException "" COMPILER_RT_HAS_LIBUNWIND)
----------------
mstorsjo wrote:

Oh - good point. I guess we could check for `_Unwind_GetRegionStart` or `_Unwind_GetLanguageSpecificData` - both of those exist without any extra name mangling for both ehabi, sjlj, seh and regular dwarf.

https://github.com/llvm/llvm-project/pull/66584


More information about the llvm-commits mailing list