Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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") | 5 import("//build/config/chrome_build.gni") |
| 6 import("//build/config/chromecast_build.gni") | 6 import("//build/config/chromecast_build.gni") |
| 7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
| 8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
| 9 | 9 |
| 10 # Contains the dependencies needed for sanitizers to link into executables and | 10 # Contains the dependencies needed for sanitizers to link into executables and |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 group("deps_no_options") { | 32 group("deps_no_options") { |
| 33 if (using_sanitizer) { | 33 if (using_sanitizer) { |
| 34 public_configs = [ | 34 public_configs = [ |
| 35 # Even when a target removes default_sanitizer_flags, it may be depending | 35 # Even when a target removes default_sanitizer_flags, it may be depending |
| 36 # on a library that did not remove default_sanitizer_flags. Thus, we need | 36 # on a library that did not remove default_sanitizer_flags. Thus, we need |
| 37 # to add the ldflags here as well as in default_sanitizer_flags. | 37 # to add the ldflags here as well as in default_sanitizer_flags. |
| 38 ":default_sanitizer_ldflags", | 38 ":default_sanitizer_ldflags", |
| 39 ] | 39 ] |
| 40 deps = [] | 40 deps = [] |
| 41 | |
| 42 data = [ | |
| 43 "//tools/valgrind/asan/", | |
| 44 ] | |
| 45 if (is_win) { | |
| 46 exe = ".exe" | |
| 47 } else { | |
| 48 exe = "" | |
| 49 } | |
| 50 data += [ "//third_party//llvm-build/Release+Asserts/bin/llvm-symbolizer${ex e}" ] | |
| 51 if (is_linux) { | |
| 52 data += [ "//third_party/llvm-build/Release+Asserts/lib/libstdc++.so.6" ] | |
|
Nico
2016/06/02 18:16:41
Can you add a comment here that says that this is
Dirk Pranke
2016/06/02 18:47:08
Sure.
| |
| 53 } | |
| 54 | |
| 41 if (use_prebuilt_instrumented_libraries) { | 55 if (use_prebuilt_instrumented_libraries) { |
| 42 deps += [ "//third_party/instrumented_libraries:deps" ] | 56 deps += [ "//third_party/instrumented_libraries:deps" ] |
| 43 } | 57 } |
| 44 if (use_custom_libcxx) { | 58 if (use_custom_libcxx) { |
| 45 public_deps = [ | 59 public_deps = [ |
| 46 "//buildtools/third_party/libc++:libcxx_proxy", | 60 "//buildtools/third_party/libc++:libcxx_proxy", |
| 47 ] | 61 ] |
| 62 data += [ "$root_out_dir/libc++.so" ] | |
| 48 } | 63 } |
| 49 if (is_mac) { | 64 if (is_mac) { |
| 50 data_deps = [ | 65 data_deps = [ |
| 51 ":copy_asan_runtime", | 66 ":copy_asan_runtime", |
| 52 ] | 67 ] |
| 53 } | 68 } |
| 54 } | 69 } |
| 55 } | 70 } |
| 56 | 71 |
| 57 if (is_mac) { | 72 if (is_mac) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 cflags = [] | 166 cflags = [] |
| 152 cflags_cc = [] | 167 cflags_cc = [] |
| 153 | 168 |
| 154 # Sanitizers need line table info for stack traces. They don't need type info | 169 # Sanitizers need line table info for stack traces. They don't need type info |
| 155 # or variable info, so we can leave that out to speed up the build. | 170 # or variable info, so we can leave that out to speed up the build. |
| 156 if (using_sanitizer) { | 171 if (using_sanitizer) { |
| 157 assert(is_clang, "sanitizers only supported with clang") | 172 assert(is_clang, "sanitizers only supported with clang") |
| 158 cflags += [ "-gline-tables-only" ] | 173 cflags += [ "-gline-tables-only" ] |
| 159 } | 174 } |
| 160 | 175 |
| 176 if (symbolized) { | |
| 177 cflags += [ | |
|
Nico
2016/06/02 18:16:41
What's the motivation for this block? I can't find
Dirk Pranke
2016/06/02 18:47:08
These flags get passed directly in the 'release_ex
| |
| 178 "-O1", | |
|
Nico
2016/06/02 18:16:41
Wouldn't the gn way for this be to pick a differen
Dirk Pranke
2016/06/02 18:47:08
Hm, probably. Good catch. I'll look at reworking t
| |
| 179 "-fno-line-functions", | |
|
Nico
2016/06/02 18:16:41
This is supposed to be -fno-inline-functions I ass
Dirk Pranke
2016/06/02 18:47:08
Yup, that's a typo. Another good catch.
| |
| 180 "-fno-inline", | |
| 181 ] | |
| 182 } | |
| 183 | |
| 161 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, | 184 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, |
| 162 # MemorySanitizer and non-official CFI builds. | 185 # MemorySanitizer and non-official CFI builds. |
| 163 if (using_sanitizer || (is_cfi && !is_official_build)) { | 186 if (using_sanitizer || (is_cfi && !is_official_build)) { |
| 164 if (is_posix) { | 187 if (is_posix) { |
| 165 cflags += [ "-fno-omit-frame-pointer" ] | 188 cflags += [ "-fno-omit-frame-pointer" ] |
| 166 } else { | 189 } else { |
| 167 cflags += [ "/Oy-" ] | 190 cflags += [ "/Oy-" ] |
| 168 } | 191 } |
| 169 } | 192 } |
| 170 | 193 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 426 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
| 404 # if some third_party code is required to be compiled without rtti, which | 427 # if some third_party code is required to be compiled without rtti, which |
| 405 # is a requirement for ubsan_vptr. | 428 # is a requirement for ubsan_vptr. |
| 406 config("default_sanitizer_flags_but_ubsan_vptr") { | 429 config("default_sanitizer_flags_but_ubsan_vptr") { |
| 407 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 430 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
| 408 } | 431 } |
| 409 | 432 |
| 410 config("default_sanitizer_flags_but_coverage") { | 433 config("default_sanitizer_flags_but_coverage") { |
| 411 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 434 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
| 412 } | 435 } |
| OLD | NEW |