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

Side by Side Diff: build/config/sanitizers/BUILD.gn

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

Powered by Google App Engine
This is Rietveld 408576698