Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: build/config/sanitizers/sanitizers.gni

Issue 1529993002: Enable Control Flow Integrity for the official Linux Chrome. Try 6. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/common.gypi ('k') | chrome/installer/linux/debian/expected_deps_x64 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 # Compile for fuzzing with Dr. Fuzz 50 # Compile for fuzzing with Dr. Fuzz
53 # See http://www.chromium.org/developers/testing/dr-fuzz 51 # See http://www.chromium.org/developers/testing/dr-fuzz
54 use_drfuzz = false 52 use_drfuzz = false
55 } 53 }
56 54
57 # Args that are in turn dependent on other args must be in a separate 55 # Args that are in turn dependent on other args must be in a separate
58 # declare_args block. User overrides are only applied at the end of a 56 # declare_args block. User overrides are only applied at the end of a
59 # declare_args block. 57 # declare_args block.
60 declare_args() { 58 declare_args() {
59 # Compile with Control Flow Integrity to protect virtual calls and casts.
60 # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
61 is_cfi = is_linux && !is_chromeos && target_cpu == "x64" &&
62 is_chrome_branded && is_official_build
63
61 # Use libc++ (buildtools/third_party/libc++ and 64 # Use libc++ (buildtools/third_party/libc++ and
62 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library. 65 # buildtools/third_party/libc++abi) instead of stdlibc++ as standard library.
63 # This is intended to be used for instrumented builds. 66 # This is intended to be used for instrumented builds.
64 use_custom_libcxx = 67 use_custom_libcxx =
65 (is_asan && is_linux) || is_tsan || is_msan || is_ubsan || use_libfuzzer 68 (is_asan && is_linux) || is_tsan || is_msan || is_ubsan || use_libfuzzer
66 69
67 use_sanitizer_coverage = use_libfuzzer 70 use_sanitizer_coverage = use_libfuzzer
68 } 71 }
69 72
70 using_sanitizer = 73 using_sanitizer =
(...skipping 14 matching lines...) Expand all
85 # without having people accidentally get broken builds by compiling an 88 # without having people accidentally get broken builds by compiling an
86 # unsupported or unadvisable configurations. 89 # unsupported or unadvisable configurations.
87 # 90 #
88 # For one-off testing, just comment this assertion out. 91 # For one-off testing, just comment this assertion out.
89 assert( 92 assert(
90 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr), 93 !is_debug || !(is_msan || is_lsan || is_tsan || is_ubsan || is_ubsan_vptr),
91 "Sanitizers should generally be used in release (set is_debug=false).") 94 "Sanitizers should generally be used in release (set is_debug=false).")
92 95
93 assert(!(is_android && is_asan && !is_component_build), 96 assert(!(is_android && is_asan && !is_component_build),
94 "is_asan on Android requires is_component_build to be set") 97 "is_asan on Android requires is_component_build to be set")
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | chrome/installer/linux/debian/expected_deps_x64 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698