Skip to content

Commit 52e86dd

Browse files
estewart08ronlieb
authored andcommitted
[clang][openmp] - Ensure default lib path appended to RPATH
When using -fopenmp-runtimelib=lib-debug/lib-perf, libLLVM.so is failing to be found. We do not have this library in a lib-debug directory and therefore need to grab it from lib/llvm/lib. Change-Id: I48a0885b563e332b3537ec8784d2365f54c9c2ef
1 parent 0f52eed commit 52e86dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,15 @@ void tools::addOpenMPRuntimeSpecificRPath(const ToolChain &TC,
12501250
CmdArgs.push_back(Args.MakeArgString(rocmPath_lib.c_str()));
12511251
}
12521252
}
1253-
if (llvm::find_if(CmdArgs, [](StringRef str) {
1253+
1254+
// Add Default lib path to ensure llvm dynamic library is picked up for
1255+
// lib-debug/lib-perf
1256+
if (LibSuffix != "lib" && llvm::sys::fs::exists(DefaultLibPath)){
1257+
CmdArgs.push_back("-rpath");
1258+
CmdArgs.push_back(Args.MakeArgString(DefaultLibPath.c_str()));
1259+
}
1260+
1261+
if (llvm::find_if(CmdArgs, [](StringRef str) {
12541262
return !str.compare("--enable-new-dtags");
12551263
}) == CmdArgs.end())
12561264
CmdArgs.push_back("--disable-new-dtags");

0 commit comments

Comments
 (0)