Skip to content

Commit

Permalink
Use a more targeted means of specifying link flags (bytecodealliance#71)
Browse files Browse the repository at this point in the history
* Use a more targeted means of specifying link flags

I had forgotten earlier that this could be done with build scripts so do
that in the adapter's build script rather than as auxiliary rust flags.

* Remove `.cargo/config.toml` file

This now only serves the purpose to enable bulk-memory which is
relatively minor. This removes the file for now and wasm features can
always be reenabled at a later date if file size is truly an issue.
  • Loading branch information
alexcrichton committed Jan 26, 2023
1 parent 710cc4c commit 556cea3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ fn main() {
"cargo:rustc-link-search=native={}",
out_dir.to_str().unwrap()
);

// Some specific flags to `wasm-ld` to inform the shape of this adapter.
// Notably we're importing memory from the main module and additionally our
// own module has no stack at all since it's specifically allocated at
// startup.
println!("cargo:rustc-link-arg=--import-memory");
println!("cargo:rustc-link-arg=-zstack-size=0");
}

/// This function will produce a wasm module which is itself an object file
Expand Down

0 comments on commit 556cea3

Please sign in to comment.