1
Fork 0
rust/compiler/rustc_codegen_llvm/src
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
..
back Emit LLVM optimization remarks when enabled with -Cremark 2021-11-16 08:19:20 +01:00
coverageinfo Add conditional support for coverage map version 6 2021-11-30 13:54:53 -08:00
debuginfo re-format with new rustfmt 2021-11-30 13:08:41 -05:00
llvm Adjust llvm wrapper for unwinding support for inlineasm 2021-12-03 23:51:49 +01:00
abi.rs Auto merge of #91003 - psumbera:sparc64-abi, r=nagisa 2021-12-02 02:59:44 +00:00
allocator.rs Include debug info for the allocator shim 2021-08-31 15:24:20 -07:00
asm.rs Implement inline asm! for AVR platform 2021-12-06 01:02:49 -05:00
attributes.rs add rustc option for using LLVM stack smash protection 2021-11-22 20:06:22 +01:00
base.rs Use object crate for .rustc metadata generation 2021-12-07 09:39:05 +01:00
builder.rs Use more robust checks in rustc for wasm 2021-11-10 08:35:42 -08:00
callee.rs add platform support details file for armv7-unknown-linux-uclibc 2021-10-06 14:33:13 +00:00
common.rs Make abi::Abi Copy and remove a *lot* of refs 2021-09-09 10:41:19 +02:00
consts.rs Use more robust checks in rustc for wasm 2021-11-10 08:35:42 -08:00
context.rs Remove workaround for the forward progress handling in LLVM 2021-11-14 16:35:09 +01:00
declare.rs Remove the decl arg from FnAbi::llvm_type 2021-08-05 10:58:55 -07:00
intrinsic.rs LLVM codgen support for unwinding inline assembly 2021-12-03 23:51:49 +01:00
lib.rs Use object crate for .rustc metadata generation 2021-12-07 09:39:05 +01:00
llvm_util.rs Disable .debug_aranges for all wasm targets 2021-11-10 10:47:00 -08:00
mono_item.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
type_.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
type_of.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
va_arg.rs Fix clippy lints 2021-10-01 23:17:19 +02:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00