From 6398b068658b0d3d6ec7a33c833f0fa8c6001f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=BCtt?= Date: Thu, 19 Jan 2023 16:24:13 +0100 Subject: [PATCH] Enable set_target() again, but disable unwind info --- lib/cli/src/store.rs | 3 +-- lib/compiler-cranelift/src/translator/unwind.rs | 12 +++++++----- lib/compiler-singlepass/src/codegen.rs | 10 ++++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/cli/src/store.rs b/lib/cli/src/store.rs index e813cedd4ee..bf3e44123b4 100644 --- a/lib/cli/src/store.rs +++ b/lib/cli/src/store.rs @@ -119,8 +119,7 @@ impl CompilerOptions { let features = self.get_features(compiler_config.default_features_for_target(&target))?; let engine: Engine = wasmer_compiler::EngineBuilder::new(compiler_config) .set_features(Some(features)) - // https://github.com/wasmerio/wasmer/issues/3508 - // .set_target(Some(target)) + .set_target(Some(target)) .engine(); Ok(engine) diff --git a/lib/compiler-cranelift/src/translator/unwind.rs b/lib/compiler-cranelift/src/translator/unwind.rs index 1aff474ddce..a9627c05f41 100644 --- a/lib/compiler-cranelift/src/translator/unwind.rs +++ b/lib/compiler-cranelift/src/translator/unwind.rs @@ -47,11 +47,13 @@ pub(crate) fn compiled_function_unwind_info( .map_err(|error| CompileError::Codegen(pretty_error(&context.func, error)))?; match unwind_info { - Some(UnwindInfo::WindowsX64(unwind)) => { - let size = unwind.emit_size(); - let mut data: Vec = vec![0; size]; - unwind.emit(&mut data[..]); - Ok(CraneliftUnwindInfo::WindowsX64(data)) + Some(UnwindInfo::WindowsX64(_unwind)) => { + // https://github.com/wasmerio/wasmer/issues/3508 + Ok(CraneliftUnwindInfo::None) + // let size = unwind.emit_size(); + // let mut data: Vec = vec![0; size]; + // unwind.emit(&mut data[..]); + // Ok(CraneliftUnwindInfo::WindowsX64(data)) } Some(UnwindInfo::SystemV(unwind)) => Ok(CraneliftUnwindInfo::Fde(unwind)), Some(_) | None => Ok(CraneliftUnwindInfo::None), diff --git a/lib/compiler-singlepass/src/codegen.rs b/lib/compiler-singlepass/src/codegen.rs index 9b24e3be68f..1ec7b923938 100644 --- a/lib/compiler-singlepass/src/codegen.rs +++ b/lib/compiler-singlepass/src/codegen.rs @@ -6661,10 +6661,12 @@ impl<'a, M: Machine> FuncGen<'a, M> { } } CallingConvention::WindowsFastcall => { - let unwind = self.machine.gen_windows_unwind_info(body_len); - if let Some(unwind) = unwind { - unwind_info = Some(CompiledFunctionUnwindInfo::WindowsX64(unwind)); - } + // https://github.com/wasmerio/wasmer/issues/3508 + // + // let unwind = self.machine.gen_windows_unwind_info(body_len); + // if let Some(unwind) = unwind { + // unwind_info = Some(CompiledFunctionUnwindInfo::WindowsX64(unwind)); + // } } _ => (), };