diff --git a/.cargo/config.toml b/.cargo/config.toml index eaa2aae..dda5ea5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,3 +6,22 @@ rustflags = ["-C", "target-feature=+crt-static"] [target.i686-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"] + +[target.aarch64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] + +[target.'cfg(target_os = "windows")'] +rustflags = [ + # Disables linking against the default Universal C Runtime (libucrt.lib). This prevents conflicts if another CRT library is linked manually. + "-C", + "link-args=/NODEFAULTLIB:libucrt.lib", + # Manually adds ucrt.lib (the Universal CRT) as a default library to link against, replacing the one you just excluded above. + # This ensures consistent linking when multiple CRTs might be available. + "-C", + "link-args=/DEFAULTLIB:ucrt.lib", +] + +# LLD linker is currently broken for us, opt out. +# https://blog.rust-lang.org/2025/09/18/Rust-1.90.0/#what-s-in-1-90-0-stable +[target.x86_64-unknown-linux-gnu] +rustflags = ["-C", "linker-features=-lld"]