Remove C++ dependency from wasmtime (#1365)

* Remove C++ dependency from `wasmtime`

This commit removes the last wads of C++ that we have in wasmtime,
meaning that building wasmtime no longer requires a C++ compiler. It
still does require a C toolchain for some minor purposes, but hopefully
we can remove that over time too!

The motivation for doing this is to consolidate all our signal-handling
code into one location in one language so you don't have to keep
crossing back and forth when understanding what's going on. This also
allows us to remove some extra cruft that wasn't necessary from the C++
original implementation. Additionally this should also make building
wasmtime a bit more portable since it's often easier to acquire a C
toolchain than it is to acquire a C++ toolchain. (e.g. if you're
cross-compiling to a musl target)

* Typos
This commit is contained in:
Alex Crichton
2020-03-20 15:21:42 -05:00
committed by GitHub
parent c50c24e699
commit f700efeb03
9 changed files with 260 additions and 879 deletions

View File

@@ -6,8 +6,8 @@ use crate::export::Export;
use crate::imports::Imports;
use crate::jit_int::GdbJitImageRegistration;
use crate::memory::LinearMemory;
use crate::signalhandlers;
use crate::table::Table;
use crate::traphandlers;
use crate::traphandlers::{catch_traps, Trap};
use crate::vmcontext::{
VMBuiltinFunctionsArray, VMCallerCheckedAnyfunc, VMContext, VMFunctionBody, VMFunctionImport,
@@ -980,7 +980,7 @@ impl InstanceHandle {
// Ensure that our signal handlers are ready for action.
// TODO: Move these calls out of `InstanceHandle`.
signalhandlers::init();
traphandlers::init();
// The WebAssembly spec specifies that the start function is
// invoked automatically at instantiation time.