Set the LLVM module's target triple

The target triple is used by MemorySanitizer to determine where to map
the shadow and origin data, which is OS specific. When not set, the
MemorySanitizer::initializeModule() method, which inserts an __msan_init
call to the module's constructor list, produces an
"unsupported operating system" error.

Note that JITs like Reactor have no use for a module constructor list
(__msan_init gets called during executable startup), but there is
currently no way to skip this initialization. Leaving it unused is fine
though. Likewise, setting the target triple has not other known JIT uses
at the moment, but it can't hurt.

Bug: b/155148722
Change-Id: Ia31d8c71ee495aadd91530a8d1c5fdc93add8e01
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49853
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Reactor/LLVMJIT.cpp b/src/Reactor/LLVMJIT.cpp
index 9912b41..19659fe 100644
--- a/src/Reactor/LLVMJIT.cpp
+++ b/src/Reactor/LLVMJIT.cpp
@@ -597,6 +597,7 @@
     , module(new llvm::Module("", context))
     , builder(new llvm::IRBuilder<>(context))
 {
+	module->setTargetTriple(LLVM_DEFAULT_TARGET_TRIPLE);
 	module->setDataLayout(JITGlobals::get()->getDataLayout());
 }