Commit ec0e0d1
authored
Rollup merge of rust-lang#85274 - luqmana:linker-is-gnu-gc-sections, r=petrochenkov
Only pass --[no-]gc-sections if linker is GNU ld.
Fixes a regression from rust-lang#84468 where linking now fails with solaris linkers. LinkerFlavor::Gcc does not always mean GNU ld specifically. And in the case of at least the solaris ld in illumos, that flag is unrecognized and will cause the linking step to fail.
Even though removing the `is_like_solaris` branch from `gc_sections` in rust-lang#84468 made sense as `-z ignore/record` are more analogous to the `--[no-]-as-needed` flags, it inadvertently caused solaris linkers to be passed the `--gc-sections` flag. So let's just change it to be more explicit about when we pass those flags.File tree
2 files changed
+11
-9
lines changed- compiler
- rustc_codegen_ssa/src/back
- rustc_target/src/spec
2 files changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| |||
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
350 | | - | |
| 353 | + | |
351 | 354 | | |
352 | 355 | | |
353 | 356 | | |
| |||
358 | 361 | | |
359 | 362 | | |
360 | 363 | | |
361 | | - | |
| 364 | + | |
362 | 365 | | |
363 | 366 | | |
364 | 367 | | |
| |||
469 | 472 | | |
470 | 473 | | |
471 | 474 | | |
472 | | - | |
| 475 | + | |
473 | 476 | | |
474 | 477 | | |
475 | 478 | | |
476 | 479 | | |
477 | 480 | | |
478 | 481 | | |
479 | 482 | | |
480 | | - | |
481 | | - | |
482 | | - | |
| 483 | + | |
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
| |||
692 | 693 | | |
693 | 694 | | |
694 | 695 | | |
695 | | - | |
| 696 | + | |
696 | 697 | | |
697 | 698 | | |
698 | 699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
0 commit comments