Fix fuzz and wasi-c builds (#447)
* Fix the wasmtime-wasi-c crate build and upgrade it to Rust 2018. * Fix the fuzz build.
This commit is contained in:
@@ -2,11 +2,8 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate libfuzzer_sys;
|
||||
extern crate cranelift_codegen;
|
||||
extern crate cranelift_native;
|
||||
extern crate wasmparser;
|
||||
extern crate wasmtime_environ;
|
||||
extern crate wasmtime_jit;
|
||||
extern crate alloc;
|
||||
extern crate core;
|
||||
|
||||
use alloc::rc::Rc;
|
||||
use core::cell::RefCell;
|
||||
|
||||
@@ -27,7 +27,7 @@ wasmparser = { version = "0.39.2", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["cranelift-codegen/std", "cranelift-wasm/std", "wasmtime-environ/std", "wasmtime-debug/std", "wasmparser/std"]
|
||||
std = ["cranelift-codegen/std", "cranelift-wasm/std", "wasmtime-environ/std", "wasmtime-debug/std", "wasmtime-runtime/std", "wasmparser/std"]
|
||||
core = ["hashbrown/nightly", "cranelift-codegen/core", "cranelift-wasm/core", "wasmtime-environ/core", "wasmtime-debug/core", "wasmparser/core"]
|
||||
lightbeam = ["wasmtime-environ/lightbeam"]
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ categories = ["wasm"]
|
||||
repository = "https://github.com/CraneStation/wasmtime"
|
||||
license = "Apache-2.0 WITH LLVM-exception"
|
||||
readme = "README.md"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
wasmtime-runtime = { path = "../wasmtime-runtime" }
|
||||
|
||||
@@ -2,6 +2,7 @@ use crate::host::{
|
||||
argv_environ_init, argv_environ_values, fd_prestats, fd_prestats_init, fd_prestats_insert,
|
||||
fd_table, fd_table_init, fd_table_insert_existing,
|
||||
};
|
||||
use crate::syscalls;
|
||||
use alloc::rc::Rc;
|
||||
use core::cell::RefCell;
|
||||
use cranelift_codegen::ir::types;
|
||||
@@ -13,7 +14,6 @@ use std::ffi::CString;
|
||||
use std::fs::File;
|
||||
use std::mem;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use syscalls;
|
||||
use target_lexicon::HOST;
|
||||
use wasmtime_environ::{translate_signature, Export, Module};
|
||||
use wasmtime_runtime::{Imports, InstanceHandle, InstantiationError, VMFunctionBody};
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
extern crate cranelift_codegen;
|
||||
extern crate cranelift_entity;
|
||||
extern crate cranelift_wasm;
|
||||
extern crate target_lexicon;
|
||||
extern crate wasmtime_environ;
|
||||
extern crate wasmtime_jit;
|
||||
extern crate wasmtime_runtime;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate alloc;
|
||||
extern crate core;
|
||||
|
||||
mod host;
|
||||
mod instantiate;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use crate::host;
|
||||
use crate::host::{argv_environ_values, fd_prestats, fd_table};
|
||||
use crate::instantiate::WASIState;
|
||||
use crate::translate::*;
|
||||
use crate::wasm32;
|
||||
use core::convert::TryFrom;
|
||||
use cranelift_codegen::ir::types::{Type, I32, I64};
|
||||
use host;
|
||||
use std::{mem, ptr, slice, str};
|
||||
use translate::*;
|
||||
use wasm32;
|
||||
use wasmtime_runtime::VMContext;
|
||||
|
||||
fn str_for_trace<'str>(ptr: *const i8, len: usize) -> Result<&'str str, str::Utf8Error> {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use crate::host;
|
||||
use crate::wasm32;
|
||||
use core::convert::TryFrom;
|
||||
use host;
|
||||
use std::mem::{align_of, size_of, zeroed};
|
||||
use std::slice;
|
||||
use wasm32;
|
||||
use wasmtime_runtime::{Export, VMContext};
|
||||
|
||||
/// Translate a wasm pointer into a native pointer.
|
||||
|
||||
Reference in New Issue
Block a user