rust/compiler/rustc_session/src
Guillaume Gomez 4ee97fc3db
Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3
rustc_codegen_llvm: add support for writing summary bitcode

Typical uses of ThinLTO don't have any use for this as a standalone file, but distributed ThinLTO uses this to make the linker phase more efficient. With clang you'd do something like `clang -flto=thin -fthin-link-bitcode=foo.indexing.o -c foo.c` and then get both foo.o (full of bitcode) and foo.indexing.o (just the summary or index part of the bitcode). That's then usable by a two-stage linking process that's more friendly to distributed build systems like bazel, which is why I'm working on this area.

I talked some to `@teresajohnson` about naming in this area, as things seem to be a little confused between various blog posts and build systems. "bitcode index" and "bitcode summary" tend to be a little too ambiguous, and she tends to use "thin link bitcode" and "minimized bitcode" (which matches the descriptions in LLVM). Since the clang option is thin-link-bitcode, I went with that to try and not add a new spelling in the world.

Per `@dtolnay,` you can work around the lack of this by using `lld --thinlto-index-only` to do the indexing on regular .o files of bitcode, but that is a bit wasteful on actions when we already have all the information in rustc and could just write out the matching minimized bitcode. I didn't test that at all in our infrastructure, because by the time I learned that I already had this patch largely written.
2024-05-23 23:39:26 +02:00
..
config Add rustfmt cfg to well known cfgs list 2024-05-05 14:30:35 +02:00
code_stats.rs -Zprint-type-sizes: print the types of awaitees and unnamed coroutine locals. 2024-03-22 18:07:15 -07:00
config.rs rustc_codegen_llvm: add support for writing summary bitcode 2024-05-22 14:04:22 -04:00
cstore.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
errors.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
filesearch.rs add helper to target bin path 2024-05-21 18:40:34 +00:00
lib.rs Remove extern crate tracing from numerous crates. 2024-04-30 16:47:49 +10:00
options.rs Rollup merge of #124480 - Enselic:on-broken-pipe, r=jieyouxu 2024-05-03 23:34:22 -04:00
output.rs Make incremental sessions identity no longer depend on the crate names provided by source code 2024-03-13 16:40:02 +01:00
parse.rs Rename buffer_lint_with_diagnostic to buffer_lint 2024-05-21 20:16:39 +00:00
search_paths.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
session.rs Rollup merge of #125263 - lqd:lld-fallback, r=petrochenkov 2024-05-23 23:39:26 +02:00
utils.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
version.rs Implement IntoDiagArg for RustcVersion 2024-05-21 20:11:42 +00:00