Skip to content

Commit dbef181

Browse files
committed
kbuild: rust: use -Zdebuginfo-compression
Rust 1.74.0 introduced (unstable) support for the `-Zdebuginfo-compression` flag, thus use it. Note that the releases built by the Rust project (i.e. the ones provided by rustup) do not enable support for zstd in their bundled LLVM (yet, at least), thus the Rust compiler will warn, but the build will proceed: warning: unknown debuginfo compression algorithm zstd - will fall back to uncompressed debuginfo Link: rust-lang/rust#120953 Link: rust-lang/rust#115358 Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240217002622.57322-1-ojeda@kernel.org [ Added note about zstd support in Rust-provided binaries. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent b8b2096 commit dbef181

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/Makefile.debug

+2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ endif
3535

3636
ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZLIB
3737
DEBUG_CFLAGS += -gz=zlib
38+
DEBUG_RUSTFLAGS += -Zdebuginfo-compression=zlib
3839
KBUILD_AFLAGS += -gz=zlib
3940
KBUILD_LDFLAGS += --compress-debug-sections=zlib
4041
else ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZSTD
4142
DEBUG_CFLAGS += -gz=zstd
43+
DEBUG_RUSTFLAGS += -Zdebuginfo-compression=zstd
4244
KBUILD_AFLAGS += -gz=zstd
4345
KBUILD_LDFLAGS += --compress-debug-sections=zstd
4446
endif

0 commit comments

Comments
 (0)