From 43e5407d44d608dcc9d5ea665b0d3e72a02dc050 Mon Sep 17 00:00:00 2001 From: Go Murakami Date: Wed, 14 Sep 2022 03:15:56 +0900 Subject: [PATCH] Fix compile command for arm --- lib/cli-compiler/src/commands/compile.rs | 6 ++++-- lib/cli/src/commands/compile.rs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/cli-compiler/src/commands/compile.rs b/lib/cli-compiler/src/commands/compile.rs index 5f0d4286873..a5af2443c65 100644 --- a/lib/cli-compiler/src/commands/compile.rs +++ b/lib/cli-compiler/src/commands/compile.rs @@ -6,7 +6,7 @@ use std::path::{Path, PathBuf}; use wasmer_compiler::{ArtifactBuild, ArtifactCreate, ModuleEnvironment}; use wasmer_types::entity::PrimaryMap; use wasmer_types::{ - CompileError, CpuFeature, MemoryIndex, MemoryStyle, TableIndex, TableStyle, Target, Triple, + Architecture, CompileError, CpuFeature, MemoryIndex, MemoryStyle, TableIndex, TableStyle, Target, Triple, }; #[derive(Debug, Parser)] @@ -50,7 +50,9 @@ impl Compile { .fold(CpuFeature::set(), |a, b| a | b); // Cranelift requires SSE2, so we have this "hack" for now to facilitate // usage - features |= CpuFeature::SSE2; + if target_triple.architecture == Architecture::X86_64 { + features |= CpuFeature::SSE2; + } Target::new(target_triple.clone(), features) }) .unwrap_or_default(); diff --git a/lib/cli/src/commands/compile.rs b/lib/cli/src/commands/compile.rs index bc93aa3e3c7..d6be43411c9 100644 --- a/lib/cli/src/commands/compile.rs +++ b/lib/cli/src/commands/compile.rs @@ -46,7 +46,9 @@ impl Compile { .fold(CpuFeature::set(), |a, b| a | b); // Cranelift requires SSE2, so we have this "hack" for now to facilitate // usage - features |= CpuFeature::SSE2; + if target_triple.architecture == Architecture::X86_64 { + features |= CpuFeature::SSE2; + } Target::new(target_triple.clone(), features) }) .unwrap_or_default();