Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing arm64rt library to linker flags for arm64 kernel-mode builds #261

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
12 changes: 12 additions & 0 deletions crates/wdk-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,12 @@ impl Config {
println!("cargo::rustc-link-lib=static=hal");
println!("cargo::rustc-link-lib=static=wmilib");

// Emit ARM64-specific libraries to link to derived from
// WindowsDriver.arm64.props
if self.cpu_architecture == CPUArchitecture::ARM64 {
println!("cargo::rustc-link-lib=static=arm64rt");
}

// Linker arguments derived from WindowsDriver.KernelMode.props in Ni(22H2) WDK
println!("cargo::rustc-cdylib-link-arg=/DRIVER");
println!("cargo::rustc-cdylib-link-arg=/NODEFAULTLIB");
Expand All @@ -717,6 +723,12 @@ impl Config {
println!("cargo::rustc-link-lib=static=WdfLdr");
println!("cargo::rustc-link-lib=static=WdfDriverEntry");

// Emit ARM64-specific libraries to link to derived from
// WindowsDriver.arm64.props
if self.cpu_architecture == CPUArchitecture::ARM64 {
println!("cargo::rustc-link-lib=static=arm64rt");
}

// Linker arguments derived from WindowsDriver.KernelMode.props in Ni(22H2) WDK
println!("cargo::rustc-cdylib-link-arg=/DRIVER");
println!("cargo::rustc-cdylib-link-arg=/NODEFAULTLIB");
Expand Down
Loading