Commit 959f4198 by Nicolas Capens Committed by Nicolas Capens

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: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent eaf1c535
...@@ -597,6 +597,7 @@ JITBuilder::JITBuilder(const rr::Config &config) ...@@ -597,6 +597,7 @@ JITBuilder::JITBuilder(const rr::Config &config)
, module(new llvm::Module("", context)) , module(new llvm::Module("", context))
, builder(new llvm::IRBuilder<>(context)) , builder(new llvm::IRBuilder<>(context))
{ {
module->setTargetTriple(LLVM_DEFAULT_TARGET_TRIPLE);
module->setDataLayout(JITGlobals::get()->getDataLayout()); module->setDataLayout(JITGlobals::get()->getDataLayout());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment