Modify cargo's output extension

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.


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"


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

crate-type = ["cdylib"]

panic = "abort"
1 Like