[cfe-dev] [libc++] Compiling with MinGW-w64

Mateusz Mikuła via cfe-dev cfe-dev at lists.llvm.org
Fri Mar 31 15:11:37 PDT 2017


Fantastic but looks like those libs are not linked when using libc++
with Clang: https://reviews.llvm.org/P7980

Patches I applied to 4.0.0 release sources:

libc++: Reid's patch and this big, ugly and invasive patch [1]
<https://github.com/mati865/MINGW-packages/blob/clang/mingw-w64-clang/0401-mingw-w64-hack-and-slash-fixes-for-libc.patch>

libc++abi: [2]
<https://github.com/mati865/MINGW-packages/blob/clang/mingw-w64-clang/0701-fix-visibility-for-libc-abi-on-win32.patch>
which is most likely fixed by D26949 [3]
<https://github.com/llvm-mirror/libcxxabi/commit/54227aec1d6116c936afa576e2ea36ca3e94b29c>

libunwind: potentially dangerous [4]
<https://github.com/mati865/MINGW-packages/blob/clang/mingw-w64-clang/0601-libunwind-add-support-for-mingw-w64.patch>


[1]
https://github.com/mati865/MINGW-packages/blob/clang/mingw-w64-clang/0401-mingw-w64-hack-and-slash-fixes-for-libc.patch

[2]
https://github.com/mati865/MINGW-packages/blob/clang/mingw-w64-clang/0701-fix-visibility-for-libc-abi-on-win32.patch

[3]
https://github.com/llvm-mirror/libcxxabi/commit/54227aec1d6116c936afa576e2ea36ca3e94b29c

[4]
https://github.com/mati865/MINGW-packages/blob/clang/mingw-w64-clang/0601-libunwind-add-support-for-mingw-w64.patch


Regards,

Mateusz


------ Original Message ------
Subject: Re: [cfe-dev] [libc++] Compiling with MinGW-w64
Date: Thu, 30 Mar 2017 17:29:24 -0700
To: Mateusz Mikuła, Eric Fiselier, Cfe-dev
From: Reid Kleckner
> I ran into this today and took a stab at fixing it:
> https://reviews.llvm.org/D31518
>
> It's probably a terrible fix, but I needed most of those mingw
> libraries to get basic programs linking. I could rewrite the patch
> using more auto-conf-y style tests, but they are slow and unreliable.
>
> On Fri, Mar 17, 2017 at 3:34 PM, Mateusz Mikuła via cfe-dev
> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>
>     Hello,
>
>     I'm planing to get libc++ compiling with MinGW-w64, right now
>     without patches it fails with:
>
>         CMake Error at projects/libcxx/CMakeLists.txt:396 (message):
>           C++11 or greater is required but the compiler does not
>         support c++11
>
>     It is caused by adding `-nodefaultlibs` flag (it passes it's own
>     check [1]
>     <https://github.com/llvm-mirror/libcxx/blob/master/cmake/config-ix.cmake#L27>).
>     However many following checks fail due to undefined references,
>     results with gcc [2] <https://reviews.llvm.org/P7975> and clang
>     [3] <https://reviews.llvm.org/P7976>.
>
>     Hard-coding 0 for LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG allows it go
>     finish configuration and fail during build (that's another story).
>
>     `-nodefaultlibs` appears several times in libc++ and libc++abi
>     code and I'm not sure about cleanest way to fix/workaround it.
>
>     Any suggestions?
>
>
>     [1]
>     https://github.com/llvm-mirror/libcxx/blob/master/cmake/config-ix.cmake#L27
>     <https://github.com/llvm-mirror/libcxx/blob/master/cmake/config-ix.cmake#L27>
>
>     [2] https://reviews.llvm.org/P7975
>
>     [3] https://reviews.llvm.org/P7976
>
>
>     Thanks,
>
>     Mateusz
>
>
>     _______________________________________________
>     cfe-dev mailing list
>     cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>     <http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170401/1f3e4827/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170401/1f3e4827/attachment.sig>


More information about the cfe-dev mailing list