-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[driver] return immediately in addArchSpecificRPath and getArchSpecificLibPaths on AIX
#134520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[driver] return immediately in addArchSpecificRPath and getArchSpecificLibPaths on AIX
#134520
Conversation
|
@llvm/pr-subscribers-flang-driver @llvm/pr-subscribers-clang Author: Daniel Chen (DanielCChen) Changes
Full diff: https://github.com/llvm/llvm-project/pull/134520.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index 36d0ae34dec86..dd3cc33b5a233 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -999,7 +999,12 @@ ToolChain::path_list ToolChain::getArchSpecificLibPaths() const {
Paths.push_back(std::string(Path));
};
- AddPath({getTriple().str()});
+ // For AIX, get the triple without the OS version.
+ if (Triple.isOSAIX()) {
+ const llvm::Triple &TripleWithoutVersion = getTripleWithoutOSVersion();
+ AddPath({TripleWithoutVersion.str()});
+ } else
+ AddPath({getTriple().str()});
AddPath({getOSLibName(), llvm::Triple::getArchTypeName(getArch())});
return Paths;
}
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index ddeadff8f6dfb..e5d221cbf8b51 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -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()) // AIX doesn't support -rpath option.
+ return;
+
SmallVector<std::string> CandidateRPaths(TC.getArchSpecificLibPaths());
if (const auto CandidateRPath = TC.getStdlibPath())
CandidateRPaths.emplace_back(*CandidateRPath);
|
addArchSpecificRPath for AIX and also get the triple without the OS on AIX.addArchSpecificRPath for AIX and also get the triple without the OS on AIX in getArchSpecificLibPaths.
a3583c5 to
1f6eecb
Compare
addArchSpecificRPath for AIX and also get the triple without the OS on AIX in getArchSpecificLibPaths.addArchSpecificRPath and getArchSpecificLibPaths on AIX
daltenty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM, but this really ought to have a test (or affect some existing test somehow)
Agreed. Will add a test. |
f1c7f40 to
64e5b60
Compare
…cificLibPaths` on AIX (llvm#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.
…cificLibPaths` on AIX (llvm#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.
addArchSpecificRPathshould immediately return for AIX as AIX doesn't supportrpathoption.getArchSpecificLibPathsshould return as well as we don't want-L/ArchSepcificLibPathssent to the linker on AIX.