mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
9488cacc52
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 adjust 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.
45 lines
1.3 KiB
TOML
45 lines
1.3 KiB
TOML
[package]
|
|
name = "rustc_codegen_ssa"
|
|
version = "0.0.0"
|
|
edition = "2021"
|
|
|
|
[lib]
|
|
test = false
|
|
|
|
[dependencies]
|
|
bitflags = "1.2.1"
|
|
cc = "1.0.69"
|
|
itertools = "0.9"
|
|
tracing = "0.1"
|
|
libc = "0.2.50"
|
|
jobserver = "0.1.22"
|
|
tempfile = "3.2"
|
|
pathdiff = "0.2.0"
|
|
snap = "1"
|
|
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
|
regex = "1.4"
|
|
|
|
rustc_serialize = { path = "../rustc_serialize" }
|
|
rustc_ast = { path = "../rustc_ast" }
|
|
rustc_span = { path = "../rustc_span" }
|
|
rustc_middle = { path = "../rustc_middle" }
|
|
rustc_apfloat = { path = "../rustc_apfloat" }
|
|
rustc_attr = { path = "../rustc_attr" }
|
|
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
|
|
rustc_data_structures = { path = "../rustc_data_structures" }
|
|
rustc_errors = { path = "../rustc_errors" }
|
|
rustc_fs_util = { path = "../rustc_fs_util" }
|
|
rustc_hir = { path = "../rustc_hir" }
|
|
rustc_incremental = { path = "../rustc_incremental" }
|
|
rustc_index = { path = "../rustc_index" }
|
|
rustc_macros = { path = "../rustc_macros" }
|
|
rustc_metadata = { path = "../rustc_metadata" }
|
|
rustc_query_system = { path = "../rustc_query_system" }
|
|
rustc_target = { path = "../rustc_target" }
|
|
rustc_session = { path = "../rustc_session" }
|
|
|
|
[dependencies.object]
|
|
version = "0.26.2"
|
|
default-features = false
|
|
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]
|