{"record":{"id":"851242b932a50aa8","repo":"wasmerio/wasmer","slug":"target-not-yet-supported-in-wasmer","errorCode":null,"errorMessage":"target {} not yet supported in Wasmer","messagePattern":"target (.+?) not yet supported in Wasmer","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler-llvm/src/config.rs","lineNumber":337,"sourceCode":"            Architecture::Riscv64(_) => InkwellTarget::initialize_riscv(&InitializationConfig {\n                asm_parser: true,\n                asm_printer: true,\n                base: true,\n                disassembler: true,\n                info: true,\n                machine_code: true,\n            }),\n            Architecture::LoongArch64 => {\n                InkwellTarget::initialize_loongarch(&InitializationConfig {\n                    asm_parser: true,\n                    asm_printer: true,\n                    base: true,\n                    disassembler: true,\n                    info: true,\n                    machine_code: true,\n                })\n            }\n            _ => unimplemented!(\"target {} not yet supported in Wasmer\", triple),\n        }\n\n        // The CPU features formatted as LLVM strings\n        // We can safely map to gcc-like features as the CPUFeatures\n        // are compliant with the same string representations as gcc.\n        let llvm_cpu_features = cpu_features\n            .iter()\n            .map(|feature| format!(\"+{feature}\"))\n            .join(\",\");\n\n        let target_triple = self.target_triple(target);\n        let llvm_target = InkwellTarget::from_triple(&target_triple).unwrap();\n        let mut llvm_target_machine_options = TargetMachineOptions::new()\n            .set_cpu(match triple.architecture {\n                Architecture::Riscv64(_) => \"generic-rv64\",\n                Architecture::LoongArch64 => \"generic-la64\",\n                _ => \"generic\",\n            })","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-llvm/src/config.rs#L319-L355","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nmatch triple.architecture() {\n    Architecture::X86_64 => { ... }\n    Architecture::AmdGcn => { ... }\n    _ => unimplemented!(\"target {} not yet supported in Wasmer\", triple),\n}\n// after\nmatch triple.architecture() {\n    Architecture::X86_64 => { ... }\n    Architecture::Aarch64(_) => { ... }\n    other => return Err(CompileError::UnsupportedTarget(format!(\"{} not supported by LLVM backend\", other))),\n}","handlingStrategy":"validation","validationCode":"use wasmer_types::{Architecture, Triple};\nfn llvm_backend_supported(triple: &Triple) -> bool {\n    matches!(triple.architecture,\n        Architecture::X86_64 | Architecture::Aarch64(_) | Architecture::Riscv64(_))\n}\nlet engine = if llvm_backend_supported(&target.triple()) {\n    EngineBuilder::new(module).set_target(target.clone()).engine()\n} else {\n    // fall back to cranelift/singlepass\n    EngineBuilder::new(module).engine()\n};","typeGuard":"fn is_llvm_supported_arch(triple: &Triple) -> bool {\n    matches!(triple.architecture,\n        Architecture::X86_64 | Architecture::Aarch64(_) | Architecture::Riscv64(_))\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["rust","llvm","target-triple","unsupported-target"],"backgroundTag":"unsupported-target-triple","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}