mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-30 09:29:58 -07:00
rustc -C strip=debuginfo leaves the symbol table intact, meaning RUST_BACKTRACE=1 on the installer still produces helpful output. This significantly reduces the binary size, eg the amd64 installer goes from 93M to 21M. Stripping the symbol table only reclaims a further ~2M.
42 lines
1.2 KiB
TOML
42 lines
1.2 KiB
TOML
[target.aarch64-apple-darwin]
|
|
linker = "rust-lld"
|
|
rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
[target.aarch64-unknown-linux-musl]
|
|
linker = "rust-lld"
|
|
rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
# apt install build-essential libc6-armhf-cross libc6-dev-armhf-cross gcc-arm-linux-gnueabihf
|
|
[target.armv7-unknown-linux-gnueabihf]
|
|
linker = "arm-linux-gnueabihf-gcc"
|
|
rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
[target.armv7-unknown-linux-musleabihf]
|
|
linker = "rust-lld"
|
|
rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
# Disable rust-lld for x86 macOS because the linker crashers when compiling
|
|
# the installer in release mode with debug info on.
|
|
# [target.x86_64-apple-darwin]
|
|
# linker = "rust-lld"
|
|
# rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
[target.x86_64-unknown-linux-musl]
|
|
linker = "rust-lld"
|
|
rustflags = ["-C", "target-feature=+crt-static"]
|
|
|
|
# keep line numbers in stack traces for non-firmware binaries
|
|
[profile.release]
|
|
debug = "limited"
|
|
strip = "debuginfo"
|
|
|
|
# optimizations to reduce the binary size of firmware binaries
|
|
[profile.firmware]
|
|
inherits = "release"
|
|
strip = true
|
|
opt-level = "z"
|
|
lto = true
|
|
codegen-units = 1
|
|
panic = "abort"
|
|
debug = false
|