Use include_bytes! so builtin hosts live in binary

This commit is contained in:
Richard Feldman 2022-11-21 22:30:34 -05:00
parent a90d9d465d
commit e97a5fe7f6
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
11 changed files with 72 additions and 65 deletions

View file

@ -100,9 +100,13 @@ fn build_wasm_test_host() {
let mut outfile = PathBuf::from(&out_dir).join(PLATFORM_FILENAME);
outfile.set_extension("wasm");
let builtins_host_file = tempfile::NamedTempFile::new().unwrap();
std::fs::write(builtins_host_file.path(), bitcode::HOST_WASM)
.expect("failed to write host builtins object to tempfile");
run_zig(&[
"wasm-ld",
&bitcode::get_builtins_wasm32_obj_path(),
builtins_host_file.path().to_str().unwrap(),
platform_path.to_str().unwrap(),
WASI_COMPILER_RT_PATH,
WASI_LIBC_PATH,