| 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/chromecast_build.gni") | 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/compiler/compiler.gni") | 8 import("//build/config/compiler/compiler.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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 474 |
| 475 # Add flags for link-time optimization. These flags enable | 475 # Add flags for link-time optimization. These flags enable |
| 476 # optimizations/transformations that require whole-program visibility at link | 476 # optimizations/transformations that require whole-program visibility at link |
| 477 # time, so they need to be applied to all translation units, and we may end up | 477 # time, so they need to be applied to all translation units, and we may end up |
| 478 # with miscompiles if only part of the program is compiled with LTO flags. For | 478 # with miscompiles if only part of the program is compiled with LTO flags. For |
| 479 # that reason, we cannot allow targets to enable or disable these flags, for | 479 # that reason, we cannot allow targets to enable or disable these flags, for |
| 480 # example by disabling the optimize configuration. | 480 # example by disabling the optimize configuration. |
| 481 # TODO(pcc): Make this conditional on is_official_build rather than on gn | 481 # TODO(pcc): Make this conditional on is_official_build rather than on gn |
| 482 # flags for specific features. | 482 # flags for specific features. |
| 483 if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) { | 483 if (!is_debug && (allow_posix_link_time_opt || is_cfi) && !is_nacl) { |
| 484 assert(use_lld || is_chromeos, "gold plugin only supported with ChromeOS") |
| 485 |
| 484 if (use_thin_lto) { | 486 if (use_thin_lto) { |
| 485 cflags += [ "-flto=thin" ] | 487 cflags += [ "-flto=thin" ] |
| 486 ldflags += [ "-flto=thin" ] | 488 ldflags += [ "-flto=thin" ] |
| 487 | 489 |
| 488 # Limit the parallelism to avoid too agressive competition between | 490 # Limit the parallelism to avoid too agressive competition between |
| 489 # linker jobs. This is still suboptimal to a potential dynamic | 491 # linker jobs. This is still suboptimal to a potential dynamic |
| 490 # resource allocation scheme, but should be good enough. | 492 # resource allocation scheme, but should be good enough. |
| 491 if (use_lld) { | 493 if (use_lld) { |
| 492 ldflags += [ | 494 ldflags += [ |
| 493 "-Wl,--thinlto-jobs=8", | 495 "-Wl,--thinlto-jobs=8", |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1806 | 1808 |
| 1807 if (is_ios || is_mac) { | 1809 if (is_ios || is_mac) { |
| 1808 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1810 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1809 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1811 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1810 config("enable_arc") { | 1812 config("enable_arc") { |
| 1811 common_flags = [ "-fobjc-arc" ] | 1813 common_flags = [ "-fobjc-arc" ] |
| 1812 cflags_objc = common_flags | 1814 cflags_objc = common_flags |
| 1813 cflags_objcc = common_flags | 1815 cflags_objcc = common_flags |
| 1814 } | 1816 } |
| 1815 } | 1817 } |
| OLD | NEW |