Skip to content

Commit a3583c5

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

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
@@ -999,7 +999,12 @@ ToolChain::path_list ToolChain::getArchSpecificLibPaths() const {
999999
Paths.push_back(std::string(Path));
10001000
};
10011001

1002-
AddPath({getTriple().str()});
1002+
// For AIX, get the triple without the OS version.
1003+
if (Triple.isOSAIX()) {
1004+
const llvm::Triple &TripleWithoutVersion = getTripleWithoutOSVersion();
1005+
AddPath({TripleWithoutVersion.str()});
1006+
} else
1007+
AddPath({getTriple().str()});
10031008
AddPath({getOSLibName(), llvm::Triple::getArchTypeName(getArch())});
10041009
return Paths;
10051010
}

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)