Status Update
Comments
ap...@google.com <ap...@google.com> #2
Branch: master
commit 84bc198202e5be2cb1c96f8c0cb21047c557a82a
Author: Nicolas Capens <capn@google.com>
Date: Tue Jun 15 21:44:31 2021
Disable -warn-stack-size for LLVM older than version 12
This command line option is getting replaced with a module attribute in
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:
Change-Id: I2edb0dc4df5d434540741bcb3007539311eb958a
Reviewed-on:
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Nicolas Capens <nicolascapens@google.com>
M src/Reactor/LLVMJIT.cpp
nd...@google.com <nd...@google.com> #3
ni...@google.com <ni...@google.com> #4
Thanks for the update, Nick. This will only be part of the LLVM 13 major release, right?
We may upgrade upstream SwiftShader to the LLVM 12 release (or 12.0.1) in the not too distant future, and it looks like we should still be using the -warn-stack-size
command line flag. In my previous change I was wrong to assume 12 hadn't been released yet, and the "older than version 12" description doesn't match the code. :-(
nd...@google.com <nd...@google.com> #5
Correct. Upstream LLVM patch has landed as commit 8ace12130526f450c822ca232d1f865b247d7434.
ap...@google.com <ap...@google.com> #6
Branch: master
commit f679fc179b9b478bf5f116026df9c8d483ab3c65
Author: Nicolas Capens <capn@google.com>
Date: Fri Jun 25 14:50:41 2021
Fix -warn-stack-size command line option for LLVM 12
The -warn-stack-size command line option won't be deprecated until the
LLVM 13 release.
This change also produces a compile-time error when LLVM 13+ is used so
we won't fail to notice that the the stack size checking functionality
has to be implemented using the per-function "warn-stack-size" attribute
introduced by
builds of LLVM use LLVM_MAJOR_VERSION=9999.
Bug:
Change-Id: I044d576a6dcd73354710783a7f7e042cb43254c5
Reviewed-on:
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
M src/Reactor/LLVMJIT.cpp
ni...@google.com <ni...@google.com> #7
I'm considering this fixed for now since it won't affect us until we upgrade to LLVM 13+, and there's a check in place so it won't regress unnoticed. No strict need to make use of the function attribute before the upgrade, since that will involve a bunch of work anyway. Patches welcome though!
ni...@google.com <ni...@google.com> #8
As part of
ap...@google.com <ap...@google.com> #9
Branch: master
commit c13f4b1db4593b2d6a2fec856737374f47100379
Author: Nicolas Capens <capn@google.com>
Date: Fri Feb 25 11:08:07 2022
Set the stack limit through a function attribute
Recent versions of LLVM control the stack size limit through a function
attribute.
Note that older versions of LLVM simply ignore this attribute so we
don't have to set it conditionally. The -warn-stack-size command line
option can be removed though once we use LLVM 13+ everywhere.
Bug:
Bug:
Change-Id: Ie5d18031c5cd13e1fb2703110974e4cf59458077
Reviewed-on:
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
M src/Reactor/LLVMReactor.cpp
M src/Reactor/LLVMJIT.cpp
Description
LLVM is replacing the global
-warn-stack-size=
command line option with a per-module attribute. cl/378880044 disabled our use of the former for builds that use a very recent LLVM revision. We need to make a compatible change upstream, and make use of the module attribute where available.(cf. b/174587935 where we'd like
-x86-asm-syntax
to also be made part of the API instead of a command line flag.)