[PATCH] D126291: [flang][Driver] Update link job on windows

Markus Mützel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 6 23:08:06 PDT 2022


mmuetzel added a comment.

In D126291#3561854 <https://reviews.llvm.org/D126291#3561854>, @Meinersbur wrote:

> In D126291#3555639 <https://reviews.llvm.org/D126291#3555639>, @awarzynski wrote:
>
>> In D126291#3555591 <https://reviews.llvm.org/D126291#3555591>, @mmuetzel wrote:
>>
>>> ISTR, I somewhere read that Windows isn't a supported host currently. Is this no longer the case?)
>>
>> Windows is supported: https://lab.llvm.org/buildbot/#/builders/172 :)
>
> The bot just compiles flang and runs the unit-test, none of which actually try to compile, link & run a Fortan program. Until recently the flang driver would not compile itself, but delegate it to gfortran anyway.

Found why I thought building on Windows wasn't supported:
https://github.com/llvm/llvm-project/blob/main/flang/README.md?plain=1#L153

> The code does not compile with Windows and a compiler that does not have support for C++17.

But re-reading this again, I might have mis-read the "and" for an "or"...



================
Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:140
+    // defined in flang's runtime libraries.
+    if (TC.getTriple().isKnownWindowsMSVCEnvironment())
+      CmdArgs.push_back("/subsystem:console");
----------------
Meinersbur wrote:
> mmuetzel wrote:
> > awarzynski wrote:
> > > mmuetzel wrote:
> > > > Is the MSVC toolchain used anywhere else but on Windows?
> > > No: https://github.com/llvm/llvm-project/blob/5fee1799f4d8da59c251e2d04172fc2f387cbe54/llvm/include/llvm/ADT/Triple.h#L576-L578 ;-) 
> > In that case, this argument could probably be added unconditionally.
> How do you mean this? `/subsystem:console` is a `link.exe` flag, also supported by `lld-link.exe` sind it tries to be an msvc-compatible wrapper. It is not a valid flag for eg GNU ld even in msys.
Sorry my questions weren't very clear. What I meant to ask:
The name of this file is `ToolChains/MSVC.cpp`. I was wondering whether that means that these settings are only relevant when using a MSVC (compatible) toolchain. If that is the case, checking for `isKnownWindowsMSVCEnvironment()` here might be redundant. At least, I can't find that being checked anywhere else in this file.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126291/new/

https://reviews.llvm.org/D126291



More information about the cfe-commits mailing list