Files
libsignal/rust/bridge/node/build.rs
Jordan Rose 0b9a142268 Make Desktop Linux build reproducible, like the Java/Android build
These docker settings have been copied over from how Signal-Desktop
itself builds reproducibly.
2025-01-14 12:19:17 -08:00

19 lines
744 B
Rust

//
// Copyright 2024 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//
use std::env;
fn main() {
if env::var("TARGET").expect("set by Cargo") == "x86_64-unknown-linux-gnu" {
// The nightly compiler uses a new linker, rust-lld, by default on
// x86_64-unknown-linux-gnu, which causes issues with the `linkme` crate.
// We could disable rust-lld instead but then we'd lose out on the faster
// link times, so pass additional flags to the linker instead. See
// https://github.com/dtolnay/linkme/issues/94 and
// https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html#possible-drawbacks
println!("cargo:rustc-link-arg=-Wl,-z,nostart-stop-gc");
}
}