Skip to content

Commit b9e22cc

Browse files
authored
[Flang][driver] Do not emit -latomic on link line on Windows (llvm#164648)
Flang on Windows added `-latomic` to the link line. This library does not exist on Windows and the linker gives a warning.
1 parent 54053cf commit b9e22cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,11 @@ void ToolChain::addFortranRuntimeLibs(const ArgList &Args,
851851
options::OPT_fno_openmp, false)) {
852852
Driver::OpenMPRuntimeKind OMPRuntime = getDriver().getOpenMPRuntime(Args);
853853
ToolChain::RuntimeLibType RuntimeLib = GetRuntimeLibType(Args);
854-
if (OMPRuntime == Driver::OMPRT_OMP && RuntimeLib == ToolChain::RLT_Libgcc)
854+
if ((OMPRuntime == Driver::OMPRT_OMP &&
855+
RuntimeLib == ToolChain::RLT_Libgcc) &&
856+
!getTriple().isKnownWindowsMSVCEnvironment()) {
855857
CmdArgs.push_back("-latomic");
858+
}
856859
}
857860
}
858861

0 commit comments

Comments
 (0)