Skip to content

Commit b1a8e6e

Browse files
jhuber6Meinersbur
andauthored
[Flang] Link -lflang_rt.runtime if available on the device (#132737)
Summary: Now that we can build the Fortran runtime on the GPU (mostly) we should be able to implicitly link it if it exists. This matches the normal behavior where it is included implicity. No tests because it would require a full VFS and is fairly trivial. --------- Co-authored-by: Michael Kruse <[email protected]>
1 parent 5634e7e commit b1a8e6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9337,6 +9337,11 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
93379337
CmdArgs.push_back(
93389338
Args.MakeArgString("--device-linker=" + TC.getTripleString() + "=" +
93399339
"-lclang_rt.builtins"));
9340+
bool HasFlangRT = HasCompilerRT && C.getDriver().IsFlangMode();
9341+
if (HasFlangRT)
9342+
CmdArgs.push_back(
9343+
Args.MakeArgString("--device-linker=" + TC.getTripleString() + "=" +
9344+
"-lflang_rt.runtime"));
93409345
});
93419346
}
93429347

0 commit comments

Comments
 (0)