Skip to content

Commit

Permalink
Ensure crt-static is applied to all platforms (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
karthiknadig authored Jul 17, 2024
1 parent 78c9431 commit a7903f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .cargo/config.toml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
# [registries.ms-crates-io]
# index = "sparse+https://pkgs.dev.azure.com/vscode/_packaging/crates/Cargo/index/"

# Windows: -Ctarget-feature=+crt-static: Statically link the CRT (required to link the spectre-mitigated CRT).
# Other: -Ctarget-feature=+crt-static: Statically link the CRT
[build]
rustflags = ["-Ctarget-feature=+crt-static"]

# -Cehcont_guard: Enable EH Continuation Metadata (https://learn.microsoft.com/en-us/cpp/build/reference/guard-enable-eh-continuation-metadata).
# -Ccontrol-flow-guard: Enable Control Flow Guard, needed for OneBranch's post-build analysis (https://learn.microsoft.com/en-us/cpp/build/reference/guard-enable-control-flow-guard).
# -Ctarget-feature=+crt-static: Statically link the CRT (required to link the spectre-mitigated CRT).
[target.'cfg(target_os = "windows")']
rustflags = ["-Cehcont_guard", "-Ccontrol-flow-guard", "-Ctarget-feature=+crt-static"]
rustflags = ["-Cehcont_guard", "-Ccontrol-flow-guard"]

# -Clink-args=/DYNAMICBASE /CETCOMPAT: Enable "shadow stack" (https://learn.microsoft.com/en-us/cpp/build/reference/cetcompat)
[target.'cfg(all(target_os = "windows", any(target_arch = "i686", target_arch = "x86_64")))']
Expand Down

0 comments on commit a7903f2

Please sign in to comment.