use zig wasm-ld

This commit is contained in:
Folkert 2021-08-30 00:18:01 +02:00
parent b416e854ef
commit 2e91914443

View file

@ -366,9 +366,13 @@ pub fn helper_wasm<'a>(
use std::process::Command;
Command::new("/opt/wasi-sdk/bin/clang")
// Command::new("/opt/wasi-sdk/bin/clang")
/*
Command::new("zig")
.current_dir(dir_path)
.args(&[
"cc",
"/home/folkertdev/roc/wasm/libmain.a",
test_a_path.to_str().unwrap(),
"-target",
@ -377,12 +381,29 @@ pub fn helper_wasm<'a>(
test_wasm_path.to_str().unwrap(),
"--sysroot=/opt/wasi-sdk/share/wasi-sysroot/",
"-Xlinker", "--export-dynamic",
"-Xlinker", "--allow-undefined"
// "-Xlinker", "--allow-undefined"
// "--global-cache-dir",
// zig_global_cache_path.to_str().unwrap(),
])
.status()
.unwrap();
*/
Command::new("/home/folkertdev/Downloads/zig-linux-x86_64-0.9.0-dev.848+d5ef5da59/zig")
.current_dir(dir_path)
.args(&[
"wasm-ld",
"/home/folkertdev/roc/wasm/libmain.a",
"/home/folkertdev/roc/wasm/libc.a",
test_a_path.to_str().unwrap(),
"-o",
test_wasm_path.to_str().unwrap(),
"--export-dynamic",
"--allow-undefined",
"--no-entry",
])
.status()
.unwrap();
/*
Command::new("/home/folkertdev/Downloads/zig-linux-x86_64-0.9.0-dev.848+d5ef5da59/zig")