| 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/compiler/pgo/pgo.gni") | 8 import("//build/config/compiler/pgo/pgo.gni") |
| 9 import("//build/config/sanitizers/sanitizers.gni") | 9 import("//build/config/sanitizers/sanitizers.gni") |
| 10 import("//build/toolchain/goma.gni") | 10 import("//build/toolchain/goma.gni") |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 declare_args() { | 59 declare_args() { |
| 60 # Whether to use the gold linker from binutils instead of lld or bfd. | 60 # Whether to use the gold linker from binutils instead of lld or bfd. |
| 61 use_gold = !use_lld && !(is_chromecast && is_linux && | 61 use_gold = !use_lld && !(is_chromecast && is_linux && |
| 62 (current_cpu == "arm" || current_cpu == "mipsel")) && | 62 (current_cpu == "arm" || current_cpu == "mipsel")) && |
| 63 ((is_linux && (current_cpu == "x64" || current_cpu == "x86" || | 63 ((is_linux && (current_cpu == "x64" || current_cpu == "x86" || |
| 64 current_cpu == "arm" || current_cpu == "mipsel")) || | 64 current_cpu == "arm" || current_cpu == "mipsel")) || |
| 65 (is_android && (current_cpu == "x86" || current_cpu == "x64" || | 65 (is_android && (current_cpu == "x86" || current_cpu == "x64" || |
| 66 current_cpu == "arm" || current_cpu == "arm64"))) | 66 current_cpu == "arm" || current_cpu == "arm64"))) |
| 67 } | 67 } |
| 68 | 68 |
| 69 # True if the target platform is a 64-bit architecture. |
| 70 is_target_cpu_64bit = |
| 71 target_cpu == "x64" || target_cpu == "arm64" || target_cpu == "mips64el" |
| 72 if (!is_target_cpu_64bit) { |
| 73 # Assert so that this variable is updated as new architectures are added. |
| 74 assert(target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel", |
| 75 "$target_cpu is not a supported architecture.") |
| 76 } |
| 77 |
| 69 # If it wasn't manually set, set to an appropriate default. | 78 # If it wasn't manually set, set to an appropriate default. |
| 70 assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level") | 79 assert(symbol_level >= -1 && symbol_level <= 2, "Invalid symbol_level") |
| 71 if (symbol_level == -1) { | 80 if (symbol_level == -1) { |
| 72 if (is_android && use_order_profiling) { | 81 if (is_android && use_order_profiling) { |
| 73 # With instrumentation enabled, debug info puts libchrome.so over 4gb, which | 82 # With instrumentation enabled, debug info puts libchrome.so over 4gb, which |
| 74 # causes the linker to produce an invalid ELF. http://crbug.com/574476 | 83 # causes the linker to produce an invalid ELF. http://crbug.com/574476 |
| 75 symbol_level = 0 | 84 symbol_level = 0 |
| 76 } else if (is_android && !is_component_build && !is_clang && | 85 } else if (!is_component_build && !is_clang && ((is_chromecast && |
| 77 !(android_64bit_target_cpu && !build_apk_secondary_abi)) { | 86 !is_target_cpu_64bit) || |
| 87 (is_android && |
| 88 (!is_target_cpu_64bit || |
| 89 build_apk_secondary_abi))))
{ |
| 78 # Reduce symbol level when it will cause invalid elf files to be created | 90 # Reduce symbol level when it will cause invalid elf files to be created |
| 79 # (due to file size). https://crbug.com/648948. | 91 # (due to file size): https://crbug.com/648948, https://crbug.com/670776 |
| 80 symbol_level = 1 | 92 symbol_level = 1 |
| 81 } else if (is_win && use_goma && !is_clang) { | 93 } else if (is_win && use_goma && !is_clang) { |
| 82 # goma doesn't support PDB files, so we disable symbols during goma | 94 # goma doesn't support PDB files, so we disable symbols during goma |
| 83 # compilation because otherwise the redundant debug information generated | 95 # compilation because otherwise the redundant debug information generated |
| 84 # by visual studio (repeated in every .obj file) makes linker | 96 # by visual studio (repeated in every .obj file) makes linker |
| 85 # memory consumption and link times unsustainable (crbug.com/630074). | 97 # memory consumption and link times unsustainable (crbug.com/630074). |
| 86 # Clang on windows does not have this issue. | 98 # Clang on windows does not have this issue. |
| 87 symbol_level = 1 | 99 symbol_level = 1 |
| 88 } else if (!is_linux || is_debug || is_official_build || is_chromecast) { | 100 } else if (!is_linux || is_debug || is_official_build || is_chromecast) { |
| 89 # Linux is slowed by having symbols as part of the target binary, whereas | 101 # Linux is slowed by having symbols as part of the target binary, whereas |
| 90 # Mac and Windows have them separate, so in Release Linux, default them off, | 102 # Mac and Windows have them separate, so in Release Linux, default them off, |
| 91 # but keep them on for Official builds and Chromecast builds. | 103 # but keep them on for Official builds and Chromecast builds. |
| 92 symbol_level = 2 | 104 symbol_level = 2 |
| 93 } else if (using_sanitizer) { | 105 } else if (using_sanitizer) { |
| 94 # Sanitizers require symbols for filename suppressions to work. | 106 # Sanitizers require symbols for filename suppressions to work. |
| 95 symbol_level = 1 | 107 symbol_level = 1 |
| 96 } else { | 108 } else { |
| 97 symbol_level = 0 | 109 symbol_level = 0 |
| 98 } | 110 } |
| 99 } | 111 } |
| 100 | 112 |
| 101 # Assert that the configuration isn't going to hit https://crbug.com/648948. | 113 # Assert that the configuration isn't going to hit https://crbug.com/648948. |
| 102 assert(ignore_elf32_limitations || !is_android || | 114 assert(ignore_elf32_limitations || is_component_build || symbol_level < 2 || |
| 103 (android_64bit_target_cpu && !build_apk_secondary_abi) || | 115 is_clang || |
| 104 is_component_build || symbol_level < 2 || is_clang, | 116 !(is_android && (!is_target_cpu_64bit || build_apk_secondary_abi)) || |
| 105 "Android 32-bit non-component, non-clang builds cannot have " + | 117 !(is_chromecast && !is_target_cpu_64bit), |
| 106 "symbol_level=2 due to 4GiB file size limit, see " + | 118 "Android and Chromecast 32-bit non-component, non-clang builds cannot " + |
| 119 "have symbol_level=2 due to 4GiB file size limit, see " + |
| 107 "https://crbug.com/648948. If you really want to try this out, " + | 120 "https://crbug.com/648948. If you really want to try this out, " + |
| 108 "set ignore_elf32_limitations=true.") | 121 "set ignore_elf32_limitations=true.") |
| OLD | NEW |