diff --git a/lld/COFF/Driver.cpp b/lld/COFF/Driver.cpp --- a/lld/COFF/Driver.cpp +++ b/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; diff --git a/lld/COFF/Options.td b/lld/COFF/Options.td --- a/lld/COFF/Options.td +++ b/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">,