| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 # Disable frame pointer elimination for better stack traces. | 275 # Disable frame pointer elimination for better stack traces. |
| 276 if (is_posix) { | 276 if (is_posix) { |
| 277 cflags += [ "-fno-omit-frame-pointer" ] | 277 cflags += [ "-fno-omit-frame-pointer" ] |
| 278 } else { | 278 } else { |
| 279 cflags += [ "/Oy-" ] | 279 cflags += [ "/Oy-" ] |
| 280 } | 280 } |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 # TODO(thomasanderson): Move this out of build/config/sanitizers. | |
| 285 config("libcxx_flags") { | |
| 286 if (use_custom_libcxx) { | |
| 287 prefix = "//buildtools/third_party" | |
| 288 include = "trunk/include" | |
| 289 cflags_cc = [ | |
| 290 "-nostdinc++", | |
| 291 "-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), | |
| 292 "-isystem" + rebase_path("$prefix/libc++abi/$include", root_build_dir), | |
| 293 ] | |
| 294 } | |
| 295 } | |
| 296 | |
| 297 config("asan_flags") { | 284 config("asan_flags") { |
| 298 cflags = [] | 285 cflags = [] |
| 299 if (is_asan) { | 286 if (is_asan) { |
| 300 cflags += [ "-fsanitize=address" ] | 287 cflags += [ "-fsanitize=address" ] |
| 301 if (!is_mac) { | 288 if (!is_mac) { |
| 302 cflags += [ "-fsanitize-address-use-after-scope" ] | 289 cflags += [ "-fsanitize-address-use-after-scope" ] |
| 303 } else { | 290 } else { |
| 304 # https://crbug.com/708707 | 291 # https://crbug.com/708707 |
| 305 cflags += [ "-fno-sanitize-address-use-after-scope" ] | 292 cflags += [ "-fno-sanitize-address-use-after-scope" ] |
| 306 } | 293 } |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 519 } |
| 533 | 520 |
| 534 config("fuzzing_build_mode") { | 521 config("fuzzing_build_mode") { |
| 535 if (use_libfuzzer || use_afl) { | 522 if (use_libfuzzer || use_afl) { |
| 536 defines = [ "FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" ] | 523 defines = [ "FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" ] |
| 537 } | 524 } |
| 538 } | 525 } |
| 539 | 526 |
| 540 all_sanitizer_configs = [ | 527 all_sanitizer_configs = [ |
| 541 ":common_sanitizer_flags", | 528 ":common_sanitizer_flags", |
| 542 ":libcxx_flags", | |
| 543 ":coverage_flags", | 529 ":coverage_flags", |
| 544 ":default_sanitizer_ldflags", | 530 ":default_sanitizer_ldflags", |
| 545 ":asan_flags", | 531 ":asan_flags", |
| 546 ":cfi_flags", | 532 ":cfi_flags", |
| 547 ":lsan_flags", | 533 ":lsan_flags", |
| 548 ":msan_flags", | 534 ":msan_flags", |
| 549 ":tsan_flags", | 535 ":tsan_flags", |
| 550 ":ubsan_flags", | 536 ":ubsan_flags", |
| 551 ":ubsan_no_recover", | 537 ":ubsan_no_recover", |
| 552 ":ubsan_null_flags", | 538 ":ubsan_null_flags", |
| (...skipping 18 matching lines...) Expand all Loading... |
| 571 # This allows to selectively disable ubsan_vptr, when needed. In particular, | 557 # This allows to selectively disable ubsan_vptr, when needed. In particular, |
| 572 # if some third_party code is required to be compiled without rtti, which | 558 # if some third_party code is required to be compiled without rtti, which |
| 573 # is a requirement for ubsan_vptr. | 559 # is a requirement for ubsan_vptr. |
| 574 config("default_sanitizer_flags_but_ubsan_vptr") { | 560 config("default_sanitizer_flags_but_ubsan_vptr") { |
| 575 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] | 561 configs = all_sanitizer_configs - [ ":ubsan_vptr_flags" ] |
| 576 } | 562 } |
| 577 | 563 |
| 578 config("default_sanitizer_flags_but_coverage") { | 564 config("default_sanitizer_flags_but_coverage") { |
| 579 configs = all_sanitizer_configs - [ ":coverage_flags" ] | 565 configs = all_sanitizer_configs - [ ":coverage_flags" ] |
| 580 } | 566 } |
| OLD | NEW |