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