Skip to content

Commit 1f6eecb

Browse files
committed
[driver] return in addArchSpecificRPath for AIX and also get the triple without the OS on AIX.
1 parent efe9cb0 commit 1f6eecb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,12 @@ ToolChain::path_list ToolChain::getArchSpecificLibPaths() const {
10151015
Paths.push_back(std::string(Path));
10161016
};
10171017

1018-
AddPath({getTriple().str()});
1018+
// For AIX, get the triple without the OS version.
1019+
if (Triple.isOSAIX()) {
1020+
const llvm::Triple &TripleWithoutVersion = getTripleWithoutOSVersion();
1021+
AddPath({TripleWithoutVersion.str()});
1022+
} else
1023+
AddPath({getTriple().str()});
10191024
AddPath({getOSLibName(), llvm::Triple::getArchTypeName(getArch())});
10201025
return Paths;
10211026
}

clang/lib/Driver/ToolChains/CommonArgs.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,9 @@ void tools::addArchSpecificRPath(const ToolChain &TC, const ArgList &Args,
12521252
options::OPT_fno_rtlib_add_rpath, false))
12531253
return;
12541254

1255+
if (TC.getTriple().isOSAIX()) // AIX doesn't support -rpath option.
1256+
return;
1257+
12551258
SmallVector<std::string> CandidateRPaths(TC.getArchSpecificLibPaths());
12561259
if (const auto CandidateRPath = TC.getStdlibPath())
12571260
CandidateRPaths.emplace_back(*CandidateRPath);

0 commit comments

Comments
 (0)