rust/compiler/rustc_codegen_ssa/Cargo.toml

49 lines
1.4 KiB
TOML
Raw Normal View History

2020-08-27 22:58:48 -05:00
[package]
name = "rustc_codegen_ssa"
version = "0.0.0"
2021-09-19 11:49:55 -05:00
edition = "2021"
2020-08-27 22:58:48 -05:00
[lib]
test = false
[dependencies]
ar_archive_writer = "0.1.1"
2020-08-27 22:58:48 -05:00
bitflags = "1.2.1"
2021-07-13 03:58:50 -05:00
cc = "1.0.69"
2022-03-04 11:54:28 -06:00
itertools = "0.10.1"
2020-08-27 22:58:48 -05:00
tracing = "0.1"
libc = "0.2.50"
jobserver = "0.1.22"
2021-04-23 17:33:09 -05:00
tempfile = "3.2"
thorin-dwp = "0.3"
2020-08-27 22:58:48 -05:00
pathdiff = "0.2.0"
2022-05-06 10:20:42 -05:00
serde_json = "1.0.59"
snap = "1"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
regex = "1.4"
2020-08-27 22:58:48 -05:00
rustc_serialize = { path = "../rustc_serialize" }
rustc_arena = { path = "../rustc_arena" }
2020-08-27 22:58:48 -05:00
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
rustc_middle = { path = "../rustc_middle" }
rustc_attr = { path = "../rustc_attr" }
rustc_symbol_mangling = { path = "../rustc_symbol_mangling" }
rustc_data_structures = { path = "../rustc_data_structures" }
2020-08-27 22:58:48 -05:00
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" }
2020-11-14 09:48:54 -06:00
rustc_query_system = { path = "../rustc_query_system" }
2020-08-27 22:58:48 -05:00
rustc_target = { path = "../rustc_target" }
rustc_session = { path = "../rustc_session" }
rustc_const_eval = { path = "../rustc_const_eval" }
[dependencies.object]
version = "0.29.0"
default-features = false
rustc: Store metadata-in-rlibs in object files This commit updates how rustc compiler metadata is stored in rlibs. Previously metadata was stored as a raw file that has the same format as `--emit metadata`. After this commit, however, the metadata is encoded into a small object file which has one section which is the contents of the metadata. The motivation for this commit is to fix a common case where #83730 arises. The problem is that when rustc crates a `dylib` crate type it needs to include entire rlib files into the dylib, so it passes `--whole-archive` (or the equivalent) to the linker. The problem with this, though, is that the linker will attempt to read all files in the archive. If the metadata file were left as-is (today) then the linker would generate an error saying it can't read the file. The previous solution was to alter the rlib just before linking, creating a new archive in a temporary directory which has the metadata file removed. This problem from before this commit is now removed if the metadata file is stored in an object file that the linker can read. The only caveat we have to take care of is to ensure that the linker never actually includes the contents of the object file into the final output. We apply similar tricks as the `.llvmbc` bytecode sections to do this. This involved changing the metadata loading code a bit, namely updating some of the LLVM C APIs used to use non-deprecated ones and fiddling with the lifetimes a bit to get everything to work out. Otherwise though this isn't intended to be a functional change really, only that metadata is stored differently in archives now. This should end up fixing #83730 because by default dylibs will no longer have their rlib dependencies "altered" meaning that split-debuginfo will continue to have valid paths pointing at the original rlibs. (note that we still "alter" rlibs if LTO is enabled to remove Rust object files and we also "alter" for the #[link(cfg)] feature, but that's rarely used). Closes #83730
2021-04-22 13:53:33 -05:00
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]