Commit f383703
committed
Auto merge of rust-lang#111698 - Amanieu:force-static-lib, r=petrochenkov
Force all native libraries to be statically linked when linking a static binary
Previously, `#[link]` without an explicit `kind = "static"` would confuse the linker and end up producing a dynamically linked library because of the `-Bdynamic` flag. However this binary would not work correctly anyways since it was linked with startup code for a static binary.
This PR solves this by forcing all native libraries to be statically linked when the output is a static binary that cannot link to dynamic libraries anyways.
Fixes rust-lang#108878
Fixes rust-lang#102993File tree
3 files changed
+47
-6
lines changed- compiler
- rustc_codegen_ssa/src/back
- rustc_target/src/spec
- src/doc/rustc/src
3 files changed
+47
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2097 | 2097 | | |
2098 | 2098 | | |
2099 | 2099 | | |
2100 | | - | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
2101 | 2108 | | |
2102 | 2109 | | |
2103 | 2110 | | |
| |||
2107 | 2114 | | |
2108 | 2115 | | |
2109 | 2116 | | |
| 2117 | + | |
2110 | 2118 | | |
2111 | 2119 | | |
2112 | 2120 | | |
2113 | | - | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
2114 | 2129 | | |
2115 | 2130 | | |
2116 | 2131 | | |
| |||
2365 | 2380 | | |
2366 | 2381 | | |
2367 | 2382 | | |
| 2383 | + | |
2368 | 2384 | | |
2369 | 2385 | | |
2370 | 2386 | | |
| |||
2444 | 2460 | | |
2445 | 2461 | | |
2446 | 2462 | | |
2447 | | - | |
2448 | | - | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
2449 | 2473 | | |
2450 | 2474 | | |
2451 | 2475 | | |
| |||
2472 | 2496 | | |
2473 | 2497 | | |
2474 | 2498 | | |
| 2499 | + | |
2475 | 2500 | | |
2476 | 2501 | | |
2477 | 2502 | | |
| |||
2501 | 2526 | | |
2502 | 2527 | | |
2503 | 2528 | | |
| 2529 | + | |
2504 | 2530 | | |
2505 | 2531 | | |
2506 | 2532 | | |
| |||
2511 | 2537 | | |
2512 | 2538 | | |
2513 | 2539 | | |
| 2540 | + | |
2514 | 2541 | | |
2515 | 2542 | | |
2516 | 2543 | | |
| |||
2588 | 2615 | | |
2589 | 2616 | | |
2590 | 2617 | | |
| 2618 | + | |
2591 | 2619 | | |
2592 | 2620 | | |
2593 | 2621 | | |
| |||
2598 | 2626 | | |
2599 | 2627 | | |
2600 | 2628 | | |
| 2629 | + | |
2601 | 2630 | | |
2602 | 2631 | | |
2603 | 2632 | | |
| |||
2626 | 2655 | | |
2627 | 2656 | | |
2628 | 2657 | | |
| 2658 | + | |
2629 | 2659 | | |
2630 | 2660 | | |
2631 | 2661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
678 | 689 | | |
679 | 690 | | |
680 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments