Disable -warn-stack-size for LLVM older than version 12

This command line option is getting replaced with a module attribute in https://reviews.llvm.org/D103928. Temporarily disable it for LLVM versions newer than 11. Once LLVM 12 is released we should be able to use the attribute instead to retain this functionality. Note that upstream SwiftShader still uses LLVM 10, and the primary usage of this functionality is to prevent stack overflow in Chrome's fuzzers, which is not affected by this temporary change. Bug: b/191193823 Change-Id: I2edb0dc4df5d434540741bcb3007539311eb958a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54968 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
parent 72e6254a
...@@ -151,7 +151,11 @@ JITGlobals *JITGlobals::get() ...@@ -151,7 +151,11 @@ JITGlobals *JITGlobals::get()
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
"-x86-asm-syntax=intel", // Use Intel syntax rather than the default AT&T "-x86-asm-syntax=intel", // Use Intel syntax rather than the default AT&T
#endif #endif
// TODO(b/191193823): TODO(ndesaulniers): Update this after
// go/compilers/fc018ebb608ee0c1239b405460e49f1835ab6175
#if LLVM_VERSION_MAJOR <= 11
"-warn-stack-size=524288" // Warn when a function uses more than 512 KiB of stack memory "-warn-stack-size=524288" // Warn when a function uses more than 512 KiB of stack memory
#endif
}; };
parseCommandLineOptionsOnce(sizeof(argv) / sizeof(argv[0]), argv); 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