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

Markus Mützel via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jun 3 07:47:57 PDT 2022


mmuetzel added a comment.

In case you don't receive notifications on edits. (Please forgive the noise if you do.)
After applying this additional patch:

  From d74a276679778b943b1e2e50f5dd45f65c530252 Mon Sep 17 00:00:00 2001
  From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <markus.muetzel at gmx.de>
  Date: Fri, 3 Jun 2022 16:36:19 +0200
  Subject: [PATCH] MinGW
  
  ---
   clang/lib/Driver/ToolChains/MinGW.cpp | 5 +++++
   1 file changed, 5 insertions(+)
  
  diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp b/clang/lib/Driver/ToolChains/MinGW.cpp
  index ceeaa79bc202..9e2200467548 100644
  --- a/clang/lib/Driver/ToolChains/MinGW.cpp
  +++ b/clang/lib/Driver/ToolChains/MinGW.cpp
  @@ -218,6 +218,11 @@ void tools::MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   
     AddLinkerInputs(TC, Inputs, Args, CmdArgs, JA);
   
  +  if (C.getDriver().IsFlangMode()) {
  +    tools::addFortranRuntimeLibraryPath(TC, Args, CmdArgs);
  +    tools::addFortranRuntimeLibs(TC, CmdArgs);
  +  }
  +
     // TODO: Add profile stuff here
   
     if (TC.ShouldLinkCXXStdlib(Args)) {
  -- 
  2.35.3.windows.1

The Hello World program compiled and linked successfully with an additional `-lc++` switch:

  $ PATH=./pkg/bin:$PATH flang-new hello.f90 -L/clang64/lib -lc++
  $ ./a.exe
   Hello, World!


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

https://reviews.llvm.org/D126291



More information about the flang-commits mailing list