Skip to content

Commit

Permalink
Auto merge of rust-lang#130417 - workingjubilee:pull-in-backtrace-wit…
Browse files Browse the repository at this point in the history
…h-zstd, r=<try>

Support symbolicating zstd-compressed ELF sections

This requires bumping backtrace to rust-lang/backtrace-rs@4f3acf7 which includes support for symbolicating from newer Android APK formats, as well as for using zstd-compressed ELF sections for debuginfo.

It also requires compiling ruzstd, a zstd decompressor written in Rust.

This can combine with rust-lld's support for zstd-compressed debuginfo for overall smaller debuginfo sections.
  • Loading branch information
bors committed Sep 16, 2024
2 parents 3a22be3 + 6fb058e commit 7100709
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,17 @@ dependencies = [
"std",
]

[[package]]
name = "ruzstd"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99c3938e133aac070997ddc684d4b393777d293ba170f2988c8fd5ea2ad4ce21"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
]

[[package]]
name = "std"
version = "0.0.0"
Expand All @@ -336,6 +347,7 @@ dependencies = [
"rand",
"rand_xorshift",
"rustc-demangle",
"ruzstd",
"std_detect",
"unwind",
"wasi",
Expand Down
2 changes: 2 additions & 0 deletions library/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ gimli.opt-level = "s"
miniz_oxide.debug = 0
object.debug = 0
rustc-demangle.debug = 0
ruzstd.debug = 0
ruzstd.opt-level = "s"

[patch.crates-io]
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
Expand Down
5 changes: 4 additions & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'] }
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
miniz_oxide = { version = "0.7.0", optional = true, default-features = false }
addr2line = { version = "0.22.0", optional = true, default-features = false }
ruzstd = { version = "0.7.2", default-features = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.156", default-features = false, features = [
Expand All @@ -48,6 +49,7 @@ object = { version = "0.36.0", default-features = false, optional = true, featur
'unaligned',
'archive',
] }
ruzstd = { version = "0.7.2", default-features = false, optional = true, features = [ "rustc-dep-of-std"] }

[target.'cfg(target_os = "aix")'.dependencies]
object = { version = "0.36.0", default-features = false, optional = true, features = [
Expand Down Expand Up @@ -89,8 +91,9 @@ r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'] }
[features]
backtrace = [
'addr2line/rustc-dep-of-std',
'object/rustc-dep-of-std',
'miniz_oxide/rustc-dep-of-std',
'object/rustc-dep-of-std',
'ruzstd/rustc-dep-of-std',
]

panic-unwind = ["panic_unwind"]
Expand Down
1 change: 1 addition & 0 deletions src/tools/tidy/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ const PERMITTED_STDLIB_DEPENDENCIES: &[&str] = &[
"rand_core",
"rand_xorshift",
"rustc-demangle",
"ruzstd",
"unicode-width",
"unwinding",
"wasi",
Expand Down

0 comments on commit 7100709

Please sign in to comment.