OLD | NEW |
(Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/chrome_build.gni") |
| 7 import("//build/config/chromecast_build.gni") |
| 8 import("//build/config/sanitizers/sanitizers.gni") |
| 9 import("//build/toolchain/toolchain.gni") |
| 10 |
| 11 declare_args() { |
| 12 # How many symbols to include in the build. This affects the performance of |
| 13 # the build since the symbols are large and dealing with them is slow. |
| 14 # 2 means regular build with symbols. |
| 15 # 1 means minimal symbols, usually enough for backtraces only. |
| 16 # 0 means no symbols. |
| 17 # -1 means auto-set according to debug/release and platform. |
| 18 symbol_level = -1 |
| 19 |
| 20 # Compile in such a way as to enable profiling of the generated code. For |
| 21 # example, don't omit the frame pointer and leave in symbols. |
| 22 enable_profiling = false |
| 23 |
| 24 # Specify the current PGO phase, only used for the Windows MSVS build. Here's |
| 25 # the different values that can be used: |
| 26 # 0 : Means that PGO is turned off. |
| 27 # 1 : Used during the PGI (instrumentation) phase. |
| 28 # 2 : Used during the PGO (optimization) phase. |
| 29 # |
| 30 # TODO(sebmarchand): Add support for the PGU (update) phase. |
| 31 chrome_pgo_phase = 0 |
| 32 |
| 33 # Whether or not the official builds should be build with full WPO. |
| 34 full_wpo_on_official = false |
| 35 } |
| 36 |
| 37 declare_args() { |
| 38 # Whether to use the gold linker from binutils instead of lld or bfd. |
| 39 use_gold = !use_lld && !(is_chromecast && is_linux && |
| 40 (current_cpu == "arm" || current_cpu == "mipsel")) && |
| 41 ((is_linux && (current_cpu == "x64" || current_cpu == "x86" || |
| 42 current_cpu == "arm")) || |
| 43 (is_android && (current_cpu == "x86" || current_cpu == "x64" || |
| 44 current_cpu == "arm"))) |
| 45 } |
| 46 |
| 47 # If it wasn't manually set, set to an appropriate default. |
| 48 assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level") |
| 49 if (symbol_level == -1) { |
| 50 if (is_android && use_order_profiling) { |
| 51 # With instrumentation enabled, debug info puts libchrome.so over 4gb, which |
| 52 # causes the linker to produce an invalid ELF. http://crbug.com/574476 |
| 53 symbol_level = 0 |
| 54 } else if (is_win && is_clang && !using_sanitizer) { |
| 55 # TODO(thakis): Remove this again once building with clang/win and |
| 56 # debug info doesn't make link.exe run for hours. |
| 57 symbol_level = 1 |
| 58 } else if (!is_linux || is_debug || is_official_build || is_chromecast) { |
| 59 # Linux is slowed by having symbols as part of the target binary, whereas |
| 60 # Mac and Windows have them separate, so in Release Linux, default them off, |
| 61 # but keep them on for Official builds and Chromecast builds. |
| 62 symbol_level = 2 |
| 63 } else if (using_sanitizer) { |
| 64 # Sanitizers require symbols for filename suppressions to work. |
| 65 symbol_level = 1 |
| 66 } else { |
| 67 symbol_level = 0 |
| 68 } |
| 69 } |
| 70 |
| 71 # PGO requires full WPO. |
| 72 if (chrome_pgo_phase > 0) { |
| 73 full_wpo_on_official = true |
| 74 } |
OLD | NEW |