rust/compiler/rustc_codegen_ssa/Cargo.toml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.4 KiB
TOML
Raw Normal View History

2020-08-28 03:58:48 +00:00
[package]
name = "rustc_codegen_ssa"
version = "0.0.0"
2021-09-19 16:49:55 +00:00
edition = "2021"
2020-08-28 03:58:48 +00:00
[lib]
test = false
[dependencies]
bitflags = "1.2.1"
2021-07-13 08:58:50 +00:00
cc = "1.0.69"
2022-03-04 17:54:28 +00:00
itertools = "0.10.1"
2020-08-28 03:58:48 +00:00
tracing = "0.1"
libc = "0.2.50"
jobserver = "0.1.22"
2021-04-23 22:33:09 +00:00
tempfile = "3.2"
thorin-dwp = "0.3"
2020-08-28 03:58:48 +00:00
pathdiff = "0.2.0"
2022-05-06 15:20:42 +00:00
serde_json = "1.0.59"
snap = "1"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
regex = "1.4"
2020-08-28 03:58:48 +00:00
rustc_serialize = { path = "../rustc_serialize" }
rustc_arena = { path = "../rustc_arena" }
2020-08-28 03:58:48 +00: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-28 03:58:48 +00: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 15:48:54 +00:00
rustc_query_system = { path = "../rustc_query_system" }
2020-08-28 03:58:48 +00: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 18:53:33 +00:00
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]