Skip to content

Commit

Permalink
Strip the RISC-V ELF binary
Browse files Browse the repository at this point in the history
Reduces the size of produced binaries by more than 2x.
  • Loading branch information
imikushin committed Nov 21, 2024
1 parent 911e59b commit e301b48
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/build/src/command/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ pub(crate) fn get_program_build_args(args: &BuildArgs) -> Vec<String> {
/// Rust flags for compilation of C libraries.
pub(crate) fn get_rust_compiler_flags(args: &BuildArgs) -> String {
let rust_flags =
["-C", "passes=loweratomic", "-C", "link-arg=-Ttext=0x00200800", "-C", "panic=abort"];
["-C", "passes=loweratomic", "-C", "link-arg=-Ttext=0x00200800", "-C", "panic=abort",
"-C", "strip=symbols", "-C", "opt-level=z"];
let rust_flags: Vec<_> =
rust_flags.into_iter().chain(args.rustflags.iter().map(String::as_str)).collect();
rust_flags.join("\x1f")
Expand Down

0 comments on commit e301b48

Please sign in to comment.