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

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

Issue 899403003: Linux: Enable ODR violation detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reference libphonenumber bug Created 5 years, 10 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
« no previous file with comments | « build/common.gypi ('k') | third_party/libphonenumber/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 if (cpu_arch == "arm") { 6 if (cpu_arch == "arm") {
7 import("//build/config/arm.gni") 7 import("//build/config/arm.gni")
8 } 8 }
9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") { 9 if (cpu_arch == "mipsel" || cpu_arch == "mips64el") {
10 import("//build/config/mips.gni") 10 import("//build/config/mips.gni")
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 # TODO(GYP): is_ubsan, is_ubsan_vptr 65 # TODO(GYP): is_ubsan, is_ubsan_vptr
66 if (!is_win) { 66 if (!is_win) {
67 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan 67 using_sanitizer = is_asan || is_lsan || is_tsan || is_msan
68 } 68 }
69 69
70 # compiler --------------------------------------------------------------------- 70 # compiler ---------------------------------------------------------------------
71 # 71 #
72 # Base compiler configuration. 72 # Base compiler configuration.
73 # 73 #
74 # See also "runtime_library" below for related stuff and a discusison about 74 # See also "runtime_library" below for related stuff and a discussion about
75 # where stuff should go. Put warning related stuff in the "warnings" config. 75 # where stuff should go. Put warning related stuff in the "warnings" config.
76 76
77 config("compiler") { 77 config("compiler") {
78 cflags = [] 78 cflags = []
79 cflags_c = [] 79 cflags_c = []
80 cflags_cc = [] 80 cflags_cc = []
81 ldflags = [] 81 ldflags = []
82 defines = [] 82 defines = []
83 83
84 # In general, Windows is totally different, but all the other builds share 84 # In general, Windows is totally different, but all the other builds share
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 # TODO(brettw) common.gypi has this only for target toolset. 375 # TODO(brettw) common.gypi has this only for target toolset.
376 "-Wl,--icf=safe", 376 "-Wl,--icf=safe",
377 377
378 # Experimentation found that using four linking threads 378 # Experimentation found that using four linking threads
379 # saved ~20% of link time. 379 # saved ~20% of link time.
380 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa d/thread/281527606915bb36 380 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa d/thread/281527606915bb36
381 # Only apply this to the target linker, since the host 381 # Only apply this to the target linker, since the host
382 # linker might not be gold, but isn't used much anyway. 382 # linker might not be gold, but isn't used much anyway.
383 "-Wl,--threads", 383 "-Wl,--threads",
384 "-Wl,--thread-count=4", 384 "-Wl,--thread-count=4",
385 "-Wl,--detect-odr-violations",
385 ] 386 ]
386 } 387 }
387 388
388 if (linux_use_bundled_binutils) { 389 if (linux_use_bundled_binutils) {
389 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", 390 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
390 root_build_dir) 391 root_build_dir)
391 cflags += [ "-B$binutils_path" ] 392 cflags += [ "-B$binutils_path" ]
392 } 393 }
393 394
394 # Clang-specific compiler flags setup. 395 # Clang-specific compiler flags setup.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 469 }
469 } 470 }
470 } 471 }
471 472
472 config("compiler_arm_fpu") { 473 config("compiler_arm_fpu") {
473 if (cpu_arch == "arm" && !is_android_webview_build) { 474 if (cpu_arch == "arm" && !is_android_webview_build) {
474 cflags = [ "-mfpu=$arm_fpu" ] 475 cflags = [ "-mfpu=$arm_fpu" ]
475 } 476 }
476 } 477 }
477 478
479 # //third_party/libphonenumber is the only existing code that needs this.
480 # http://crbug.com/456021
481 # New code should fix their ODR violations instead of ignoring them.
482 config("compiler_allow_odr_violations") {
483 if (use_gold) {
484 ldflags = [ "-Wl,--no-detect-odr-violations" ]
485 }
486 }
Nico 2015/02/06 15:46:04 You can have a local config in the libphonenumber
Lei Zhang 2015/02/06 23:44:55 Oh, I tried that, but I needed to duplicate the |u
487
478 # runtime_library ------------------------------------------------------------- 488 # runtime_library -------------------------------------------------------------
479 # 489 #
480 # Sets the runtime library and associated options. 490 # Sets the runtime library and associated options.
481 # 491 #
482 # How do you determine what should go in here vs. "compiler" above? Consider if 492 # How do you determine what should go in here vs. "compiler" above? Consider if
483 # a target might choose to use a different runtime library (ignore for a moment 493 # a target might choose to use a different runtime library (ignore for a moment
484 # if this is possible or reasonable on your system). If such a target would want 494 # if this is possible or reasonable on your system). If such a target would want
485 # to change or remove your option, put it in the runtime_library config. If a 495 # to change or remove your option, put it in the runtime_library config. If a
486 # target wants the option regardless, put it in the compiler config. 496 # target wants the option regardless, put it in the compiler config.
487 497
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 cflags += [ "-gsplit-dwarf" ] 1061 cflags += [ "-gsplit-dwarf" ]
1052 } 1062 }
1053 } 1063 }
1054 } 1064 }
1055 1065
1056 config("no_symbols") { 1066 config("no_symbols") {
1057 if (!is_win) { 1067 if (!is_win) {
1058 cflags = [ "-g0" ] 1068 cflags = [ "-g0" ]
1059 } 1069 }
1060 } 1070 }
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | third_party/libphonenumber/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698