Commit 6b474dd
committed
ci: Specify target and static linking of C runtime explicitly
Without specifying the target, cargo uses the host target, which in case
of Linux runners is `*-unknown-linux-gnu`. To test static linking to the
full extent, use `*-unknown-linux-musl` targets.
On top of that, make sure that libc and C runtime are actually linked
statically by specifying `-C target-feature=+crt-static` rustflag. As of
today, that's still a default option on the most of `*-musl`
targets[0][1], but it's being phased out in favor of dynamic linking
being the default option.[2][3][4]
[0] https://github.com/rust-lang/rust/blob/672388edbee9e93c35e5fdf7dac818a6612a5103/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs#L19-L20
[1] https://github.com/rust-lang/rust/blob/672388edbee9e93c35e5fdf7dac818a6612a5103/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs#L17-L18
[2] rust-lang/compiler-team#422
[3] rust-lang/rust#133386
[4] rust-lang/rust#144511 parent 2a078ad commit 6b474dd
1 file changed
+25
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
316 | 326 | | |
317 | 327 | | |
318 | 328 | | |
| |||
337 | 347 | | |
338 | 348 | | |
339 | 349 | | |
340 | | - | |
341 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
342 | 356 | | |
343 | 357 | | |
344 | 358 | | |
345 | | - | |
346 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
347 | 362 | | |
348 | 363 | | |
349 | 364 | | |
350 | | - | |
351 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
352 | 368 | | |
353 | 369 | | |
354 | 370 | | |
355 | 371 | | |
356 | | - | |
357 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
358 | 375 | | |
359 | 376 | | |
360 | 377 | | |
| |||
0 commit comments