Skip to content

Commit

Permalink
Enable the crt-static target feature
Browse files Browse the repository at this point in the history
We were relying on the fact that our current targets link the C runtime
statically. However, this may be different for other targets and could
even change in the future (e.g., see
rust-lang/compiler-team#422).

With this commit we adopt the current recommendation, which is enabling
the crt-static target feature when building. See
https://doc.rust-lang.org/reference/linkage.html#static-and-dynamic-c-runtimes
for details.

Given the current defaults for Rust targets, this change should be a
no-op, but this shall make us safer and more resilient to Rust changes
in the long run.

Signed-off-by: Leandro Motta Barros <leandro@balena.io>
Change-type: patch
  • Loading branch information
lmbarros committed Mar 6, 2024
1 parent 9f45d84 commit 072addb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build.env]
passthrough = ["RUSTFLAGS=-C target-feature=+crt-static"]

0 comments on commit 072addb

Please sign in to comment.