rust/compiler/rustc_interface/src
bors 74f600b990 Auto merge of #98162 - nextsilicon:support_lto_embed_bitcode, r=davidtwco
Allow to disable thinLTO buffer to support lto-embed-bitcode lld feature

Hello
This change is to fix issue (https://github.com/rust-lang/rust/issues/84395) in which passing "-lto-embed-bitcode=optimized" to lld when linking rust code via linker-plugin-lto doesn't produce the expected result.

Instead of emitting a single unified module into a llvmbc section of the linked elf, it emits multiple submodules.
This is caused because rustc emits the BC modules after running llvm `createWriteThinLTOBitcodePass` pass.
Which in turn triggers a thinLTO linkage and causes the said issue.

This patch allows via compiler flag (-Cemit-thin-lto=<bool>) to select between running `createWriteThinLTOBitcodePass` and `createBitcodeWriterPass`.
Note this pattern of selecting between those 2 passes is common inside of LLVM code.
The default is to match the old behavior.
2022-07-21 10:13:59 +00:00
..
callbacks.rs typo 2022-05-23 22:51:34 +02:00
interface.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
lib.rs Fully stabilize NLL 2022-06-03 17:16:41 -04:00
passes.rs Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot 2022-07-14 21:50:14 +00:00
proc_macro_decls.rs update Finder to store LocalDefId 2022-04-09 14:00:22 -04:00
queries.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
tests.rs Auto merge of #98162 - nextsilicon:support_lto_embed_bitcode, r=davidtwco 2022-07-21 10:13:59 +00:00
util.rs Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot 2022-07-14 21:50:14 +00:00