Skip to content

Commit 47f0404

Browse files
authored
Update Driver.cpp
1 parent bbf3dd2 commit 47f0404

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lld/COFF/Driver.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -1707,9 +1707,17 @@ void LinkerDriver::linkerMain(ArrayRef<const char *> argsArr) {
17071707
config->driverWdm = args.hasArg(OPT_driver_wdm) ||
17081708
args.hasArg(OPT_driver_uponly_wdm) ||
17091709
args.hasArg(OPT_driver_wdm_uponly);
1710-
config->driver =
1710+
config->driver |=
17111711
config->driverUponly || config->driverWdm || args.hasArg(OPT_driver);
1712-
1712+
1713+
// Check if any ObjFile instance has kernel enabled
1714+
for (ObjFile *file : ctx.objFileInstances) {
1715+
if (file->doesKernelDriver()) {
1716+
config->driver = true;
1717+
break;
1718+
}
1719+
}
1720+
17131721
// Handle /pdb
17141722
bool shouldCreatePDB =
17151723
(debug == DebugKind::Full || debug == DebugKind::GHash ||

0 commit comments

Comments
 (0)