Chromium Code Reviews| 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") |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 # Whether to emit frame pointers by default. | 69 # Whether to emit frame pointers by default. |
| 70 if (is_mac || is_ios) { | 70 if (is_mac || is_ios) { |
| 71 enabled_frame_pointers = true | 71 enabled_frame_pointers = true |
| 72 } else if (is_win) { | 72 } else if (is_win) { |
| 73 # 64-bit Windows ABI doesn't support frame pointers. | 73 # 64-bit Windows ABI doesn't support frame pointers. |
| 74 if (target_cpu == "x64") { | 74 if (target_cpu == "x64") { |
| 75 enabled_frame_pointers = false | 75 enabled_frame_pointers = false |
| 76 } else { | 76 } else { |
| 77 enabled_frame_pointers = true | 77 enabled_frame_pointers = true |
| 78 } | 78 } |
| 79 } else if (current_cpu == "arm64") { | |
| 80 # Ensure that stacks from arm64 crash dumps are usable (crbug.com/391706). | |
| 81 enabled_frame_pointers = true; | |
| 82 } else if (current_cpu == "arm") { | |
| 83 # TODO(711784): Building without frame pointers can lead to code which | |
| 84 # triggers some ARM A12/A17 errata. | |
|
diandersAtChromium
2017/04/19 17:35:25
Do we think this really happens on Android version
Wez
2017/04/19 18:14:58
That's a good question; I don't see any reason why
| |
| 85 enabled_frame_pointers = true; | |
| 79 } else { | 86 } else { |
| 80 # Explicitly ask for frame pointers, otherwise: | 87 # Explicitly ask for frame pointers, otherwise: |
| 81 # * Stacks may be missing for sanitizer and profiling builds. | 88 # * Stacks may be missing for sanitizer and profiling builds. |
| 82 # * Debug tcmalloc can crash (crbug.com/636489). | 89 # * Debug tcmalloc can crash (crbug.com/636489). |
| 83 # * Stacks may be missing for arm64 crash dumps (crbug.com/391706). | 90 enabled_frame_pointers = using_sanitizer || enable_profiling || is_debug; |
| 84 enabled_frame_pointers = | |
| 85 using_sanitizer || enable_profiling || is_debug || current_cpu == "arm64" | |
| 86 } | 91 } |
| 87 | 92 |
| 88 # Unwinding with frame pointers requires that they are enabled by default for | 93 # Unwinding with frame pointers requires that they are enabled by default for |
| 89 # most translation units, that they are emitted correctly, and that the | 94 # most translation units, that they are emitted correctly, and that the |
| 90 # compiler or platform provides a way to access them. | 95 # compiler or platform provides a way to access them. |
| 91 if (current_cpu == "arm" && arm_use_thumb) { | 96 if (current_cpu == "arm") { |
| 92 # ARM Thumb builds do not emit frame pointers correctly. | 97 # We cannot currently unwind ARM32 frame pointers correctly. |
|
erikchen
2017/04/19 02:43:57
Technically, we can never unwind all stacks on any
DmitrySkiba
2017/04/19 15:06:09
Yes, this will break Android heap profiler. We can
Wez
2017/04/19 18:14:58
Oh, interesting: gmx@ stated that we can't unwind
| |
| 93 can_unwind_with_frame_pointers = false | 98 can_unwind_with_frame_pointers = false |
| 94 } else if (is_win) { | 99 } else if (is_win) { |
| 95 # Windows 32-bit does provide frame pointers, but the compiler does not | 100 # Windows 32-bit does provide frame pointers, but the compiler does not |
| 96 # provide intrinsics to access them, so we don't use them. | 101 # provide intrinsics to access them, so we don't use them. |
| 97 can_unwind_with_frame_pointers = false | 102 can_unwind_with_frame_pointers = false |
| 98 } else { | 103 } else { |
| 99 can_unwind_with_frame_pointers = enabled_frame_pointers | 104 can_unwind_with_frame_pointers = enabled_frame_pointers |
| 100 } | 105 } |
| 101 | 106 |
| 102 declare_args() { | 107 declare_args() { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 } | 166 } |
| 162 | 167 |
| 163 # Assert that the configuration isn't going to hit https://crbug.com/648948. | 168 # Assert that the configuration isn't going to hit https://crbug.com/648948. |
| 164 assert(ignore_elf32_limitations || !is_android || | 169 assert(ignore_elf32_limitations || !is_android || |
| 165 (android_64bit_target_cpu && !build_apk_secondary_abi) || | 170 (android_64bit_target_cpu && !build_apk_secondary_abi) || |
| 166 is_component_build || symbol_level < 2, | 171 is_component_build || symbol_level < 2, |
| 167 "Android 32-bit non-component builds cannot have symbol_level=2 " + | 172 "Android 32-bit non-component builds cannot have symbol_level=2 " + |
| 168 "due to 4GiB file size limit, see https://crbug.com/648948. " + | 173 "due to 4GiB file size limit, see https://crbug.com/648948. " + |
| 169 "If you really want to try this out, " + | 174 "If you really want to try this out, " + |
| 170 "set ignore_elf32_limitations=true.") | 175 "set ignore_elf32_limitations=true.") |
| OLD | NEW |