diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /security/nss/coreconf/sanitizers.py | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/nss/coreconf/sanitizers.py')
-rw-r--r-- | security/nss/coreconf/sanitizers.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/security/nss/coreconf/sanitizers.py b/security/nss/coreconf/sanitizers.py new file mode 100644 index 0000000000..48fd148c45 --- /dev/null +++ b/security/nss/coreconf/sanitizers.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python2 + +from __future__ import print_function +import sys + +def main(): + if len(sys.argv) < 2: + raise Exception('Specify either "asan", "fuzzer", "msan", "sancov", "sourcecov" or "ubsan" as argument.') + + sanitizer = sys.argv[1] + if sanitizer == "ubsan": + if len(sys.argv) < 3: + raise Exception('ubsan requires another argument.') + print('-fsanitize='+sys.argv[2]+' -fno-sanitize-recover='+sys.argv[2] + ' ', end='') + print('-fno-sanitize=nonnull-attribute -fno-sanitize=enum ', end='') + return + if sanitizer == "asan": + print('-fsanitize=address -fsanitize-address-use-after-scope ', end='') + print('-fno-omit-frame-pointer -fno-optimize-sibling-calls ', end='') + return + if sanitizer == "msan": + print('-fsanitize=memory -fsanitize-memory-track-origins ', end='') + print('-fno-omit-frame-pointer -fno-optimize-sibling-calls ', end='') + return + if sanitizer == "sancov": + if len(sys.argv) < 3: + raise Exception('sancov requires another argument (edge|bb|func).') + print('-fsanitize-coverage='+sys.argv[2]+' ', end='') + return + if sanitizer == "sourcecov": + print('-fprofile-instr-generate -fcoverage-mapping', end='') + return + if sanitizer == "fuzzer": + print('-fsanitize=fuzzer-no-link ', end='') + return + + raise Exception('Specify either "asan", "fuzzer", "msan", "sancov", "sourcecov" or "ubsan" as argument.') + +if __name__ == '__main__': + main() |