rust/compiler/rustc_codegen_ssa/src/traits
bors f9e77f2b46 Auto merge of #91604 - nikic:section-flags, r=nagisa
Use object crate for .rustc metadata generation

We already use the object crate for generating uncompressed .rmeta
metadata object files. This switches the generation of compressed
.rustc object files to use the object crate as well. These have
slightly different requirements in that .rmeta should be completely
excluded from any final compilation artifacts, while .rustc should
be part of shared objects, but not loaded into memory.

The primary motivation for this change is #90326: In LLVM 14, the
current way of setting section flags (and in particular, preventing
the setting of SHF_ALLOC) will no longer work. There are other ways
we could work around this, but switching to the object crate seems
like the most elegant, as we already use it for .rmeta, and as it
makes this independent of the codegen backend. In particular, we
don't need separate handling in codegen_llvm and codegen_gcc.
codegen_cranelift should be able to reuse the implementation as
well, though I have omitted that here, as it is not based on
codegen_ssa.

This change mostly extracts the existing code for .rmeta handling
to allow using it for .rustc as well, and adjusts the codegen
infrastructure to handle the metadata object file separately: We
no longer create a backend-specific module for it, and directly
produce the compiled module instead.

This does not `fix` #90326 by itself yet, as .llvmbc will need to be
handled separately.

r? `@nagisa`
2021-12-08 14:58:48 +00:00
..
abi.rs Feat: make cg_ssa get_param borrow the builder mutable 2021-11-23 22:30:20 -05:00
asm.rs LLVM codgen support for unwinding inline assembly 2021-12-03 23:51:49 +01:00
backend.rs Use object crate for .rustc metadata generation 2021-12-07 09:39:05 +01:00
builder.rs Add LLVM CFI support to the Rust compiler 2021-10-25 16:23:01 -07:00
consts.rs Make abi::Abi Copy and remove a *lot* of refs 2021-09-09 10:41:19 +02:00
coverageinfo.rs Changes from review comments 2021-03-23 17:02:10 -07:00
debuginfo.rs Create more accurate debuginfo for vtables. 2021-10-08 10:33:47 +02:00
declare.rs Remove DeclareMethods 2020-09-18 13:11:59 +02:00
intrinsic.rs Remove workaround for the forward progress handling in LLVM 2021-11-14 16:35:09 +01:00
misc.rs Always use llvm.used for coverage symbols 2021-08-21 10:08:05 +02:00
mod.rs Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
statics.rs Always use llvm.used for coverage symbols 2021-08-21 10:08:05 +02:00
type_.rs Prepare call/invoke for opaque pointers 2021-08-05 10:58:55 -07:00
write.rs Support -C passes in NewPM 2021-05-08 10:58:08 +02:00