Skip to content

Commit

Permalink
kbuild: rust: use -Zdebuginfo-compression
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ Added note about zstd support in Rust-provided binaries. ]
Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda authored and sweettea committed Apr 3, 2024
1 parent 5bf2cc6 commit 7e2f775
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/Makefile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ endif

ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZLIB
DEBUG_CFLAGS += -gz=zlib
DEBUG_RUSTFLAGS += -Zdebuginfo-compression=zlib
KBUILD_AFLAGS += -gz=zlib
KBUILD_LDFLAGS += --compress-debug-sections=zlib
else ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZSTD
DEBUG_CFLAGS += -gz=zstd
DEBUG_RUSTFLAGS += -Zdebuginfo-compression=zstd
KBUILD_AFLAGS += -gz=zstd
KBUILD_LDFLAGS += --compress-debug-sections=zstd
endif
Expand Down

0 comments on commit 7e2f775

Please sign in to comment.