Skip to content

Commit 759febd

Browse files
authored
Enable static CRT linking for Linux targets (#424)
Change target-feature from -crt-static to +crt-static for gnu and musl targets to create fully static, portable binaries.
1 parent cbaff53 commit 759febd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

earthly/rust/stdcfgs/cargo_config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
linker = "clang"
1515
rustflags = [
1616
"-C", "link-arg=-fuse-ld=/usr/bin/mold",
17-
"-C", "target-feature=-crt-static"
17+
"-C", "target-feature=+crt-static"
1818
]
1919

2020
# Should be the default to have fully static rust programs in CI
2121
[target.aarch64-unknown-linux-musl]
2222
linker = "clang"
2323
rustflags = [
2424
"-C", "link-arg=-fuse-ld=/usr/bin/mold",
25-
"-C", "target-feature=-crt-static"
25+
"-C", "target-feature=+crt-static"
2626
]
2727

2828
[build]

examples/rust/.cargo/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
linker = "clang"
1515
rustflags = [
1616
"-C", "link-arg=-fuse-ld=/usr/bin/mold",
17-
"-C", "target-feature=-crt-static"
17+
"-C", "target-feature=+crt-static"
1818
]
1919

2020
# Should be the default to have fully static rust programs in CI
2121
[target.aarch64-unknown-linux-musl]
2222
linker = "clang"
2323
rustflags = [
2424
"-C", "link-arg=-fuse-ld=/usr/bin/mold",
25-
"-C", "target-feature=-crt-static"
25+
"-C", "target-feature=+crt-static"
2626
]
2727

2828
[build]

0 commit comments

Comments
 (0)