[driver] return immediately in addArchSpecificRPath and getArchSpecificLibPaths on AIX (#134520)

`addArchSpecificRPath` should immediately return for AIX as AIX doesn't
support `rpath` option.
`getArchSpecificLibPaths` should return as well as we don't want
`-L/ArchSepcificLibPaths` sent to the linker on AIX.
This commit is contained in:
Daniel Chen 2025-04-29 10:39:52 -04:00 committed by GitHub
parent 67783eb166
commit 3f8035961f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,8 @@ public:
return llvm::DebuggerKind::DBX;
}
path_list getArchSpecificLibPaths() const override { return path_list(); };
protected:
Tool *buildAssembler() const override;
Tool *buildLinker() const override;

View File

@ -1252,6 +1252,9 @@ void tools::addArchSpecificRPath(const ToolChain &TC, const ArgList &Args,
options::OPT_fno_rtlib_add_rpath, false))
return;
if (TC.getTriple().isOSAIX()) // TODO: AIX doesn't support -rpath option.
return;
SmallVector<std::string> CandidateRPaths(TC.getArchSpecificLibPaths());
if (const auto CandidateRPath = TC.getStdlibPath())
CandidateRPaths.emplace_back(*CandidateRPath);

View File

@ -23,6 +23,7 @@
! AIX64-LD-PER-TARGET-DEFAULT-SAME: "[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}powerpc64-ibm-aix{{/|\\\\}}libflang_rt.runtime.a"
! AIX64-LD-PER-TARGET-DEFAULT-SAME: "-lm"
! AIX64-LD-PER-TARGET-DEFAULT-SAME: "-lpthread"
! AIX64-LD-PER-TARGET-DEFAULT-NOT: "-L/[[RESOURCE_DIR]]{{/|\\\\}}lib{{/|\\\\}}powerpc64-ibm-aix"
! Check powerpc64-ibm-aix 64-bit linking to static flang-rt by option