This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Update WinMsvc.cmake's fms-compatability to match llvm's prereqs
ClosedPublic

Authored by lanza on Dec 4 2020, 3:54 PM.

Details

Summary

llvm's minimum fms-compatability-version was just bumped to 19.14 and
thus the WinMsvc.cmake file needs to be adjusted accordingly.

Diff Detail

Event Timeline

lanza created this revision.Dec 4 2020, 3:54 PM
lanza requested review of this revision.Dec 4 2020, 3:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 3:54 PM
smeenai accepted this revision.Dec 4 2020, 3:55 PM

LGTM

I'm not sure why we even have the explicit compatibility version setting ... can we just get rid of it now and rely on the default? That's fine as a follow-up change though.

This revision is now accepted and ready to land.Dec 4 2020, 3:55 PM
rnk accepted this revision.Dec 7 2020, 12:10 PM

We should raise the default _MSC_VER, but IMO that's separable, and I wouldn't rely on it. For cross-compilation, I would recommend setting an explicit version. Otherwise, the very host-specific auto-detection logic could run, and it might produce strange results on a Linux system.

aganea added a comment.Dec 7 2020, 3:28 PM
In D92705#2437806, @rnk wrote:

We should raise the default _MSC_VER, but IMO that's separable, and I wouldn't rely on it. For cross-compilation, I would recommend setting an explicit version. Otherwise, the very host-specific auto-detection logic could run, and it might produce strange results on a Linux system.

Shouldn't we bypass the MSVC toolchain auto-detection on Linux? What is the recommended way to cross-compile Windows binaries on Linux? We would still need a copy of the VC build tools & Win SDK to build, right? (at least for the includes and the libs)
From Windows, I've tried:

> pscp -r "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333" aganea@LINUX-BOX:/mnt/vs2019/
> ssh LINUX-BOX
...
$ clang-cl /c a.cpp /vctoolsdir"/mnt/vs2019/"

But that still reports -fms-compatibility-version=19.11 because the auto-detection code is skipped on non-Windows: https://github.com/llvm/llvm-project/blob/93671fffb5ef37060da54199cb9e009188f63a0e/clang/lib/Driver/ToolChains/MSVC.cpp#L1222
I suppose on Linux we could manually extract the VS_VERSION_INFO from the EXE.

rnk added a comment.Dec 7 2020, 3:37 PM

You cheated, you actually looked at the code instead of speculating wildly about what might happen. :)

Given that the autodetection isn't a concern, I guess it's reasonable to raise the default _MSC_VER in clang instead, since 19.11 is obviously too old: we implement ABI features added in 19.14.

Anyway, it's all the same to me.

lanza closed this revision.Dec 9 2020, 1:13 PM

Sorry, this was landed already but I forgot to put the Differential Revision: in! Closing it now. As far as the Windows changes you guys are talking about I'll leave up to you -- I'm not a Windows dev and was just maintaining a windows CI oncall last week.