rust/compiler/rustc_session/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
..
cgu_reuse_tracker.rs Prettify rustc_session fmt with capturing args (nfc) 2022-03-24 22:38:13 -07:00
code_stats.rs avoid some Symbol to String conversions 2022-07-17 04:09:20 +09:00
config.rs Do not ICE when we have -Zunpretty=expand with invalid ABI 2022-07-16 20:35:54 -07:00
cstore.rs Stabilize native library modifier syntax and the whole-archive modifier specifically 2022-03-30 23:53:21 +03:00
filesearch.rs Prettify rustc_session fmt with capturing args (nfc) 2022-03-24 22:38:13 -07:00
lib.rs Stabilize let_chains 2022-07-16 20:17:58 -03:00
options.rs Auto merge of #98162 - nextsilicon:support_lto_embed_bitcode, r=davidtwco 2022-07-21 10:13:59 +00:00
output.rs Use a let-chain in _session::output (nfc) 2022-03-24 22:38:32 -07:00
parse.rs update cfg(bootstrap)s 2022-07-01 15:48:23 +02:00
search_paths.rs incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it. 2022-04-19 10:43:20 +02:00
session.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
utils.rs rustc_parse: Move AST -> TokenStream conversion logic to rustc_ast 2022-05-22 12:01:07 +03:00