| 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/arm.gni") | 6 import("//build/config/arm.gni") |
| 7 import("//build/config/chrome_build.gni") | 7 import("//build/config/chrome_build.gni") |
| 8 import("//build/config/chromecast_build.gni") | 8 import("//build/config/chromecast_build.gni") |
| 9 import("//build/config/compiler/pgo/pgo.gni") | 9 import("//build/config/compiler/pgo/pgo.gni") |
| 10 import("//build/config/sanitizers/sanitizers.gni") | 10 import("//build/config/sanitizers/sanitizers.gni") |
| 11 import("//build/toolchain/cc_wrapper.gni") |
| 11 import("//build/toolchain/goma.gni") | 12 import("//build/toolchain/goma.gni") |
| 12 import("//build/toolchain/toolchain.gni") | 13 import("//build/toolchain/toolchain.gni") |
| 13 import("//build_overrides/build.gni") | 14 import("//build_overrides/build.gni") |
| 14 | 15 |
| 15 declare_args() { | 16 declare_args() { |
| 16 # How many symbols to include in the build. This affects the performance of | 17 # How many symbols to include in the build. This affects the performance of |
| 17 # the build since the symbols are large and dealing with them is slow. | 18 # the build since the symbols are large and dealing with them is slow. |
| 18 # 2 means regular build with symbols. | 19 # 2 means regular build with symbols. |
| 19 # 1 means minimal symbols, usually enough for backtraces only. Symbols with | 20 # 1 means minimal symbols, usually enough for backtraces only. Symbols with |
| 20 # internal linkage (static functions or those in anonymous namespaces) may not | 21 # internal linkage (static functions or those in anonymous namespaces) may not |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 current_cpu == "arm" || current_cpu == "arm64")) | 139 current_cpu == "arm" || current_cpu == "arm64")) |
| 139 } | 140 } |
| 140 | 141 |
| 141 # If it wasn't manually set, set to an appropriate default. | 142 # If it wasn't manually set, set to an appropriate default. |
| 142 assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level") | 143 assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level") |
| 143 if (symbol_level == -1) { | 144 if (symbol_level == -1) { |
| 144 if (is_android && use_order_profiling) { | 145 if (is_android && use_order_profiling) { |
| 145 # With instrumentation enabled, debug info puts libchrome.so over 4gb, which | 146 # With instrumentation enabled, debug info puts libchrome.so over 4gb, which |
| 146 # causes the linker to produce an invalid ELF. http://crbug.com/574476 | 147 # causes the linker to produce an invalid ELF. http://crbug.com/574476 |
| 147 symbol_level = 0 | 148 symbol_level = 0 |
| 148 } else if (is_android && !is_component_build && | |
| 149 !(android_64bit_target_cpu && !build_apk_secondary_abi)) { | |
| 150 # Reduce symbol level when it will cause invalid elf files to be created | |
| 151 # (due to file size). https://crbug.com/648948. | |
| 152 symbol_level = 1 | |
| 153 } else if (is_win && use_goma && !is_clang) { | 149 } else if (is_win && use_goma && !is_clang) { |
| 154 # goma doesn't support PDB files, so we disable symbols during goma | 150 # goma doesn't support PDB files, so we disable symbols during goma |
| 155 # compilation because otherwise the redundant debug information generated | 151 # compilation because otherwise the redundant debug information generated |
| 156 # by visual studio (repeated in every .obj file) makes linker | 152 # by visual studio (repeated in every .obj file) makes linker |
| 157 # memory consumption and link times unsustainable (crbug.com/630074). | 153 # memory consumption and link times unsustainable (crbug.com/630074). |
| 158 # Clang on windows does not have this issue. | 154 # Clang on windows does not have this issue. |
| 159 # If you use is_win_fastlink = true then you can set symbol_level = 2 when | 155 # If you use is_win_fastlink = true then you can set symbol_level = 2 when |
| 160 # using goma. | 156 # using goma. |
| 161 symbol_level = 1 | 157 symbol_level = 1 |
| 162 } else if ((!is_nacl && !is_linux) || is_debug || is_official_build || | 158 } else if ((!is_nacl && !is_linux) || is_debug || is_official_build || |
| 163 is_chromecast) { | 159 is_chromecast) { |
| 164 # Linux builds slower by having symbols as part of the target binary, | 160 # Linux builds slower by having symbols as part of the target binary, |
| 165 # whereas Mac and Windows have them separate, so in Release Linux, default | 161 # whereas Mac and Windows have them separate, so in Release Linux, default |
| 166 # them off, but keep them on for Official builds and Chromecast builds. | 162 # them off, but keep them on for Official builds and Chromecast builds. |
| 167 symbol_level = 2 | 163 symbol_level = 2 |
| 168 } else if (using_sanitizer) { | 164 } else if (using_sanitizer) { |
| 169 # Sanitizers require symbols for filename suppressions to work. | 165 # Sanitizers require symbols for filename suppressions to work. |
| 170 symbol_level = 1 | 166 symbol_level = 1 |
| 171 } else { | 167 } else { |
| 172 symbol_level = 0 | 168 symbol_level = 0 |
| 173 } | 169 } |
| 174 } else if (symbol_level == 2) { | 170 } else if (symbol_level == 2) { |
| 175 if (is_win) { | 171 if (is_win) { |
| 176 # See crbug.com/630074 | 172 # See crbug.com/630074 |
| 177 assert(is_win_fastlink || !use_goma, | 173 assert(is_win_fastlink || !use_goma, |
| 178 "Goma builds that use symbol_level 2 must use is_win_fastlink.") | 174 "Goma builds that use symbol_level 2 must use is_win_fastlink.") |
| 179 } | 175 } |
| 180 } | 176 } |
| 181 | 177 |
| 178 if (use_debug_fission == "default") { |
| 179 use_debug_fission = |
| 180 symbol_level == 2 && !is_win && use_gold && cc_wrapper == "" |
| 181 } |
| 182 |
| 182 # Assert that the configuration isn't going to hit https://crbug.com/648948. | 183 # Assert that the configuration isn't going to hit https://crbug.com/648948. |
| 183 assert(ignore_elf32_limitations || !is_android || | 184 assert(ignore_elf32_limitations || !is_android || use_debug_fission || |
| 184 (android_64bit_target_cpu && !build_apk_secondary_abi) || | 185 (android_64bit_target_cpu && !build_apk_secondary_abi) || |
| 185 is_component_build || symbol_level < 2, | 186 is_component_build || symbol_level < 2, |
| 186 "Android 32-bit non-component builds cannot have symbol_level=2 " + | 187 "Android 32-bit non-component builds cannot have symbol_level=2 " + |
| 187 "due to 4GiB file size limit, see https://crbug.com/648948. " + | 188 "due to 4GiB file size limit, see https://crbug.com/648948. " + |
| 188 "If you really want to try this out, " + | 189 "If you really want to try this out, " + |
| 189 "set ignore_elf32_limitations=true.") | 190 "set ignore_elf32_limitations=true.") |
| OLD | NEW |