[PATCH] D50663: [libunwind] [cmake] Add MINGW_LIBRARIES to the linker flags
Martin Storsjö via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 13 13:46:27 PDT 2018
mstorsjo created this revision.
mstorsjo added reviewers: rnk, compnerd, phosek, smeenai.
Herald added subscribers: chrib, mgorny.
This is essential when building with -nodefaultlibs.
In some CMake versions (noticed in 3.5.1), the same libraries are picked up from CMAKE_REQUIRED_LIBRARIES in some exceptional situations (if CXX probing failed, due to libc++ not being built yet, the libraries from CMAKE_REQUIRED_LIBRARIES are used for linking the target library), but not at all in other newer CMake versions (3.10).
This is similar to what already is done in libcxxabi in SVN r302760 and libcxx in SVN r312498.
Repository:
rUNW libunwind
https://reviews.llvm.org/D50663
Files:
src/CMakeLists.txt
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -62,6 +62,9 @@
append_if(LIBUNWIND_LINK_FLAGS LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
+# MINGW_LIBRARIES is defined in config-ix.cmake
+append_if(libraries MINGW "${MINGW_LIBRARIES}")
+
if (LIBUNWIND_HAS_NO_EXCEPTIONS_FLAG AND LIBUNWIND_HAS_FUNWIND_TABLES)
list(APPEND LIBUNWIND_COMPILE_FLAGS -fno-exceptions)
list(APPEND LIBUNWIND_COMPILE_FLAGS -funwind-tables)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50663.160442.patch
Type: text/x-patch
Size: 527 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180813/ba6fddbd/attachment.bin>
More information about the cfe-commits
mailing list