| 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_overrides/build.gni") | 5 import("//build_overrides/build.gni") |
| 6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/clang/clang.gni") | 8 import("//build/config/clang/clang.gni") |
| 9 import("//build/config/sanitizers/sanitizers.gni") | 9 import("//build/config/sanitizers/sanitizers.gni") |
| 10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 prefix = "//buildtools/third_party" | 298 prefix = "//buildtools/third_party" |
| 299 include = "trunk/include" | 299 include = "trunk/include" |
| 300 cflags_cc += [ | 300 cflags_cc += [ |
| 301 "-nostdinc++", | 301 "-nostdinc++", |
| 302 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), | 302 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), |
| 303 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), | 303 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), |
| 304 ] | 304 ] |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 config("sanitizer_default_libs") { |
| 309 # The clang sanitizers (compiler-rt/ASAN) runtime requires functions from the |
| 310 # CRT. This config must be added to targets that are removing the default |
| 311 # libraries using the linker options "/NOENTRY", "/ENTRY" or "/NODEFAULTLIB". |
| 312 |
| 313 if (is_asan && is_win) { |
| 314 assert(!is_debug, "win/asan does not support linking with debug CRT") |
| 315 |
| 316 if (is_component_build) { |
| 317 libs = [ |
| 318 "msvcrt.lib", |
| 319 "ucrt.lib", |
| 320 "vcruntime.lib", |
| 321 ] |
| 322 } else { |
| 323 libs = [ |
| 324 "libcmt.lib", |
| 325 "libucrt.lib", |
| 326 "libvcruntime.lib", |
| 327 ] |
| 328 } |
| 329 } |
| 330 } |
| 331 |
| 308 config("asan_flags") { | 332 config("asan_flags") { |
| 309 cflags = [] | 333 cflags = [] |
| 310 if (is_asan) { | 334 if (is_asan) { |
| 311 cflags += [ "-fsanitize=address" ] | 335 cflags += [ "-fsanitize=address" ] |
| 312 if (!asan_globals) { | 336 if (!asan_globals) { |
| 313 cflags += [ | 337 cflags += [ |
| 314 "-mllvm", | 338 "-mllvm", |
| 315 "-asan-globals=0", | 339 "-asan-globals=0", |
| 316 ] | 340 ] |
| 317 } | 341 } |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 584 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
| 561 # if some third_party code is required to be compiled without rtti, which | 585 # if some third_party code is required to be compiled without rtti, which |
| 562 # is a requirement for ubsan_vptr. | 586 # is a requirement for ubsan_vptr. |
| 563 config("default_sanitizer_flags_but_ubsan_vptr") { | 587 config("default_sanitizer_flags_but_ubsan_vptr") { |
| 564 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 588 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
| 565 } | 589 } |
| 566 | 590 |
| 567 config("default_sanitizer_flags_but_coverage") { | 591 config("default_sanitizer_flags_but_coverage") { |
| 568 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 592 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
| 569 } | 593 } |
| OLD | NEW |