Migrating code to object (from faerie) (#1848)

* Using the "object" library everywhere in wasmtime.
* scroll_derive
This commit is contained in:
Yury Delendik
2020-06-10 11:27:00 -05:00
committed by GitHub
parent 5d01603390
commit e5b81bbc28
13 changed files with 166 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
use anyhow::{anyhow, bail, Context as _, Result};
use faerie::Artifact;
use object::write::Object;
use target_lexicon::Triple;
use wasmtime::Strategy;
use wasmtime_debug::{emit_dwarf, read_debuginfo, write_debugsections};
@@ -21,9 +21,8 @@ pub fn compile_to_obj(
enable_simd: bool,
opt_level: wasmtime::OptLevel,
debug_info: bool,
artifact_name: String,
cache_config: &CacheConfig,
) -> Result<Artifact> {
) -> Result<Object> {
let isa_builder = match target {
Some(target) => native::lookup(target.clone())?,
None => native::builder(),
@@ -51,7 +50,7 @@ pub fn compile_to_obj(
let isa = isa_builder.finish(settings::Flags::new(flag_builder));
let mut obj = Artifact::new(isa.triple().clone(), artifact_name);
let mut obj = Object::new(isa.triple().binary_format, isa.triple().architecture);
// TODO: Expose the tunables as command-line flags.
let mut tunables = Tunables::default();