Commit a8da847d by Nicolas Capens Committed by Nicolas Capens

Reactor: fix using -x86-asm-syntax only on x86 compilations

The LLVM JIT fails loudly when attempting to parse this command line option when targeting non-x86 CPUs. Bug: b/157555596 Change-Id: Ic5ddccbdbc86c2f03ded5f4004369ece0100c031 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52488 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent ff010f9f
......@@ -113,9 +113,7 @@ bool parseCommandLineOptionsOnce(int argc, const char *const *argv)
{
// Use a static immediately invoked lambda to make this thread safe
static auto initialized = [=]() {
llvm::cl::ParseCommandLineOptions(argc, argv);
return true;
return llvm::cl::ParseCommandLineOptions(argc, argv);
}();
return initialized;
......@@ -146,8 +144,10 @@ JITGlobals *JITGlobals::get()
static JITGlobals instance = [] {
const char *argv[] = {
"Reactor",
"-x86-asm-syntax", "intel", // Use Intel syntax rather than the default AT&T
"-warn-stack-size", "524288" // Warn when a function uses more than 512 KiB of stack memory
#if defined(__i386__) || defined(__x86_64__)
"-x86-asm-syntax=intel", // Use Intel syntax rather than the default AT&T
#endif
"-warn-stack-size=524288" // Warn when a function uses more than 512 KiB of stack memory
};
parseCommandLineOptionsOnce(sizeof(argv) / sizeof(argv[0]), argv);
......
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