# Statically link the C runtime on Windows-GNU-LLVM targets so the # resulting EXE has no `libunwind.dll` import (or any other LLVM-MinGW # runtime DLL). Without this, the binary loads fine for an interactive # user whose PATH includes the toolchain's bin dir, but the loader # fails when SCM launches the binary as LocalSystem from session 0 -- # its PATH doesn't reach the gnullvm runtime, the loader can't find # libunwind.dll, and the service start times out with 1053 "did not # connect." [target.aarch64-pc-windows-gnullvm] rustflags = ["-C", "target-feature=+crt-static"] [target.x86_64-pc-windows-gnullvm] rustflags = ["-C", "target-feature=+crt-static"] # NOTE: do NOT install MinGW (x86_64-w64-mingw32-gcc) to cross-compile this # project. We target x86_64-pc-windows-gnullvm (LLVM MinGW), not the GNU # MinGW triple. Adding a GNU linker here will not work for gnullvm targets # and causes confusing "can't find crate for std" errors when the wrong # toolchain is on PATH. Use llvm-mingw and install the gnullvm rustup target # (`rustup target add x86_64-pc-windows-gnullvm`) instead.