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 if (current_cpu == "arm") { | 7 if (current_cpu == "arm") { |
8 import("//build/config/arm.gni") | 8 import("//build/config/arm.gni") |
9 } | 9 } |
10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 # Not exporting C++ inline functions can generally be applied anywhere | 172 # Not exporting C++ inline functions can generally be applied anywhere |
173 # so we do so here. Normal function visibility is controlled by | 173 # so we do so here. Normal function visibility is controlled by |
174 # //build/config/gcc:symbol_visibility_hidden. | 174 # //build/config/gcc:symbol_visibility_hidden. |
175 "-fvisibility-inlines-hidden", | 175 "-fvisibility-inlines-hidden", |
176 ] | 176 ] |
177 | 177 |
178 # Stack protection. | 178 # Stack protection. |
179 if (is_mac) { | 179 if (is_mac) { |
180 cflags += [ "-fstack-protector-all" ] | 180 cflags += [ "-fstack-protector-all" ] |
181 } else if (is_posix && !is_chromeos && !is_nacl) { | 181 } else if (is_posix && !is_chromeos_ui && !is_nacl) { |
182 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it. | 182 # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it. |
183 cflags += [ "--param=ssp-buffer-size=4" ] | 183 cflags += [ "--param=ssp-buffer-size=4" ] |
184 if (is_android && (current_cpu == "arm64" || current_cpu == "x86")) { | 184 if (is_android && (current_cpu == "arm64" || current_cpu == "x86")) { |
185 cflags += [ "-fno-stack-protector" ] | 185 cflags += [ "-fno-stack-protector" ] |
186 } else { | 186 } else { |
187 cflags += [ "-fstack-protector" ] | 187 cflags += [ "-fstack-protector" ] |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 # Linker warnings. | 191 # Linker warnings. |
192 if (!(is_chromeos && current_cpu == "arm") && !is_mac && !is_ios) { | 192 if (!(is_chromeos_os && current_cpu == "arm") && !is_mac && !is_ios) { |
193 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 | 193 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 |
194 ldflags += [ "-Wl,--fatal-warnings" ] | 194 ldflags += [ "-Wl,--fatal-warnings" ] |
195 } | 195 } |
196 | 196 |
197 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and | 197 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and |
198 # MemorySanitizer | 198 # MemorySanitizer |
199 if (using_sanitizer) { | 199 if (using_sanitizer) { |
200 cflags += [ | 200 cflags += [ |
201 "-fno-omit-frame-pointer", | 201 "-fno-omit-frame-pointer", |
202 "-gline-tables-only", | 202 "-gline-tables-only", |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 #"-Wl,--threads", | 491 #"-Wl,--threads", |
492 #"-Wl,--thread-count=4", | 492 #"-Wl,--thread-count=4", |
493 ] | 493 ] |
494 | 494 |
495 if (!is_asan && !is_msan && !is_lsan && !is_tsan) { | 495 if (!is_asan && !is_msan && !is_lsan && !is_tsan) { |
496 # TODO(brettw) common.gypi has this only for target toolset. | 496 # TODO(brettw) common.gypi has this only for target toolset. |
497 ldflags += [ "-Wl,--icf=all" ] | 497 ldflags += [ "-Wl,--icf=all" ] |
498 } | 498 } |
499 | 499 |
500 # TODO(thestig): Make this flag work with GN. | 500 # TODO(thestig): Make this flag work with GN. |
501 #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan |
| is_msan)) { | 501 #if (!is_official_build && !is_chromeos_os && !(is_asan || is_lsan || is_tsa
n || is_msan)) { |
502 # ldflags += [ | 502 # ldflags += [ |
503 # "-Wl,--detect-odr-violations", | 503 # "-Wl,--detect-odr-violations", |
504 # ] | 504 # ] |
505 #} | 505 #} |
506 } | 506 } |
507 | 507 |
508 if (linux_use_bundled_binutils) { | 508 if (linux_use_bundled_binutils) { |
509 cflags += [ "-B$binutils_path" ] | 509 cflags += [ "-B$binutils_path" ] |
510 } | 510 } |
511 | 511 |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 # regardless of whether what they point to is already known to be valid. | 1129 # regardless of whether what they point to is already known to be valid. |
1130 # gcc 4.9 and earlier had no way of suppressing this warning without | 1130 # gcc 4.9 and earlier had no way of suppressing this warning without |
1131 # supressing the rest of them. Here we centralize the identification of | 1131 # supressing the rest of them. Here we centralize the identification of |
1132 # the gcc 4.9 toolchains. | 1132 # the gcc 4.9 toolchains. |
1133 config("no_incompatible_pointer_warnings") { | 1133 config("no_incompatible_pointer_warnings") { |
1134 cflags = [] | 1134 cflags = [] |
1135 if (is_clang) { | 1135 if (is_clang) { |
1136 cflags += [ "-Wno-incompatible-pointer-types" ] | 1136 cflags += [ "-Wno-incompatible-pointer-types" ] |
1137 } else if (current_cpu == "mipsel") { | 1137 } else if (current_cpu == "mipsel") { |
1138 cflags += [ "-w" ] | 1138 cflags += [ "-w" ] |
1139 } else if (is_chromeos && current_cpu == "arm") { | 1139 } else if (is_chromeos_os && current_cpu == "arm") { |
1140 cflags += [ "-w" ] | 1140 cflags += [ "-w" ] |
1141 } | 1141 } |
1142 } | 1142 } |
1143 | 1143 |
1144 # Optimization ----------------------------------------------------------------- | 1144 # Optimization ----------------------------------------------------------------- |
1145 # | 1145 # |
1146 # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config" | 1146 # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config" |
1147 # which it will assign to the config it implicitly applies to every target. If | 1147 # which it will assign to the config it implicitly applies to every target. If |
1148 # you want to override the optimization level for your target, remove this | 1148 # you want to override the optimization level for your target, remove this |
1149 # config (which will expand differently for debug or release builds), and then | 1149 # config (which will expand differently for debug or release builds), and then |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 cflags += [ "-gsplit-dwarf" ] | 1332 cflags += [ "-gsplit-dwarf" ] |
1333 } | 1333 } |
1334 } | 1334 } |
1335 } | 1335 } |
1336 | 1336 |
1337 config("no_symbols") { | 1337 config("no_symbols") { |
1338 if (!is_win) { | 1338 if (!is_win) { |
1339 cflags = [ "-g0" ] | 1339 cflags = [ "-g0" ] |
1340 } | 1340 } |
1341 } | 1341 } |
OLD | NEW |