Modify cargo's output extension

#1

I’m interested in compiling a Windows kernel driver using just Rust & Cargo.
In the meantime I got my driver to compile only using Rust stable 1.32.0 (x86_64-pc-windows-msvc), The only problem is the output file’s extension is “.dll” instead of “.sys”.

Does rust take any flags that can modify the output file’s extension? I couldn’t find anything.

Configurations:
.cargo/config

[target.x86_64-pc-windows-msvc]
rustflags = [
    "--emit", "obj",
    "-C", "link-arg=/DRIVER",
    "-C", "link-arg=/SUBSYSTEM:NATIVE",
    "-C", "link-arg=/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.17763.0\\km\\x64",
    "-C", "link-arg=/INTEGRITY"
]

Cargo.toml

[package]
name = "my-driver"
version = "0.1.0"
authors = []
edition = "2018"

[lib]
crate-type = ["cdylib"]

[profile.dev]
panic = "abort"
0 Likes