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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 # | 1161 # |
1162 # configs -= default_optimization_config | 1162 # configs -= default_optimization_config |
1163 # configs += [ "//build/config/compiler/optimize_max" ] | 1163 # configs += [ "//build/config/compiler/optimize_max" ] |
1164 | 1164 |
1165 # Shared settings for both "optimize" and "optimize_max" configs. | 1165 # Shared settings for both "optimize" and "optimize_max" configs. |
1166 # IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags. | 1166 # IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags. |
1167 if (is_win) { | 1167 if (is_win) { |
1168 common_optimize_on_cflags = [ | 1168 common_optimize_on_cflags = [ |
1169 "/Ob2", # Both explicit and auto inlining. | 1169 "/Ob2", # Both explicit and auto inlining. |
1170 "/Oy-", # Disable omitting frame pointers, must be after /O2. | 1170 "/Oy-", # Disable omitting frame pointers, must be after /O2. |
| 1171 "/d2Zi+", # Improve debugging of optimized code. |
| 1172 "/Zc:inline", # Remove unreferenced COMDAT (faster links). |
1171 ] | 1173 ] |
1172 if (!is_asan) { | 1174 if (!is_asan) { |
1173 common_optimize_on_cflags += [ | 1175 common_optimize_on_cflags += [ |
1174 # Put data in separate COMDATs. This allows the linker | 1176 # Put data in separate COMDATs. This allows the linker |
1175 # to put bit-identical constants at the same address even if | 1177 # to put bit-identical constants at the same address even if |
1176 # they're unrelated constants, which saves binary size. | 1178 # they're unrelated constants, which saves binary size. |
1177 # This optimization can't be used when ASan is enabled because | 1179 # This optimization can't be used when ASan is enabled because |
1178 # it is not compatible with the ASan ODR checker. | 1180 # it is not compatible with the ASan ODR checker. |
1179 "/Gw", | 1181 "/Gw", |
1180 ] | 1182 ] |
1181 } | 1183 } |
1182 common_optimize_on_ldflags = [ "/OPT:REF" ] | 1184 common_optimize_on_ldflags = [ "/OPT:ICF" ] |
| 1185 if (is_official_build) { |
| 1186 common_optimize_on_ldflags += [ |
| 1187 # Link-time code generation. |
| 1188 "/LTCG", |
| 1189 |
| 1190 # Set the number of LTCG code-gen threads to eight. The default is four. |
| 1191 # This gives a 5-10% link speedup. |
| 1192 "/cgthreads:8", |
| 1193 ] |
| 1194 } |
1183 } else { | 1195 } else { |
1184 common_optimize_on_cflags = [ | 1196 common_optimize_on_cflags = [ |
1185 # Don't emit the GCC version ident directives, they just end up in the | 1197 # Don't emit the GCC version ident directives, they just end up in the |
1186 # .comment section taking up binary size. | 1198 # .comment section taking up binary size. |
1187 "-fno-ident", | 1199 "-fno-ident", |
1188 | 1200 |
1189 # Put data and code in their own sections, so that unused symbols | 1201 # Put data and code in their own sections, so that unused symbols |
1190 # can be removed at link time with --gc-sections. | 1202 # can be removed at link time with --gc-sections. |
1191 "-fdata-sections", | 1203 "-fdata-sections", |
1192 "-ffunction-sections", | 1204 "-ffunction-sections", |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 # that the compile is clean. | 1297 # that the compile is clean. |
1286 cflags += [ | 1298 cflags += [ |
1287 "/GL", # Whole program optimization. | 1299 "/GL", # Whole program optimization. |
1288 | 1300 |
1289 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. | 1301 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. |
1290 # Probably anything that this would catch that wouldn't be caught in a | 1302 # Probably anything that this would catch that wouldn't be caught in a |
1291 # normal build isn't going to actually be a bug, so the incremental | 1303 # normal build isn't going to actually be a bug, so the incremental |
1292 # value of C4702 for PGO builds is likely very small. | 1304 # value of C4702 for PGO builds is likely very small. |
1293 "/wd4702", | 1305 "/wd4702", |
1294 ] | 1306 ] |
1295 ldflags += [ "/LTCG" ] | |
1296 } | 1307 } |
1297 } else { | 1308 } else { |
1298 cflags = [ "-O2" ] + common_optimize_on_cflags | 1309 cflags = [ "-O2" ] + common_optimize_on_cflags |
1299 } | 1310 } |
1300 } | 1311 } |
1301 | 1312 |
1302 # Symbols ---------------------------------------------------------------------- | 1313 # Symbols ---------------------------------------------------------------------- |
1303 | 1314 |
1304 config("symbols") { | 1315 config("symbols") { |
1305 if (is_win) { | 1316 if (is_win) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 cflags += [ "-gsplit-dwarf" ] | 1353 cflags += [ "-gsplit-dwarf" ] |
1343 } | 1354 } |
1344 } | 1355 } |
1345 } | 1356 } |
1346 | 1357 |
1347 config("no_symbols") { | 1358 config("no_symbols") { |
1348 if (!is_win) { | 1359 if (!is_win) { |
1349 cflags = [ "-g0" ] | 1360 cflags = [ "-g0" ] |
1350 } | 1361 } |
1351 } | 1362 } |
OLD | NEW |