[PATCH] D37530: [MinGW] Don't link -lmsvcrt if a different msvcrt version is to be linked

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 11 12:31:08 PDT 2017


rnk added a comment.

In https://reviews.llvm.org/D37530#865333, @mstorsjo wrote:

> Attempted implementing Reid's suggestion.
>
> On the mingw-w64 mailing list (https://sourceforge.net/p/mingw-w64/mailman/message/36030072/), there were points made that it would be better with some mechanism that controls both linking the right msvcrt version and setting `__MSVCRT_VERSION__` in sync.
>
> And someone pointed out some widely used (but not upstreamed) patches for GCC that adds an option `-mcrtdll` which does pretty much exactly what my `-mmsvcrt` option did in the previous iteration (https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-gcc-git/0006-gcc-7-branch-Windows-New-feature-to-allow-overriding.patch), which in another non-upstreamed patch also is used to set `__MSVCRT_VERSION__` (https://raw.githubusercontent.com/nak5124/build_env/master/gcc_build/patches/gcc/0020-MinGW-w64-Define-__MSVCRT_VERSION__.patch).


Hm, these are interesting. Getting a separate concept of CRT version would be nice. We've talked about getting something like that for glibc as well, since there were some new math builtins we'd like to use there.


https://reviews.llvm.org/D37530





More information about the cfe-commits mailing list