- StringRef MArch = "";
- StringRef MCPU = "";
- SmallVector<std::string, 1> MAttrs;
- Triple TT(M->getTargetTriple());
+ Triple TT;
+
+ // MCJIT can generate code for remote targets, but the old JIT and Interpreter
+ // must use the host architecture.
+ if (WhichEngine != EngineKind::Interpreter && M)
+ TT.setTriple(M->getTargetTriple());