rust/compiler/rustc_codegen_ssa/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
..
back Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3 2024-05-23 23:39:26 +02:00
debuginfo Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
mir Stop using to_hir_binop in codegen 2024-05-22 01:34:26 -07:00
traits cleanup: run rustfmt 2024-05-23 15:10:04 -04:00
assert_module_sources.rs Rename IntoDiagnosticArg as IntoDiagArg. 2024-03-11 09:12:19 +11:00
base.rs Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk 2024-05-23 14:09:23 +02:00
codegen_attrs.rs Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
common.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
errors.rs emit an error if we can't find a path to the self-contained linker 2024-05-23 15:47:35 +00:00
lib.rs PR feedback 2024-05-21 20:12:30 -04:00
meth.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
mono_item.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
size_of_val.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00
target_features.rs Remove extern crate rustc_middle from numerous crates. 2024-04-29 14:50:45 +10:00