summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-04-14 12:32:32 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-04-19 11:31:00 +0100
commit2211f8d5595becd1fb58e3018e365fc103fdac88 (patch)
tree10dff3ed569bd265cfce76046b30251272ddad8f
parent9aa23b11e4a25cd94cb48de74c580675577fa074 (diff)
gallivm: Use LLVMSetTarget.
Instead of LLVM C++ interfaces. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index c1e262bc1e..77069efda3 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -518,10 +518,16 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
#ifdef _WIN32
/*
* MCJIT works on Windows, but currently only through ELF object format.
+ *
+ * XXX: We could use `LLVM_HOST_TRIPLE "-elf"` but LLVM_HOST_TRIPLE has
+ * different strings for MinGW/MSVC, so better play it safe and be
+ * explicit.
*/
- std::string targetTriple = llvm::sys::getProcessTriple();
- targetTriple.append("-elf");
- unwrap(M)->setTargetTriple(targetTriple);
+# ifdef _WIN64
+ LLVMSetTarget(M, "x86_64-pc-win32-elf");
+# else
+ LLVMSetTarget(M, "i686-pc-win32-elf");
+# endif
#endif
}