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