Skip to content

Commit 54b0fd4

Browse files
authored
fix: suppress linker warnings exposed by nightly rustc change (#279)
1 parent 34497aa commit 54b0fd4

File tree

9 files changed

+154
-120
lines changed

9 files changed

+154
-120
lines changed

crates/wdk-build/src/lib.rs

+13
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,15 @@ impl Config {
713713
// Linker arguments derived from WindowsDriver.KernelMode.WDM.props in Ni(22H2)
714714
// WDK
715715
println!("cargo::rustc-cdylib-link-arg=/ENTRY:DriverEntry");
716+
717+
// Ignore `LNK4257: object file was not compiled for kernel mode; the image
718+
// might not run` since `rustc` has no support for `/KERNEL`
719+
println!("cargo::rustc-cdylib-link-arg=/IGNORE:4257");
720+
721+
// Ignore `LNK4216: Exported entry point DriverEntry` since Rust currently
722+
// provides no way to set a symbol's name without also exporting the symbol:
723+
// https://github.com/rust-lang/rust/issues/67399
724+
println!("cargo::rustc-cdylib-link-arg=/IGNORE:4216");
716725
}
717726
DriverConfig::Kmdf(_) => {
718727
// Emit KMDF-specific libraries to link to
@@ -738,6 +747,10 @@ impl Config {
738747
// Linker arguments derived from WindowsDriver.KernelMode.KMDF.props in
739748
// Ni(22H2) WDK
740749
println!("cargo::rustc-cdylib-link-arg=/ENTRY:FxDriverEntry");
750+
751+
// Ignore `LNK4257: object file was not compiled for kernel mode; the image
752+
// might not run` since `rustc` has no support for `/KERNEL`
753+
println!("cargo::rustc-cdylib-link-arg=/IGNORE:4257");
741754
}
742755
DriverConfig::Umdf(umdf_config) => {
743756
// Emit UMDF-specific libraries to link to

examples/sample-kmdf-driver/Cargo.lock

+18-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/sample-umdf-driver/Cargo.lock

+18-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/sample-wdm-driver/Cargo.lock

+18-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)