1# Copyright (C) 2017 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15declare_args() { 16 # Address Sanitizer: memory bugs (e.g., UAF). 17 is_asan = false 18 19 # Leak Sanitizer: memory leaks. 20 is_lsan = false 21 22 # Memory Sanitizer: uninitialized reads. 23 is_msan = false 24 25 # Thread Sanitizer: threading bugs. 26 is_tsan = false 27 28 # Undefined Behaviour Sanitizer. 29 is_ubsan = false 30 31 # # Compile for fuzzing with LLVM LibFuzzer. 32 use_libfuzzer = false 33} 34 35declare_args() { 36 using_sanitizer = 37 is_asan || is_lsan || is_tsan || is_msan || is_ubsan || use_libfuzzer 38} 39 40assert(!using_sanitizer || is_clang, "is_*san requires is_clang=true'") 41assert(!is_msan || is_linux, "msan only supported on linux") 42assert(!is_tsan || (is_linux || is_mac), "tsan only supported on linux and mac") 43