[clang] [llvm] lli: Record the host triple on triple-less modules (PR #216132)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 04:06:44 PDT 2026


================
@@ -1107,13 +1107,22 @@ std::string LLJIT::mangle(StringRef UnmangledName) const {
   return MangledName;
 }
 
-Error LLJIT::applyDataLayout(Module &M) {
+Error LLJIT::applyTargetConfig(Module &M) {
+  if (M.getTargetTriple().empty()) {
+    M.setTargetTriple(TT);
+  } else if (!M.getTargetTriple().isCompatibleWith(TT)) {
+    return make_error<StringError>("added module has an incompatible triple: " +
+                                       M.getTargetTriple().str() +
+                                       " (module) vs " + TT.str() + " (jit)",
+                                   inconvertibleErrorCode());
+  }
----------------
lhames wrote:

This error should be removed: some LLJIT clients do use lli and llvm-jitlink to cross-execute Linux objects on Darwin and vice versa. We could consider locking this down, but it would be a separate discussion.

https://github.com/llvm/llvm-project/pull/216132


More information about the llvm-commits mailing list