|
1 | | -[target."x86_64-unknown-linux-gnu"] |
2 | | -# - On systems that do not use lld as the system linker (such as Solus) using lld directly saves about a second |
3 | | -# of build time for incremental compiles for building boulder (from 2.191s to 1.198s on my machine). |
4 | | -# - Compressing debug symbols with zstd shrinks the dev profile boulder binary from 206.03MB to 81.44MB, a 124.59MB |
5 | | -# or ~60% savings. It doesn't affect the binary size for packaging builds since we strip those, but the debug symbols |
6 | | -# are reduced in size from 113.16MB to 34.63MB. It adds about ~152ms to the build times which is less than we gained |
7 | | -# by switching to lld |
8 | | -# - The new symbol mangling format (https://doc.rust-lang.org/rustc/symbol-mangling/v0.html) improves the backtrace |
9 | | -# shown by RUST_BACKTRACE=1 and other debug utilities. It should also be helpful once we have ABI reports. Upstream |
10 | | -# hasn't switched to it yet by default due to stable distros not having new enough tools, but that doesn't matter for us |
| 1 | +# Having a way to detect on which system we are compiled means we can get |
| 2 | +# away with adding rustflags here that we know are present in the system |
| 3 | +# toolchain builds. |
| 4 | +# |
| 5 | +# We can set these extra flags via matching on a target cfg() expression. |
| 6 | +# |
| 7 | +# - On systems that do not use lld as the system linker (such as Solus) using |
| 8 | +# lld directly saves about a second of build time for incremental compiles |
| 9 | +# for building boulder (from 2.191s to 1.198s on Reilly's machine). |
| 10 | +# |
| 11 | +# - In testing, compression of debug symbols with zstd shrinks the dev profile |
| 12 | +# boulder binary from 206.03MB to 81.44MB, a 124.59MB or ~60% savings. |
| 13 | +# It doesn't affect the binary size for packaging builds since we strip those, |
| 14 | +# but the debug symbols are reduced in size from 113.16MB to 34.63MB. |
| 15 | +# It adds about ~152ms to the build times which is less than we gained by |
| 16 | +# switching to lld. This feature requires a compiler compiled with support |
| 17 | +# for zstd debug symbols. |
| 18 | +# |
| 19 | +# - The new symbol mangling format[1] improves the backtrace shown by |
| 20 | +# RUST_BACKTRACE=1 and other debug utilities. It should also be helpful once |
| 21 | +# we have ABI reports. Upstream hasn't switched to it yet by default due to |
| 22 | +# stable distros not having new enough tools, but that doesn't matter for us |
| 23 | +# [1]: https://doc.rust-lang.org/rustc/symbol-mangling/v0.html |
| 24 | +# |
| 25 | + |
| 26 | +# NB: os_release patterns need to be added to both target configs for this to |
| 27 | +# work... |
| 28 | +# |
| 29 | +# The Solus toolchain supports zstd debug sections currently (Serpent doesn't) |
| 30 | +[target.'cfg(any(os_release_id = "solus"))'] |
11 | 31 | rustflags = [ |
12 | 32 | "-Clink-arg=-fuse-ld=lld", |
13 | 33 | "-Clink-arg=-Wl,--compress-debug-sections=zstd", |
14 | 34 | "-Csymbol-mangling-version=v0", |
15 | 35 | ] |
16 | 36 |
|
17 | | -[target."aarch64-unknown-linux-gnu"] |
| 37 | +# Default flags |
| 38 | +[target.'cfg(not(any(os_release_id = "solus")))'] |
18 | 39 | rustflags = [ |
19 | 40 | "-Clink-arg=-fuse-ld=lld", |
20 | | - "-Clink-arg=-Wl,--compress-debug-sections=zstd", |
21 | 41 | "-Csymbol-mangling-version=v0", |
22 | 42 | ] |
0 commit comments