[PATCH] D145899: [AIX][Clang] Respect -r when invoking the linker
Michael Francis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 12 23:59:39 PDT 2023
francii updated this revision to Diff 504516.
francii added a comment.
Move comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145899/new/
https://reviews.llvm.org/D145899
Files:
clang/lib/Driver/ToolChains/AIX.cpp
clang/lib/Driver/ToolChains/CommonArgs.cpp
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1692,6 +1692,8 @@
break;
}
case ToolChain::UNW_CompilerRT:
+ if (Args.hasArg(options::OPT_r))
+ break;
if (TC.getTriple().isOSAIX()) {
// AIX only has libunwind as a shared library. So do not pass
// anything in if -static is specified.
Index: clang/lib/Driver/ToolChains/AIX.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AIX.cpp
+++ clang/lib/Driver/ToolChains/AIX.cpp
@@ -175,7 +175,7 @@
};
if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles,
- options::OPT_shared)) {
+ options::OPT_shared, options::OPT_r)) {
CmdArgs.push_back(
Args.MakeArgString(ToolChain.GetFilePath(getCrt0Basename())));
@@ -232,6 +232,13 @@
CmdArgs.push_back(Args.MakeArgString(llvm::Twine("-bE:") + ExportList));
}
+ if (Args.hasArg(options::OPT_r)) {
+ const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
+ C.addCommand(std::make_unique<Command>(
+ JA, *this, ResponseFileSupport::None(), Exec, CmdArgs, Inputs, Output));
+ return;
+ }
+
// Add directory to library search path.
Args.AddAllArgs(CmdArgs, options::OPT_L);
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145899.504516.patch
Type: text/x-patch
Size: 1481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230313/c394e816/attachment-0001.bin>
More information about the cfe-commits
mailing list