From a806f9dc441b969424b35e916e7f6ae5e4dc81c7 Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Fri, 13 Oct 2023 20:01:15 +0000 Subject: [PATCH] Use zstd to compress debug info in rust libraries We can save a significant amount of disk space by compressing debug info in rust builds. This adds a flag that configures compressing debug info at the link stage for rust binaries. Test: m Bug: 305277519 Change-Id: Ia85d8dc0e7bea35d9f9abfeae27a4610b3113e78 --- rust/config/global.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/config/global.go b/rust/config/global.go index b94d92fd9..4d31121e5 100644 --- a/rust/config/global.go +++ b/rust/config/global.go @@ -65,6 +65,7 @@ var ( "-lpthread", "-lm", "-lgcc_s", + "-Wl,--compress-debug-sections=zstd", } deviceGlobalRustFlags = []string{ @@ -86,6 +87,7 @@ var ( "-Wl,--use-android-relr-tags", "-Wl,--no-undefined", "-B${cc_config.ClangBin}", + "-Wl,--compress-debug-sections=zstd", } )