Bug 1736485 - Update sancov flag for rustc 1.57 r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D128917
This commit is contained in:
Jesse Schwartzentruber 2021-10-20 14:39:21 +00:00
Родитель caaaab493b
Коммит f3cfbdb6aa
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -95,7 +95,7 @@ ifdef LIBFUZZER
ifndef MOZ_TSAN
ifndef FUZZING_JS_FUZZILLI
# These options should match what is implicitly enabled for `clang -fsanitize=fuzzer`
# here: https://github.com/llvm/llvm-project/blob/release/8.x/clang/lib/Driver/SanitizerArgs.cpp#L354
# here: https://github.com/llvm/llvm-project/blob/release/13.x/clang/lib/Driver/SanitizerArgs.cpp#L422
#
# -sanitizer-coverage-inline-8bit-counters Increments 8-bit counter for every edge.
# -sanitizer-coverage-level=4 Enable coverage for all blocks, critical edges, and indirect calls.
@ -103,7 +103,14 @@ ifndef FUZZING_JS_FUZZILLI
# -sanitizer-coverage-pc-table Create a static PC table.
#
# In TSan builds, we must not pass any of these, because sanitizer coverage is incompatible with TSan.
rustflags_sancov += -Cpasses=sancov -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-trace-compares -Cllvm-args=-sanitizer-coverage-pc-table
#
# sancov legacy pass was removed in rustc 1.57 and replaced by sancov-module
ifeq (1,$(words $(filter 1.53.% 1.54.% 1.55.% 1.56.%,$(RUSTC_VERSION))))
rustflags_sancov += -Cpasses=sancov
else
rustflags_sancov += -Cpasses=sancov-module
endif
rustflags_sancov += -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-trace-compares -Cllvm-args=-sanitizer-coverage-pc-table
endif
endif
endif