Skip to content

Commit 880b184

Browse files
committed
Need to pass rpath when linking shared flang-rt.
1 parent 7db1cca commit 880b184

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -856,12 +856,13 @@ void ToolChain::addFlangRTLibPath(const ArgList &Args,
856856
if (getVFS().exists(Twine(Path = getCompilerRTArgString(
857857
Args, "runtime", ToolChain::FT_Static, true))))
858858
CmdArgs.push_back(Path);
859-
else if (getVFS().exists(
860-
Twine(Path = getCompilerRTArgString(
861-
Args, "runtime", ToolChain::FT_Shared, true))))
862-
CmdArgs.push_back(Path);
863859
else {
864-
CmdArgs.push_back("-lflang_rt.runtime");
860+
if (getVFS().exists(
861+
Twine(Path = getCompilerRTArgString(Args, "runtime",
862+
ToolChain::FT_Shared, true))))
863+
CmdArgs.push_back(Path);
864+
else
865+
CmdArgs.push_back("-lflang_rt.runtime");
865866
addArchSpecificRPath(*this, Args, CmdArgs);
866867
}
867868
}

0 commit comments

Comments
 (0)