@@ -8,12 +8,33 @@ POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/
88[registry ]
99global-credential-providers = [" cargo:token" ]
1010
11- # Enable Control Flow Guard (needed for OneBranch's post-build analysis).
11+ # Avoid linking with vcruntime140.dll by statically linking everything,
12+ # and then explicitly linking with ucrtbase.dll dynamically.
13+ # We do this, because vcruntime140.dll is an optional Windows component.
1214[target .x86_64-pc-windows-msvc ]
13- rustflags = [" -Ccontrol-flow-guard" , " -Ctarget-feature=+crt-static" , " -Clink-args=/DYNAMICBASE /CETCOMPAT" ]
15+ rustflags = [
16+ " -Ccontrol-flow-guard" ,
17+ " -Ctarget-feature=+crt-static" ,
18+ " -Clink-args=/DEFAULTLIB:ucrt.lib" ,
19+ " -Clink-args=/NODEFAULTLIB:vcruntime.lib" ,
20+ " -Clink-args=/NODEFAULTLIB:msvcrt.lib" ,
21+ " -Clink-args=/NODEFAULTLIB:libucrt.lib" ,
22+ " -Clink-args=/DYNAMICBASE" ,
23+ " -Clink-args=/CETCOMPAT" ,
24+ " -Dwarnings"
25+ ]
1426
1527[target .aarch64-windows-msvc ]
16- rustflags = [" -Ccontrol-flow-guard" , " -Ctarget-feature=+crt-static" , " -Clink-args=/DYNAMICBASE" ]
28+ rustflags = [
29+ " -Ccontrol-flow-guard" ,
30+ " -Ctarget-feature=+crt-static" ,
31+ " -Clink-args=/DEFAULTLIB:ucrt.lib" ,
32+ " -Clink-args=/NODEFAULTLIB:vcruntime.lib" ,
33+ " -Clink-args=/NODEFAULTLIB:msvcrt.lib" ,
34+ " -Clink-args=/NODEFAULTLIB:libucrt.lib" ,
35+ " -Clink-args=/DYNAMICBASE" ,
36+ " -Dwarnings"
37+ ]
1738
1839# The following is only needed for release builds
1940[source .crates-io ]
0 commit comments