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

Andrzej Warzynski via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jun 3 08:42:54 PDT 2022


awarzynski added a comment.

In D126291#3555966 <https://reviews.llvm.org/D126291#3555966>, @mmuetzel wrote:

> In case you don't receive notifications on edits. (Please forgive the noise if you do.)

That's not a problem at all!

> After applying this additional patch (not the one in the previous comment):

Ah, so we were looking in the wrong toolchain file to begin with - good catch!

> The Hello World program compiled and linked successfully

🎉

> with an additional `-lc++` switch

What error do you get if you skip `-lc++`? We need to make sure that Flang does no depend on the C++ runtime (it's one of the design requirements). I suspect that there's other C library that's required and that's pulled together with libc++.

Again - many thanks for checking all this!



================
Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:140
+    // defined in flang's runtime libraries.
+    if (TC.getTriple().isKnownWindowsMSVCEnvironment())
+      CmdArgs.push_back("/subsystem:console");
----------------
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 ;-) 


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

https://reviews.llvm.org/D126291



More information about the flang-commits mailing list