Skip to content

Commit

Permalink
[ve][clang] Always provide libc++ path
Browse files Browse the repository at this point in the history
  • Loading branch information
simoll committed Dec 15, 2020
1 parent f7d2e95 commit 1791ace
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions clang/lib/Driver/ToolChains/VEToolchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ VEToolChain::VEToolChain(const Driver &D, const llvm::Triple &Triple,
getFilePaths().clear();

// Re-add C++ library dir.
if (D.CCCIsCXX()) {
if (auto CXXStdlibPath = getCXXStdlibPath())
getFilePaths().push_back(*CXXStdlibPath);
}
if (auto CXXStdlibPath = getCXXStdlibPath())
getFilePaths().push_back(*CXXStdlibPath);

getFilePaths().push_back(getArchSpecificLibPath());
if (getTriple().isMusl())
Expand Down Expand Up @@ -140,8 +138,20 @@ void VEToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
assert((GetCXXStdlibType(Args) == ToolChain::CST_Libcxx) &&
"Only -lc++ (aka libxx) is supported in this toolchain.");

// Add compiler-rt rpath.
tools::addArchSpecificRPath(*this, Args, CmdArgs);

// Wirte up the standard environment path.
CmdArgs.push_back("-rpath");
CmdArgs.push_back(Args.MakeArgString(getDriver().SysRoot + "/opt/nec/ve/lib"));

// Add libc++.so rpath.
auto CXXStdlibPath = getCXXStdlibPath();
if (CXXStdlibPath) {
CmdArgs.push_back("-rpath");
CmdArgs.push_back(Args.MakeArgString(CXXStdlibPath.getValue()));
}

CmdArgs.push_back("-lc++");
CmdArgs.push_back("-lc++abi");
CmdArgs.push_back("-lunwind");
Expand Down

0 comments on commit 1791ace

Please sign in to comment.