[PATCH] D146399: [AIX][Clang][K] Create `-K` Option for AIX.
Michael Francis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 19 15:54:23 PDT 2023
francii created this revision.
Herald added a project: All.
francii requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.
`-K` is a linker option on AIX, that is used to align the header, text, data, and loader sections of the output file so
that each section begins on a page boundary.
This patch creates the `-K` option in clang.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D146399
Files:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6328,6 +6328,10 @@
}
}
+ if (Arg *A = Args.getLastArgNoClaim(options::OPT_K); A && !TC.getTriple().isOSAIX())
+ D.Diag(diag::err_drv_unsupported_opt_for_target)
+ << A->getAsString(Args) << TripleStr;
+
if (Args.getLastArg(options::OPT_fapple_kext) ||
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
CmdArgs.push_back("-fapple-kext");
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -3405,6 +3405,7 @@
HelpText<"Overlay the virtual filesystem described by file over the real file system. "
"Additionally, pass this overlay file to the linker if it supports it">;
def imultilib : Separate<["-"], "imultilib">, Group<gfortran_Group>;
+def K : Flag<["-"], "K">, Flags<[LinkerInput,NoArgumentUnused]>;
def keep__private__externs : Flag<["-"], "keep_private_externs">;
def l : JoinedOrSeparate<["-"], "l">, Flags<[LinkerInput, RenderJoined]>,
Group<Link_Group>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146399.506444.patch
Type: text/x-patch
Size: 1287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230319/064cd18f/attachment-0001.bin>
More information about the cfe-commits
mailing list