[clang] [Flang] Link `-lflang_rt.runtime` if available on the device (PR #132737)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 07:18:43 PDT 2025


================
@@ -9337,6 +9337,11 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
         CmdArgs.push_back(
             Args.MakeArgString("--device-linker=" + TC.getTripleString() + "=" +
                                "-lclang_rt.builtins"));
+      bool HasFlangRT = HasCompilerRT && C.getDriver().IsFlangMode();
+      if (HasCompilerRT)
----------------
Meinersbur wrote:

Do you mean
```suggestion
      if (HasFlangRT)
```

https://github.com/llvm/llvm-project/pull/132737


More information about the cfe-commits mailing list