tftsr-devops_investigation/src-tauri/.cargo/config.toml
Shaun Arman 9e3e3766e7
Some checks failed
Test / frontend-tests (pull_request) Failing after 1m15s
Test / frontend-typecheck (pull_request) Successful in 1m57s
PR Review Automation / review (pull_request) Successful in 4m17s
Test / rust-fmt-check (pull_request) Successful in 13m32s
Test / rust-clippy (pull_request) Has been cancelled
Test / rust-tests (pull_request) Has been cancelled
fix(build): resolve Windows MinGW memset_explicit linking error
libsodium-sys requires memset_explicit which is not available in older
MinGW toolchains. Added a C shim that provides a fallback implementation
using volatile pointers to prevent compiler optimization.

Changes:
- Added memset_s_shim.c with fallback memset_explicit implementation
- Updated build.rs to compile shim for Windows GNU targets
- Added cc crate as build dependency
- Set CFLAGS in CI to target Windows 8+ (_WIN32_WINNT=0x0602)
- Set SODIUM_STATIC=yes to force static libsodium build

Fixes linking error: undefined reference to memset_explicit

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-06-13 23:36:54 -05:00

16 lines
643 B
TOML

[target.x86_64-pc-windows-gnu]
# Prevent MinGW ld from auto-exporting all ~106k public symbols into the DLL
# export table, which would exceed the 65535 ordinal limit and cause a link
# error. The desktop binary links against rlib (static), so cdylib exports
# are unused at runtime.
rustflags = ["-C", "link-arg=-Wl,--exclude-all-symbols"]
[env]
# Use system OpenSSL instead of vendoring from source (which requires Perl modules
# unavailable on some environments and breaks clippy/check).
OPENSSL_NO_VENDOR = "1"
# Force libsodium to use minimal mode which avoids memset_explicit on Windows
SODIUM_USE_PKG_CONFIG = "0"
SODIUM_STATIC = "1"