[libcxxabi] r302760 - Fix Libc++abi linking under MinGW64

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 20:29:59 PDT 2017


Author: ericwf
Date: Wed May 10 22:29:59 2017
New Revision: 302760

URL: http://llvm.org/viewvc/llvm-project?rev=302760&view=rev
Log:
Fix Libc++abi linking under MinGW64

Modified:
    libcxxabi/trunk/cmake/config-ix.cmake
    libcxxabi/trunk/src/CMakeLists.txt

Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=302760&r1=302759&r2=302760&view=diff
==============================================================================
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Wed May 10 22:29:59 2017
@@ -30,7 +30,10 @@ if (LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
   if (MINGW)
     # Mingw64 requires quite a few "C" runtime libraries in order for basic
     # programs to link successfully with -nodefaultlibs.
-    list(APPEND CMAKE_REQUIRED_LIBRARIES mingw32 gcc gcc_eh mingwex msvcrt gcc)
+    set(MINGW_LIBRARIES mingw32 gcc_s gcc moldname mingwex msvcrt advapi32
+                        shell32 user32 kernel32 iconv mingw32 gcc_s gcc moldname
+                        mingwex msvcrt)
+    list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
   endif()
   if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")

Modified: libcxxabi/trunk/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/CMakeLists.txt?rev=302760&r1=302759&r2=302760&view=diff
==============================================================================
--- libcxxabi/trunk/src/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/CMakeLists.txt Wed May 10 22:29:59 2017
@@ -74,6 +74,10 @@ if (LIBCXXABI_USE_LLVM_UNWINDER)
 else()
   append_if(libraries LIBCXXABI_HAS_GCC_S_LIB gcc_s)
 endif()
+if (MINGW)
+  # MINGW_LIBRARIES is defined in config-ix.cmake
+  list(APPEND libraries ${MINGW_LIBRARIES})
+endif()
 
 # Setup flags.
 append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_FPIC_FLAG -fPIC)




More information about the cfe-commits mailing list