Commit 6df2fbc
authored
Unrolled build for #159029
Rollup merge of #159029 - erickt:lto-module-summaries, r=cuviper
rustc_llvm: Emit module summaries when using -Clto=fat
Currently, module summaries are only emitted with thin lto. If we would link full/fat lto'd rust code against lto'd c++ code built with CFI (or WPD), those passes would fail during the link step because the participating rust modules are missing module summaries. Rust code does not know at compile-time if it would be participating in some special link which may require module summaries, so this PR ensures module summaries are unconditionally emitted for full/fat lto, just like with thin lto.
The WriteBitcodeToFile function just invokes the normal BitcodeWriterPass under the hood, but doesn't provide a way to set the argument for emitting module summaries. So this patch just adds the pass directly and sets that argument.
This is a rebase of @PiJoules's #158099, which also should fix up the tests with the gcc tools.4 files changed
Lines changed: 60 additions & 19 deletions
File tree
- compiler
- rustc_llvm/llvm-wrapper
- rustc_metadata/src
- tests/run-make/fat-lto-module-summary
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
606 | 627 | | |
607 | 628 | | |
608 | 629 | | |
| |||
943 | 964 | | |
944 | 965 | | |
945 | 966 | | |
946 | | - | |
947 | | - | |
| 967 | + | |
| 968 | + | |
948 | 969 | | |
949 | 970 | | |
950 | 971 | | |
951 | 972 | | |
952 | 973 | | |
953 | | - | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
954 | 978 | | |
955 | 979 | | |
956 | 980 | | |
| |||
1469 | 1493 | | |
1470 | 1494 | | |
1471 | 1495 | | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
1484 | 1508 | | |
1485 | | - | |
| 1509 | + | |
1486 | 1510 | | |
| 1511 | + | |
| 1512 | + | |
1487 | 1513 | | |
1488 | | - | |
1489 | 1514 | | |
1490 | | - | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
1491 | 1518 | | |
| 1519 | + | |
1492 | 1520 | | |
1493 | 1521 | | |
1494 | 1522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments