OLD | NEW |
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 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 import("//build/config/nacl/config.gni") | 8 import("//build/config/nacl/config.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 # Linux & Mac favor speed over size. | 71 # Linux & Mac favor speed over size. |
72 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should | 72 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should |
73 # explore favoring size over speed in this case as well. | 73 # explore favoring size over speed in this case as well. |
74 optimize_for_size = is_android || is_ios | 74 optimize_for_size = is_android || is_ios |
75 | 75 |
76 # Enable fatal linker warnings. Building Chromium with certain versions | 76 # Enable fatal linker warnings. Building Chromium with certain versions |
77 # of binutils can cause linker warning. | 77 # of binutils can cause linker warning. |
78 # See: https://bugs.chromium.org/p/chromium/issues/detail?id=457359 | 78 # See: https://bugs.chromium.org/p/chromium/issues/detail?id=457359 |
79 fatal_linker_warnings = true | 79 fatal_linker_warnings = true |
80 | 80 |
| 81 # Build with C++ RTTI enabled. Chromium builds without RTTI by default, |
| 82 # but some sanitizers are known to require it, like CFI diagnostics |
| 83 # and UBsan variants. |
| 84 use_rtti = use_cfi_diag || is_ubsan_vptr || is_ubsan_security |
| 85 |
81 # AFDO (Automatic Feedback Directed Optimizer) is a form of profile-guided | 86 # AFDO (Automatic Feedback Directed Optimizer) is a form of profile-guided |
82 # optimization that GCC supports. It used by ChromeOS in their official | 87 # optimization that GCC supports. It used by ChromeOS in their official |
83 # builds. To use it, set auto_profile_path to the path to a file containing | 88 # builds. To use it, set auto_profile_path to the path to a file containing |
84 # the needed gcov profiling data. | 89 # the needed gcov profiling data. |
85 auto_profile_path = "" | 90 auto_profile_path = "" |
86 | 91 |
87 # Optimize for coverage guided fuzzing (balance between speed and number of | 92 # Optimize for coverage guided fuzzing (balance between speed and number of |
88 # branches) | 93 # branches) |
89 optimize_for_fuzzing = false | 94 optimize_for_fuzzing = false |
90 } | 95 } |
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 # | 1186 # |
1182 # Allows turning Run-Time Type Identification on or off. | 1187 # Allows turning Run-Time Type Identification on or off. |
1183 | 1188 |
1184 config("rtti") { | 1189 config("rtti") { |
1185 if (is_win) { | 1190 if (is_win) { |
1186 cflags_cc = [ "/GR" ] | 1191 cflags_cc = [ "/GR" ] |
1187 } else { | 1192 } else { |
1188 cflags_cc = [ "-frtti" ] | 1193 cflags_cc = [ "-frtti" ] |
1189 } | 1194 } |
1190 } | 1195 } |
| 1196 |
1191 config("no_rtti") { | 1197 config("no_rtti") { |
1192 # CFI diagnostics and UBsan vptr require RTTI. | 1198 # Some sanitizer configs may require RTTI to be left enabled globally |
1193 if (!use_cfi_diag && !is_ubsan_vptr && !is_ubsan_security) { | 1199 if (!use_rtti) { |
1194 if (is_win) { | 1200 if (is_win) { |
1195 cflags_cc = [ "/GR-" ] | 1201 cflags_cc = [ "/GR-" ] |
1196 } else { | 1202 } else { |
1197 cflags_cc = [ "-fno-rtti" ] | 1203 cflags_cc = [ "-fno-rtti" ] |
1198 cflags_objcc = cflags_cc | 1204 cflags_objcc = cflags_cc |
1199 } | 1205 } |
1200 } | 1206 } |
1201 } | 1207 } |
1202 | 1208 |
1203 # Warnings --------------------------------------------------------------------- | 1209 # Warnings --------------------------------------------------------------------- |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 | 1670 |
1665 if (is_ios || is_mac) { | 1671 if (is_ios || is_mac) { |
1666 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1672 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1667 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1673 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1668 config("enable_arc") { | 1674 config("enable_arc") { |
1669 common_flags = [ "-fobjc-arc" ] | 1675 common_flags = [ "-fobjc-arc" ] |
1670 cflags_objc = common_flags | 1676 cflags_objc = common_flags |
1671 cflags_objcc = common_flags | 1677 cflags_objcc = common_flags |
1672 } | 1678 } |
1673 } | 1679 } |
OLD | NEW |