From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- security/nss/coreconf/sanitizers.py | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 security/nss/coreconf/sanitizers.py (limited to 'security/nss/coreconf/sanitizers.py') 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() -- cgit v1.2.3