[PATCH] D33388: [libcxx] fixup bootstrapping for mingw-w64

Eric Fiselier via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 15:26:32 PDT 2017


EricWF added a comment.

@martell How close are we to getting the library linking on MinGW? Even with https://reviews.llvm.org/D33082 I can't get the libraries linking.



================
Comment at: libcxx/trunk/cmake/config-ix.cmake:45
+    if (LIBCXX_USE_COMPILER_RT)
+      set(MINGW_RUNTIME ${LIBCXXABI_BUILTINS_LIBRARY})
+    else ()
----------------
`LIBCXXABI_BUILTINS_LIBRARY` isn't defined by libc++ and we can't count on it being available here. I think you need to duplicate the logic from libc++abi into libc++.


================
Comment at: libcxx/trunk/cmake/config-ix.cmake:53
+    list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0600")
   endif()
----------------
martell wrote:
> EricWF wrote:
> > martell wrote:
> > > EricWF wrote:
> > > > chapuni wrote:
> > > > > EricWF wrote:
> > > > > > `-D_WIN32_WINNT=0x0600`. What? Why?
> > > > > > 
> > > > > > First isn't `0x0600` Windows Vista? Why are we asking to support such an old operating system?
> > > > > > Why are we defining this at all?
> > > > > > 
> > > > > I think it'd be good thing to require minimum version as the bottom line.
> > > > Perhaps, but at minimum this is not the patch to do it in unless it's a required change to make MinGW work, otherwise it should be done as a separate commit because a wider range of Win32 interfaces are used when targeting non-MinGW Windows.
> > > Yes this patch is required to make mingw work for the win32 c++ threading api in libcxx.
> > > `0x0600` is the min version to access the fibersapi.
> > > See here https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/fibersapi.h#L17
> > > 
> > > The default value for mingw-w64 currently is `0x502` See here https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/crt/_mingw.h.in#L225
> > > 
> > > When building for the pthread api `0x0502` is fine, we just need a bump for fibersapi.
> > > 
> > > From my description in the other patch Revision.
> > > `When bootstrapping with _LIBCPP_HAS_THREAD_API_WIN32 we need to set windows version to atleast 0x0600 for the fibersapi`
> > > 
> > @martell Could you please submit this change as a separate review? Doing so will allow this patch to land immediately. 
> I'll just commit this now without that line and I will create another diff for that.
SGTM. Thanks for working on this.




Repository:
  rL LLVM

https://reviews.llvm.org/D33388





More information about the llvm-commits mailing list