| 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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 | 1219 |
| 1220 # Set the number of LTCG code-gen threads to eight. The default is four. | 1220 # Set the number of LTCG code-gen threads to eight. The default is four. |
| 1221 # This gives a 5-10% link speedup. | 1221 # This gives a 5-10% link speedup. |
| 1222 "/cgthreads:8", | 1222 "/cgthreads:8", |
| 1223 ] | 1223 ] |
| 1224 if (full_wpo_on_official) { | 1224 if (full_wpo_on_official) { |
| 1225 arflags = [ "/LTCG" ] | 1225 arflags = [ "/LTCG" ] |
| 1226 } | 1226 } |
| 1227 } | 1227 } |
| 1228 } else { | 1228 } else { |
| 1229 common_optimize_on_cflags = [ | 1229 common_optimize_on_cflags = [] |
| 1230 # Don't emit the GCC version ident directives, they just end up in the | |
| 1231 # .comment section taking up binary size. | |
| 1232 "-fno-ident", | |
| 1233 | |
| 1234 # Put data and code in their own sections, so that unused symbols | |
| 1235 # can be removed at link time with --gc-sections. | |
| 1236 "-fdata-sections", | |
| 1237 "-ffunction-sections", | |
| 1238 ] | |
| 1239 common_optimize_on_ldflags = [] | 1230 common_optimize_on_ldflags = [] |
| 1240 | 1231 |
| 1241 if (is_android) { | 1232 if (is_android) { |
| 1242 # We don't omit frame pointers on arm64 since they are required | 1233 # We don't omit frame pointers on arm64 since they are required |
| 1243 # to correctly unwind stackframes which contain system library | 1234 # to correctly unwind stackframes which contain system library |
| 1244 # function frames (crbug.com/391706). | 1235 # function frames (crbug.com/391706). |
| 1245 if (!using_sanitizer && !enable_profiling && current_cpu != "arm64") { | 1236 if (!using_sanitizer && !enable_profiling && current_cpu != "arm64") { |
| 1246 common_optimize_on_cflags += [ "-fomit-frame-pointer" ] | 1237 common_optimize_on_cflags += [ "-fomit-frame-pointer" ] |
| 1247 } | 1238 } |
| 1248 | 1239 |
| 1249 # TODO(jdduke) Re-enable on mips after resolving linking | 1240 # TODO(jdduke) Re-enable on mips after resolving linking |
| 1250 # issues with libc++ (crbug.com/456380). | 1241 # issues with libc++ (crbug.com/456380). |
| 1251 if (current_cpu != "mipsel" && current_cpu != "mips64el") { | 1242 if (current_cpu != "mipsel" && current_cpu != "mips64el") { |
| 1252 common_optimize_on_ldflags += [ | 1243 common_optimize_on_ldflags += [ |
| 1253 # Warn in case of text relocations. | 1244 # Warn in case of text relocations. |
| 1254 "-Wl,--warn-shared-textrel", | 1245 "-Wl,--warn-shared-textrel", |
| 1255 ] | 1246 ] |
| 1256 } | 1247 } |
| 1257 } | 1248 } |
| 1258 | 1249 |
| 1259 if (is_mac || is_ios) { | 1250 if (is_mac || is_ios) { |
| 1260 if (symbol_level == 2) { | 1251 if (symbol_level == 2) { |
| 1261 # Mac dead code stripping requires symbols. | 1252 # Mac dead code stripping requires symbols. |
| 1262 common_optimize_on_ldflags += [ "-Wl,-dead_strip" ] | 1253 common_optimize_on_ldflags += [ "-Wl,-dead_strip" ] |
| 1263 } | 1254 } |
| 1264 } else { | 1255 } else { |
| 1265 # Non-Mac Posix linker flags. | 1256 # Non-Mac Posix flags. |
| 1257 |
| 1258 common_optimize_on_cflags += [ |
| 1259 # Don't emit the GCC version ident directives, they just end up in the |
| 1260 # .comment section taking up binary size. |
| 1261 "-fno-ident", |
| 1262 |
| 1263 # Put data and code in their own sections, so that unused symbols |
| 1264 # can be removed at link time with --gc-sections. |
| 1265 "-fdata-sections", |
| 1266 "-ffunction-sections", |
| 1267 ] |
| 1268 |
| 1266 common_optimize_on_ldflags += [ | 1269 common_optimize_on_ldflags += [ |
| 1267 # Specifically tell the linker to perform optimizations. | 1270 # Specifically tell the linker to perform optimizations. |
| 1268 # See http://lwn.net/Articles/192624/ . | 1271 # See http://lwn.net/Articles/192624/ . |
| 1269 "-Wl,-O1", | 1272 "-Wl,-O1", |
| 1270 "-Wl,--gc-sections", | 1273 "-Wl,--gc-sections", |
| 1271 ] | 1274 ] |
| 1272 | 1275 |
| 1273 if (!using_sanitizer) { | 1276 if (!using_sanitizer) { |
| 1274 # Functions interposed by the sanitizers can make ld think | 1277 # Functions interposed by the sanitizers can make ld think |
| 1275 # that some libraries aren't needed when they actually are, | 1278 # that some libraries aren't needed when they actually are, |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 | 1541 |
| 1539 if (is_ios || is_mac) { | 1542 if (is_ios || is_mac) { |
| 1540 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1543 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1541 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1544 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1542 config("enable_arc") { | 1545 config("enable_arc") { |
| 1543 common_flags = [ "-fobjc-arc" ] | 1546 common_flags = [ "-fobjc-arc" ] |
| 1544 cflags_objc = common_flags | 1547 cflags_objc = common_flags |
| 1545 cflags_objcc = common_flags | 1548 cflags_objcc = common_flags |
| 1546 } | 1549 } |
| 1547 } | 1550 } |
| OLD | NEW |