stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Stripping debug symbols

Open wileyj opened this issue 2 months ago • 2 comments

simple example for the glibc x64 variant of stacks-signer:

$ file stacks-signer 
stacks-signer: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=c5a71433c4638643612e9aa4c1efb7cdb4e4151f, with debug_info, not stripped
$ ls -alh
total 130M
drwxr-xr-x 2 wileyj wileyj 4.0K Nov 12 12:49 .
drwxr-xr-x 7 wileyj wileyj 4.0K Nov 12 12:39 ..
-rwxr-xr-x 1 wileyj wileyj 130M Nov 12 10:13 stacks-signer
$ strip --strip-debug stacks-signer 
$ file stacks-signer 
stacks-signer: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=c5a71433c4638643612e9aa4c1efb7cdb4e4151f, not stripped
$ ls -alh
total 17M
drwxr-xr-x 2 wileyj wileyj 4.0K Nov 12 12:50 .
drwxr-xr-x 7 wileyj wileyj 4.0K Nov 12 12:39 ..
-rwxr-xr-x 1 wileyj wileyj  17M Nov 12 12:50 stacks-signer

which is an 86% decrease in binary size.

wileyj avatar Nov 12 '25 21:11 wileyj

https://doc.rust-lang.org/cargo/reference/profiles.html#split-debuginfo

wileyj avatar Nov 12 '25 21:11 wileyj

note: grafana pyroscope and possibly some other tools used via docker would need the symbols

wileyj avatar Nov 12 '25 21:11 wileyj