Skip to content

Commit

Permalink
fix: suppress linker warnings exposed by nightly rustc change (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
wmmc88 authored Jan 28, 2025
1 parent 34497aa commit 54b0fd4
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 120 deletions.
13 changes: 13 additions & 0 deletions crates/wdk-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,15 @@ impl Config {
// Linker arguments derived from WindowsDriver.KernelMode.WDM.props in Ni(22H2)
// WDK
println!("cargo::rustc-cdylib-link-arg=/ENTRY:DriverEntry");

// Ignore `LNK4257: object file was not compiled for kernel mode; the image
// might not run` since `rustc` has no support for `/KERNEL`
println!("cargo::rustc-cdylib-link-arg=/IGNORE:4257");

// Ignore `LNK4216: Exported entry point DriverEntry` since Rust currently
// provides no way to set a symbol's name without also exporting the symbol:
// https://github.com/rust-lang/rust/issues/67399
println!("cargo::rustc-cdylib-link-arg=/IGNORE:4216");
}
DriverConfig::Kmdf(_) => {
// Emit KMDF-specific libraries to link to
Expand All @@ -738,6 +747,10 @@ impl Config {
// Linker arguments derived from WindowsDriver.KernelMode.KMDF.props in
// Ni(22H2) WDK
println!("cargo::rustc-cdylib-link-arg=/ENTRY:FxDriverEntry");

// Ignore `LNK4257: object file was not compiled for kernel mode; the image
// might not run` since `rustc` has no support for `/KERNEL`
println!("cargo::rustc-cdylib-link-arg=/IGNORE:4257");
}
DriverConfig::Umdf(umdf_config) => {
// Emit UMDF-specific libraries to link to
Expand Down
33 changes: 18 additions & 15 deletions examples/sample-kmdf-driver/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 18 additions & 15 deletions examples/sample-umdf-driver/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 18 additions & 15 deletions examples/sample-wdm-driver/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 54b0fd4

Please sign in to comment.