1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[gn] Make ubsan errors fatal, as in cmake

Apparently ubsan errors are non-fatal by default. If you introduce UB
into LLVM and run the tests, if errors are not fatal, the test will
still produce the expected output and the tests will pass. In order to
make ubsan errors show up as test failures, they have to be made fatal.
Pass the -fno-sanitize-recover=all flag to make it so.

Differential Revision: https://reviews.llvm.org/D103298
This commit is contained in:
Reid Kleckner 2021-05-27 20:00:20 -07:00
parent a4add6ae20
commit c5daefddfe

View File

@ -298,7 +298,7 @@ config("compiler_defaults") {
if (use_ubsan) {
assert(is_clang && current_os == "linux",
"ubsan only supported on Linux/Clang")
cflags += [ "-fsanitize=undefined" ]
cflags += [ "-fsanitize=undefined", "-fno-sanitize-recover=all" ]
ldflags += [ "-fsanitize=undefined" ]
}