Fix compile command for arm

This commit is contained in:
Go Murakami
2022-09-14 03:15:56 +09:00
parent 3225852547
commit 26848ef439
2 changed files with 8 additions and 3 deletions

View File

@@ -6,7 +6,8 @@ use std::path::{Path, PathBuf};
use wasmer_compiler::{ArtifactBuild, ArtifactCreate, ModuleEnvironment}; use wasmer_compiler::{ArtifactBuild, ArtifactCreate, ModuleEnvironment};
use wasmer_types::entity::PrimaryMap; use wasmer_types::entity::PrimaryMap;
use wasmer_types::{ use wasmer_types::{
CompileError, CpuFeature, MemoryIndex, MemoryStyle, TableIndex, TableStyle, Target, Triple, Architecture, CompileError, CpuFeature, MemoryIndex, MemoryStyle, TableIndex, TableStyle,
Target, Triple,
}; };
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
@@ -50,7 +51,9 @@ impl Compile {
.fold(CpuFeature::set(), |a, b| a | b); .fold(CpuFeature::set(), |a, b| a | b);
// Cranelift requires SSE2, so we have this "hack" for now to facilitate // Cranelift requires SSE2, so we have this "hack" for now to facilitate
// usage // usage
features |= CpuFeature::SSE2; if target_triple.architecture == Architecture::X86_64 {
features |= CpuFeature::SSE2;
}
Target::new(target_triple.clone(), features) Target::new(target_triple.clone(), features)
}) })
.unwrap_or_default(); .unwrap_or_default();

View File

@@ -46,7 +46,9 @@ impl Compile {
.fold(CpuFeature::set(), |a, b| a | b); .fold(CpuFeature::set(), |a, b| a | b);
// Cranelift requires SSE2, so we have this "hack" for now to facilitate // Cranelift requires SSE2, so we have this "hack" for now to facilitate
// usage // usage
features |= CpuFeature::SSE2; if target_triple.architecture == Architecture::X86_64 {
features |= CpuFeature::SSE2;
}
Target::new(target_triple.clone(), features) Target::new(target_triple.clone(), features)
}) })
.unwrap_or_default(); .unwrap_or_default();