[PATCH] D33098: Fix Libc++abi linking using compiler-rt under MinGW64

Martell Malone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 05:41:33 PDT 2017


martell created this revision.
Herald added subscribers: mgorny, dberris.

@EricWF you beat me to the punch with https://reviews.llvm.org/rL302760.
Here is a small update to support compiler-rt.


Repository:
  rL LLVM

https://reviews.llvm.org/D33098

Files:
  trunk/libcxxabi/cmake/config-ix.cmake


Index: trunk/libcxxabi/cmake/config-ix.cmake
===================================================================
--- trunk/libcxxabi/cmake/config-ix.cmake
+++ trunk/libcxxabi/cmake/config-ix.cmake
@@ -30,9 +30,14 @@
   if (MINGW)
     # Mingw64 requires quite a few "C" runtime libraries in order for basic
     # programs to link successfully with -nodefaultlibs.
-    set(MINGW_LIBRARIES mingw32 gcc_s gcc moldname mingwex msvcrt advapi32
-                        shell32 user32 kernel32 iconv mingw32 gcc_s gcc moldname
-                        mingwex msvcrt)
+    if (LIBCXXABI_USE_COMPILER_RT)
+      set(MINGW_RUNTIME ${LIBCXXABI_BUILTINS_LIBRARY})
+    else ()
+      set(MINGW_RUNTIME gcc_s gcc)
+    endif()
+    set(MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32
+                        shell32 user32 kernel32 iconv mingw32 ${MINGW_RUNTIME}
+                        moldname mingwex msvcrt)
     list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
   endif()
   if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33098.98621.patch
Type: text/x-patch
Size: 1083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170511/ab7879ea/attachment.bin>


More information about the llvm-commits mailing list