mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-15 17:11:03 +00:00
Merge pull request #40 from paritytech/skip-externalize
Skip externalization step
This commit is contained in:
+1
-11
@@ -71,9 +71,6 @@ fn main() {
|
|||||||
.arg(Arg::with_name("skip_optimization")
|
.arg(Arg::with_name("skip_optimization")
|
||||||
.help("Skip symbol optimization step producing final wasm")
|
.help("Skip symbol optimization step producing final wasm")
|
||||||
.long("skip-optimization"))
|
.long("skip-optimization"))
|
||||||
.arg(Arg::with_name("skip_externalize")
|
|
||||||
.help("Skip externalizer step producing final wasm")
|
|
||||||
.long("skip-externalize"))
|
|
||||||
.arg(Arg::with_name("runtime_type")
|
.arg(Arg::with_name("runtime_type")
|
||||||
.help("Injects RUNTIME_TYPE global export")
|
.help("Injects RUNTIME_TYPE global export")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
@@ -93,13 +90,6 @@ fn main() {
|
|||||||
|
|
||||||
let mut module = parity_wasm::deserialize_file(&path).unwrap();
|
let mut module = parity_wasm::deserialize_file(&path).unwrap();
|
||||||
|
|
||||||
if !matches.is_present("skip_externalize") {
|
|
||||||
module = wasm_utils::externalize(
|
|
||||||
module,
|
|
||||||
vec!["_free", "_malloc", "_memcpy", "_memset", "_memmove"],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(runtime_type) = matches.value_of("runtime_type") {
|
if let Some(runtime_type) = matches.value_of("runtime_type") {
|
||||||
let runtime_type: &[u8] = runtime_type.as_bytes();
|
let runtime_type: &[u8] = runtime_type.as_bytes();
|
||||||
if runtime_type.len() != 4 {
|
if runtime_type.len() != 4 {
|
||||||
@@ -145,7 +135,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn processes_cargo_output() {
|
fn processes_cargo_output() {
|
||||||
let tmp_dir = TempDir::new("target").expect("temp dir failed");
|
let tmp_dir = TempDir::new("target").expect("temp dir failed");
|
||||||
|
|
||||||
let target_path = tmp_dir.path().join("wasm32-unknown-emscripten").join("release");
|
let target_path = tmp_dir.path().join("wasm32-unknown-emscripten").join("release");
|
||||||
fs::create_dir_all(target_path.clone()).expect("create dir failed");
|
fs::create_dir_all(target_path.clone()).expect("create dir failed");
|
||||||
|
|||||||
Reference in New Issue
Block a user