Skip to content

Commit ee80615

Browse files
committed
[clang][driver][AIX] Set compiler-rt as default rtlib
Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D88182
1 parent 665dc40 commit ee80615

File tree

5 files changed

+89
-1
lines changed

5 files changed

+89
-1
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ StringRef ToolChain::getOSLibName() const {
391391
return "openbsd";
392392
case llvm::Triple::Solaris:
393393
return "sunos";
394+
case llvm::Triple::AIX:
395+
return "aix";
394396
default:
395397
return getOS();
396398
}

clang/lib/Driver/ToolChains/AIX.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
156156
getToolChain().AddCXXStdlibLibArgs(Args, CmdArgs);
157157

158158
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
159+
AddRunTimeLibs(ToolChain, D, CmdArgs, Args);
160+
159161
// Support POSIX threads if "-pthreads" or "-pthread" is present.
160162
if (Args.hasArg(options::OPT_pthreads, options::OPT_pthread))
161163
CmdArgs.push_back("-lpthreads");
@@ -228,6 +230,10 @@ ToolChain::CXXStdlibType AIX::GetDefaultCXXStdlibType() const {
228230
return ToolChain::CST_Libcxx;
229231
}
230232

233+
ToolChain::RuntimeLibType AIX::GetDefaultRuntimeLibType() const {
234+
return ToolChain::RLT_CompilerRT;
235+
}
236+
231237
auto AIX::buildAssembler() const -> Tool * { return new aix::Assembler(*this); }
232238

233239
auto AIX::buildLinker() const -> Tool * { return new aix::Linker(*this); }

clang/lib/Driver/ToolChains/AIX.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class LLVM_LIBRARY_VISIBILITY AIX : public ToolChain {
7272

7373
CXXStdlibType GetDefaultCXXStdlibType() const override;
7474

75+
RuntimeLibType GetDefaultRuntimeLibType() const override;
76+
7577
protected:
7678
Tool *buildAssembler() const override;
7779
Tool *buildLinker() const override;

0 commit comments

Comments
 (0)