[PATCH] Use a sufficiently current MSVCRT when using MinGW

Mueller-Roemer, Johannes Sebastian Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de
Fri Jan 30 14:32:15 PST 2015


Then we could go for the version with the __MCVRT_VERSION__ (which is only defined on MinGW btw.) check for now.

The extra build system complexity (which would reduce build setup complexity) could be factored out into a FindMSVCRT.cmake or something similar. Maybe some other MinGW users could chime in? Also, is cross-compiling from Linux to Windows with a Linux-based MinGW required? This might complicate the CMake solution further.

________________________________
From: Reid Kleckner [rnk at google.com]
Sent: Friday, January 30, 2015 11:22 PM
To: Mueller-Roemer, Johannes Sebastian
Cc: reviews+D7224+public+9c618652813cb116 at reviews.llvm.org; bigcheesegs at gmail.com; llvm-commits at cs.uiuc.edu
Subject: Re: [PATCH] Use a sufficiently current MSVCRT when using MinGW

The  __MSVCRT_VERSION__ check seems like a nice improvement.

If users are compiling binaries with MSVC, they generally know they have to either link the CRT statically or redistribute the appropriate CRT DLL. If I were a mingw64 user, I would not expect that binaries I build will have dependencies on things other than mingw64 itself and Windows unless I asked otherwise.

However, maybe it's more important for this to just work out of the box for developers than it is to worry about people building redistributed binaries. I just don't like the added build system complexity. =/

On Fri, Jan 30, 2015 at 2:13 PM, Mueller-Roemer, Johannes Sebastian <Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de<mailto:Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de>> wrote:
But the problem with the dialog box etc. is the same on MinGW as on MSVC. And the MSVC executables won't run either if the appropriate runtimes are not installed on a target machine.

Maybe as an compromise we could replace the "#ifdef _MSC_VER" now disabling it completely by an "#if defined(_MSC_VER) || __MSVCRT_VERSION__ >= 0x900". I could live with that. Although I'd still prefer a MinGW build to work automatically *and* have the no-message feature instead of silently disabling the feature.

________________________________
From: Reid Kleckner [rnk at google.com<mailto:rnk at google.com>]
Sent: Friday, January 30, 2015 10:30 PM
To: Mueller-Roemer, Johannes Sebastian
Cc: reviews+D7224+public+9c618652813cb116 at reviews.llvm.org<mailto:reviews%2BD7224%2Bpublic%2B9c618652813cb116 at reviews.llvm.org>; bigcheesegs at gmail.com<mailto:bigcheesegs at gmail.com>; llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
Subject: Re: [PATCH] Use a sufficiently current MSVCRT when using MinGW

On Fri, Jan 30, 2015 at 1:17 PM, Mueller-Roemer, Johannes Sebastian <Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de<mailto:Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de><mailto:Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de<mailto:Johannes.Sebastian.Mueller-Roemer at igd.fraunhofer.de>>> wrote:
I assume you are referring to http://reviews.llvm.org/D7230?

Is it really desirable to disable the functionality for MinGW? Any recent MinGW is perfectly capable of compiling it with the right flags. My issue was only that running the generated executables requires the corresponding runtimes to be installed (also true for MSVC, but if that is installed the runtime is automatically installed as well)

I don't like the idea of building mingw64 clang and LLVM executables that have surprising runtime dependencies on versions of the CRT that aren't shipped with either Windows or mingw64. It makes it very easy to build executables that won't run on other machines.





More information about the llvm-commits mailing list