[PATCH] D128238: [LLD][COFF] Support /kernel flag
Pengxuan Zheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 20 18:52:07 PDT 2022
pzheng created this revision.
pzheng added reviewers: ruiu, rnk, thieta, thakis, hans, mstorsjo.
Herald added a project: All.
pzheng requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Baed on the description from Microsoft, the flag disables incremental linking.
https://docs.microsoft.com/en-us/cpp/build/reference/kernel-create-kernel-mode-binary?view=msvc-170
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D128238
Files:
lld/COFF/Driver.cpp
lld/COFF/Options.td
Index: lld/COFF/Options.td
===================================================================
--- lld/COFF/Options.td
+++ lld/COFF/Options.td
@@ -140,6 +140,7 @@
HelpText<"Set IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER bit in PE header">;
def driver_wdm_uponly : F<"driver:wdm,uponly">;
def driver_uponly_wdm : F<"driver:uponly,wdm">;
+def kernel :F<"kernel">;
def nodefaultlib_all : F<"nodefaultlib">,
HelpText<"Remove all default libraries">;
def noentry : F<"noentry">,
Index: lld/COFF/Driver.cpp
===================================================================
--- lld/COFF/Driver.cpp
+++ lld/COFF/Driver.cpp
@@ -1841,7 +1841,8 @@
config->incremental =
args.hasFlag(OPT_incremental, OPT_incremental_no,
!config->doGC && config->doICF == ICFLevel::None &&
- !args.hasArg(OPT_order) && !args.hasArg(OPT_profile));
+ !args.hasArg(OPT_order) && !args.hasArg(OPT_profile) &&
+ !args.hasArg(OPT_kernel));
config->integrityCheck =
args.hasFlag(OPT_integritycheck, OPT_integritycheck_no, false);
config->cetCompat = args.hasFlag(OPT_cetcompat, OPT_cetcompat_no, false);
@@ -1877,6 +1878,11 @@
config->lldmapFile.clear();
}
+ if (config->incremental && args.hasArg(OPT_kernel)) {
+ warn("ignoring '/incremental' due to '/kernel' specification");
+ config->incremental = false;
+ }
+
if (config->incremental && args.hasArg(OPT_profile)) {
warn("ignoring '/incremental' due to '/profile' specification");
config->incremental = false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128238.438526.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220621/219b1fe8/attachment.bin>
More information about the llvm-commits
mailing list