diff options
Diffstat (limited to 'cmake/config-ix.cmake')
-rw-r--r-- | cmake/config-ix.cmake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 2d4da64..670c31f 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -7,6 +7,7 @@ check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB) if (NOT LIBUNWIND_USE_COMPILER_RT) check_library_exists(gcc_s __gcc_personality_v0 "" LIBUNWIND_HAS_GCC_S_LIB) + check_library_exists(gcc __absvdi2 "" LIBUNWIND_HAS_GCC_LIB) endif() # libunwind is built with -nodefaultlibs, so we want all our checks to also @@ -23,11 +24,15 @@ if (LIBUNWIND_HAS_NODEFAULTLIBS_FLAG) list(APPEND CMAKE_REQUIRED_LIBRARIES c) endif () if (LIBUNWIND_USE_COMPILER_RT) - list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt) find_compiler_rt_library(builtins LIBUNWIND_BUILTINS_LIBRARY) list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBUNWIND_BUILTINS_LIBRARY}") - elseif (LIBUNWIND_HAS_GCC_S_LIB) - list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s) + else () + if (LIBUNWIND_HAS_GCC_S_LIB) + list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s) + endif () + if (LIBUNWIND_HAS_GCC_LIB) + list(APPEND CMAKE_REQUIRED_LIBRARIES gcc) + endif () endif () if (MINGW) # Mingw64 requires quite a few "C" runtime libraries in order for basic |