wasmerio/wasmer · error
target {} not yet supported in Wasmer
Error message
target {} not yet supported in Wasmer What it means
Wasmer's LLVM backend builds an llvm::TargetMachine per target triple and only maps a fixed set of architectures (e.g. x86_64, aarch64, riscv64); any other triple reaches this unimplemented!() panic in target_machine_with_opt.
Source
Thrown at lib/compiler-llvm/src/config.rs:337
Architecture::Riscv64(_) => InkwellTarget::initialize_riscv(&InitializationConfig {
asm_parser: true,
asm_printer: true,
base: true,
disassembler: true,
info: true,
machine_code: true,
}),
Architecture::LoongArch64 => {
InkwellTarget::initialize_loongarch(&InitializationConfig {
asm_parser: true,
asm_printer: true,
base: true,
disassembler: true,
info: true,
machine_code: true,
})
}
_ => unimplemented!("target {} not yet supported in Wasmer", triple),
}
// The CPU features formatted as LLVM strings
// We can safely map to gcc-like features as the CPUFeatures
// are compliant with the same string representations as gcc.
let llvm_cpu_features = cpu_features
.iter()
.map(|feature| format!("+{feature}"))
.join(",");
let target_triple = self.target_triple(target);
let llvm_target = InkwellTarget::from_triple(&target_triple).unwrap();
let mut llvm_target_machine_options = TargetMachineOptions::new()
.set_cpu(match triple.architecture {
Architecture::Riscv64(_) => "generic-rv64",
Architecture::LoongArch64 => "generic-la64",
_ => "generic",
})View on GitHub (pinned to 8c4b9ee9d3)
Solutions
- Compile for a supported triple: x86_64, aarch64, or riscv64 (check the match arms in lib/compiler-llvm/src/config.rs)
- Use the singlepass or cranelift backend, which support more targets
- Verify the target with `wasmer compile --target` / EngineBuilder.target and correct a typo'd triple
- Add an arm mapping the new triple to LLVM TargetMachine options if you maintain a fork
Example fix
// before
match triple.architecture() {
Architecture::X86_64 => { ... }
Architecture::AmdGcn => { ... }
_ => unimplemented!("target {} not yet supported in Wasmer", triple),
}
// after
match triple.architecture() {
Architecture::X86_64 => { ... }
Architecture::Aarch64(_) => { ... }
other => return Err(CompileError::UnsupportedTarget(format!("{} not supported by LLVM backend", other))),
} Defensive patterns
Strategy: validation
Validate before calling
use wasmer_types::{Architecture, Triple};
fn llvm_backend_supported(triple: &Triple) -> bool {
matches!(triple.architecture,
Architecture::X86_64 | Architecture::Aarch64(_) | Architecture::Riscv64(_))
}
let engine = if llvm_backend_supported(&target.triple()) {
EngineBuilder::new(module).set_target(target.clone()).engine()
} else {
// fall back to cranelift/singlepass
EngineBuilder::new(module).engine()
}; Type guard
fn is_llvm_supported_arch(triple: &Triple) -> bool {
matches!(triple.architecture,
Architecture::X86_64 | Architecture::Aarch64(_) | Architecture::Riscv64(_))
} Prevention
- Check triple.architecture before selecting the LLVM backend
- Fall back to cranelift/singlepass for other architectures
- Avoid cross-compiling to exotic triples with the LLVM engine
- Run CI on all host architectures you deploy to, since host triple is auto-detected
When it happens
Trigger: Creating an LLVM engine with EngineBuilder/Engine::target set to a triple outside the supported set (e.g. s390x, armv7, mips), or failing to call `to_target`/setting an unsupported host triple when the host architecture itself is unsupported.
Common situations: Cross-compiling to an exotic target; running Wasmer with the LLVM engine on an unsupported host CPU (e.g. powerpc, s390x mainframes); CI images on non-x86_64/arm64 machines.
Related errors
- Unhandled inner case
- not a `sys` backend!
- Unsupported backend kind {v:?}
- unimplemented operator {operator:?}
- wasmer_env_set_memory() is not supported
AI-assisted analysis of wasmerio/wasmer@8c4b9ee9d3 (2026-09-01).
Data as JSON: /api/errors/851242b932a50aa8.
Report an issue: GitHub.