| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 if (current_cpu == "arm") { | 7 if (current_cpu == "arm") { |
| 8 import("//build/config/arm.gni") | 8 import("//build/config/arm.gni") |
| 9 } | 9 } |
| 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 # http://gcc.gnu.org/wiki/DebugFission | 49 # http://gcc.gnu.org/wiki/DebugFission |
| 50 use_debug_fission = | 50 use_debug_fission = |
| 51 !is_win && use_gold && linux_use_bundled_binutils && !use_ccache | 51 !is_win && use_gold && linux_use_bundled_binutils && !use_ccache |
| 52 | 52 |
| 53 if (is_win) { | 53 if (is_win) { |
| 54 # Whether the VS xtree header has been patched to disable warning 4702. If | 54 # Whether the VS xtree header has been patched to disable warning 4702. If |
| 55 # it has, then we don't need to disable 4702 (unreachable code warning). | 55 # it has, then we don't need to disable 4702 (unreachable code warning). |
| 56 # The patch is preapplied to the internal toolchain and hence all bots. | 56 # The patch is preapplied to the internal toolchain and hence all bots. |
| 57 msvs_xtree_patched = false | 57 msvs_xtree_patched = false |
| 58 } | 58 } |
| 59 |
| 60 # Track where uninitialized memory originates from. From fastest to slowest: |
| 61 # 0 - no tracking, 1 - track only the initial allocation site, 2 - track the |
| 62 # chain of stores leading from allocation site to use site. |
| 63 msan_track_origins = 2 |
| 59 } | 64 } |
| 60 | 65 |
| 61 # default_include_dirs --------------------------------------------------------- | 66 # default_include_dirs --------------------------------------------------------- |
| 62 # | 67 # |
| 63 # This is a separate config so that third_party code (which would not use the | 68 # This is a separate config so that third_party code (which would not use the |
| 64 # source root and might have conflicting versions of some headers) can remove | 69 # source root and might have conflicting versions of some headers) can remove |
| 65 # this and specify their own include paths. | 70 # this and specify their own include paths. |
| 66 config("default_include_dirs") { | 71 config("default_include_dirs") { |
| 67 include_dirs = [ | 72 include_dirs = [ |
| 68 "//", | 73 "//", |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 137 |
| 133 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and | 138 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and |
| 134 # MemorySanitizer | 139 # MemorySanitizer |
| 135 if (using_sanitizer) { | 140 if (using_sanitizer) { |
| 136 cflags += [ | 141 cflags += [ |
| 137 "-fno-omit-frame-pointer", | 142 "-fno-omit-frame-pointer", |
| 138 "-gline-tables-only", | 143 "-gline-tables-only", |
| 139 ] | 144 ] |
| 140 } | 145 } |
| 141 if (is_asan) { | 146 if (is_asan) { |
| 142 cflags += [ "-fsanitize=address" ] | 147 asan_blacklist_path = |
| 148 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) |
| 149 cflags += [ |
| 150 "-fsanitize=address", |
| 151 "-fsanitize-blacklist=$asan_blacklist_path", |
| 152 ] |
| 143 if (is_mac) { | 153 if (is_mac) { |
| 144 cflags += [ "-mllvm -asan-globals=0" ] # http://crbug.com/352073 | 154 cflags += [ "-mllvm -asan-globals=0" ] # http://crbug.com/352073 |
| 145 # TODO(GYP): deal with mac_bundles. | 155 # TODO(GYP): deal with mac_bundles. |
| 146 } | 156 } |
| 147 } | 157 } |
| 158 if (is_lsan) { |
| 159 cflags += [ "-fsanitize=leak" ] |
| 160 } |
| 161 if (is_tsan) { |
| 162 tsan_blacklist_path = |
| 163 rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir) |
| 164 cflags += [ |
| 165 "-fsanitize=thread", |
| 166 "-fsanitize-blacklist=$tsan_blacklist_path", |
| 167 ] |
| 168 } |
| 169 if (is_msan) { |
| 170 msan_blacklist_path = |
| 171 rebase_path("//tools/msan/blacklist.txt", root_build_dir) |
| 172 cflags += [ |
| 173 "-fsanitize=memory", |
| 174 "-fsanitize-memory-track-origins=$msan_track_origins", |
| 175 "-fsanitize-blacklist=$msan_blacklist_path", |
| 176 ] |
| 177 |
| 178 # TODO(GYP): Support instrumented libraries and custom libc++. |
| 179 } |
| 148 } | 180 } |
| 149 | 181 |
| 150 if (is_clang && is_debug) { | 182 if (is_clang && is_debug) { |
| 151 # Allow comparing the address of references and 'this' against 0 | 183 # Allow comparing the address of references and 'this' against 0 |
| 152 # in debug builds. Technically, these can never be null in | 184 # in debug builds. Technically, these can never be null in |
| 153 # well-defined C/C++ and Clang can optimize such checks away in | 185 # well-defined C/C++ and Clang can optimize such checks away in |
| 154 # release builds, but they may be used in asserts in debug builds. | 186 # release builds, but they may be used in asserts in debug builds. |
| 155 cflags_cc += [ | 187 cflags_cc += [ |
| 156 "-Wno-undefined-bool-conversion", | 188 "-Wno-undefined-bool-conversion", |
| 157 "-Wno-tautological-undefined-compare", | 189 "-Wno-tautological-undefined-compare", |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 cflags += [ "-gsplit-dwarf" ] | 1137 cflags += [ "-gsplit-dwarf" ] |
| 1106 } | 1138 } |
| 1107 } | 1139 } |
| 1108 } | 1140 } |
| 1109 | 1141 |
| 1110 config("no_symbols") { | 1142 config("no_symbols") { |
| 1111 if (!is_win) { | 1143 if (!is_win) { |
| 1112 cflags = [ "-g0" ] | 1144 cflags = [ "-g0" ] |
| 1113 } | 1145 } |
| 1114 } | 1146 } |
| OLD | NEW |