OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import("//build/config/chrome_build.gni") |
| 6 |
5 declare_args() { | 7 declare_args() { |
6 # Compile for Address Sanitizer to find memory bugs. | 8 # Compile for Address Sanitizer to find memory bugs. |
7 is_asan = false | 9 is_asan = false |
8 | 10 |
9 # Compile for Leak Sanitizer to find leaks. | 11 # Compile for Leak Sanitizer to find leaks. |
10 is_lsan = false | 12 is_lsan = false |
11 | 13 |
12 # Compile for Memory Sanitizer to find uninitialized reads. | 14 # Compile for Memory Sanitizer to find uninitialized reads. |
13 is_msan = false | 15 is_msan = false |
14 | 16 |
(...skipping 15 matching lines...) Expand all Loading... |
30 # Use dynamic libraries instrumented by one of the sanitizers instead of the | 32 # Use dynamic libraries instrumented by one of the sanitizers instead of the |
31 # standard system libraries. Set this flag to download prebuilt binaries from | 33 # standard system libraries. Set this flag to download prebuilt binaries from |
32 # GCS. | 34 # GCS. |
33 use_prebuilt_instrumented_libraries = false | 35 use_prebuilt_instrumented_libraries = false |
34 | 36 |
35 # Enable building with SyzyAsan which can find certain types of memory | 37 # Enable building with SyzyAsan which can find certain types of memory |
36 # errors. Only works on Windows. See | 38 # errors. Only works on Windows. See |
37 # https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo | 39 # https://code.google.com/p/sawbuck/wiki/SyzyASanHowTo |
38 is_syzyasan = false | 40 is_syzyasan = false |
39 | 41 |
40 # Compile with Control Flow Integrity to protect virtual calls and casts. | |
41 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html | |
42 is_cfi = false | |
43 | |
44 # By default, Control Flow Integrity will crash the program if it detects a | 42 # By default, Control Flow Integrity will crash the program if it detects a |
45 # violation. Set this to true to print detailed diagnostics instead. | 43 # violation. Set this to true to print detailed diagnostics instead. |
46 use_cfi_diag = false | 44 use_cfi_diag = false |
47 | 45 |
48 # Compile for fuzzing with LLVM LibFuzzer. | 46 # Compile for fuzzing with LLVM LibFuzzer. |
49 # See http://www.chromium.org/developers/testing/libfuzzer | 47 # See http://www.chromium.org/developers/testing/libfuzzer |
50 use_libfuzzer = false | 48 use_libfuzzer = false |
51 } | 49 } |
52 | 50 |
53 # Args that are in turn dependent on other args must be in a separate | 51 # Args that are in turn dependent on other args must be in a separate |
54 # declare_args block. User overrides are only applied at the end of a | 52 # declare_args block. User overrides are only applied at the end of a |
55 # declare_args block. | 53 # declare_args block. |
56 declare_args() { | 54 declare_args() { |
| 55 # Compile with Control Flow Integrity to protect virtual calls and casts. |
| 56 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html |
| 57 is_cfi = is_linux && !is_chromeos && target_cpu == "x64" && |
| 58 is_chrome_branded && is_official_build |
| 59 |
57 # Use libc++ (buildtools/third_party/libc++ and | 60 # Use libc++ (buildtools/third_party/libc++ and |
58 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. | 61 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. |
59 # This is intended to be used for instrumented builds. | 62 # This is intended to be used for instrumented builds. |
60 use_custom_libcxx = | 63 use_custom_libcxx = |
61 (is_asan && is_linux) || is_tsan || is_msan || is_ubsan || use_libfuzzer | 64 (is_asan && is_linux) || is_tsan || is_msan || is_ubsan || use_libfuzzer |
62 | 65 |
63 use_sanitizer_coverage = use_libfuzzer | 66 use_sanitizer_coverage = use_libfuzzer |
64 } | 67 } |
65 | 68 |
66 using_sanitizer = | 69 using_sanitizer = |
(...skipping 14 matching lines...) Expand all Loading... |
81 # without having people accidentally get broken builds by compiling an | 84 # without having people accidentally get broken builds by compiling an |
82 # unsupported or unadvisable configurations. | 85 # unsupported or unadvisable configurations. |
83 # | 86 # |
84 # For one-off testing, just comment this assertion out. | 87 # For one-off testing, just comment this assertion out. |
85 assert( | 88 assert( |
86 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), | 89 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), |
87 "Sanitizers should generally be used in release (set is_debug=false).") | 90 "Sanitizers should generally be used in release (set is_debug=false).") |
88 | 91 |
89 assert(!(is_android && is_asan && !is_component_build), | 92 assert(!(is_android && is_asan && !is_component_build), |
90 "is_asan on Android requires is_component_build to be set") | 93 "is_asan on Android requires is_component_build to be set") |
OLD | NEW |