Skip to content

Commit

Permalink
refactor: use modern way to strip symbols from WASM (#6852)
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad authored May 20, 2022
1 parent e3c9bf8 commit 1eed163
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/near-test-contracts/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn build_contract(dir: &str, args: &[&str], output: &str) -> Result<(), Error> {

fn cargo_build_cmd(target_dir: &Path) -> Command {
let mut res = Command::new("cargo");
res.env("RUSTFLAGS", "-C link-arg=-s");
res.env_remove("RUSTFLAGS");
res.env_remove("CARGO_ENCODED_RUSTFLAGS");
res.env("CARGO_TARGET_DIR", target_dir);
res.args(&["build", "--target=wasm32-unknown-unknown", "--release"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ crate-type = ["cdylib"]
codegen-units = 1
# Tell `rustc` to optimize for small code size.
opt-level = "z"
strip = true
lto = true
debug = false
panic = "abort"
Expand Down
1 change: 1 addition & 0 deletions runtime/near-test-contracts/test-contract-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ wee_alloc = { version = "0.4.5", default-features = false }
codegen-units = 1
# Tell `rustc` to optimize for small code size.
opt-level = "z"
strip = true
lto = true
debug = false
panic = "abort"
Expand Down

0 comments on commit 1eed163

Please sign in to comment.