Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: build/config/compiler/compiler.gni

Issue 2845433002: Remove enable_frame_pointers and enable frame-pointers under ChromeOS. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 # Note that doing a link repro uses a lot of disk space and slows down the 59 # Note that doing a link repro uses a lot of disk space and slows down the
60 # build, so this shouldn't be enabled on too many targets. 60 # build, so this shouldn't be enabled on too many targets.
61 # 61 #
62 # See crbug.com/669854. 62 # See crbug.com/669854.
63 linkrepro_root_dir = "" 63 linkrepro_root_dir = ""
64 64
65 # Whether or not we should use position independent code. 65 # Whether or not we should use position independent code.
66 use_pic = true 66 use_pic = true
67 } 67 }
68 68
69 # Determine the default setting for enable_frame_pointers, based on the platform 69 # Determine whether to enable or disable frame pointers, based on the platform
70 # and build arguments. 70 # and build arguments.
71 if (is_mac || is_ios) { 71 if (is_mac || is_ios) {
72 _default_enable_frame_pointers = true 72 enable_frame_pointers = true
73 } else if (is_win) { 73 } else if (is_win) {
74 # 64-bit Windows ABI doesn't support frame pointers. 74 # 64-bit Windows ABI doesn't support frame pointers.
75 if (target_cpu == "x64") { 75 if (target_cpu == "x64") {
76 _default_enable_frame_pointers = false 76 enable_frame_pointers = false
77 } else { 77 } else {
78 _default_enable_frame_pointers = true 78 enable_frame_pointers = true
79 } 79 }
80 } else if (is_chromeos) {
81 # ChromeOS requires frame pointers in x64 builds, to support CWP.
82 # TODO(711784): Building ARM Thumb without frame pointers can lead to code
83 # in ChromeOS which triggers some ARM A12/A17 errata. They can be disabled
84 # on non-x64 once that is resolved.
85 enable_frame_pointers = true
80 } else if (current_cpu == "arm64") { 86 } else if (current_cpu == "arm64") {
81 # Ensure that stacks from arm64 crash dumps are usable (crbug.com/391706). 87 # Ensure that stacks from arm64 crash dumps are usable (crbug.com/391706).
82 _default_enable_frame_pointers = true 88 enable_frame_pointers = true
83 } else if (is_chromeos && current_cpu == "arm" && arm_use_thumb) {
84 # TODO(711784): Building ARM Thumb without frame pointers can lead to code
85 # in ChromeOS which triggers some ARM A12/A17 errata.
86 _default_enable_frame_pointers = true
87 } else { 89 } else {
88 # Explicitly ask for frame pointers, otherwise: 90 # Explicitly ask for frame pointers, otherwise:
89 # * Stacks may be missing for sanitizer and profiling builds. 91 # * Stacks may be missing for sanitizer and profiling builds.
90 # * Debug tcmalloc can crash (crbug.com/636489). 92 # * Debug tcmalloc can crash (crbug.com/636489).
91 _default_enable_frame_pointers = 93 enable_frame_pointers = using_sanitizer || enable_profiling || is_debug
92 using_sanitizer || enable_profiling || is_debug
93 }
94
95 declare_args() {
96 # True if frame pointers should be generated, false otherwise.
97 enable_frame_pointers = _default_enable_frame_pointers
98 } 94 }
99 95
100 # In general assume that if we have frame pointers then we can use them to 96 # In general assume that if we have frame pointers then we can use them to
101 # unwind the stack. However, this requires that they are enabled by default for 97 # unwind the stack. However, this requires that they are enabled by default for
102 # most translation units, that they are emitted correctly, and that the 98 # most translation units, that they are emitted correctly, and that the
103 # compiler or platform provides a way to access them. 99 # compiler or platform provides a way to access them.
104 can_unwind_with_frame_pointers = enable_frame_pointers 100 can_unwind_with_frame_pointers = enable_frame_pointers
105 if (current_cpu == "arm" && arm_use_thumb) { 101 if (current_cpu == "arm" && arm_use_thumb) {
106 # We cannot currently unwind ARM Thumb frame pointers correctly. 102 # We cannot currently unwind ARM Thumb frame pointers correctly.
107 can_unwind_with_frame_pointers = false 103 can_unwind_with_frame_pointers = false
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 171 }
176 172
177 # Assert that the configuration isn't going to hit https://crbug.com/648948. 173 # Assert that the configuration isn't going to hit https://crbug.com/648948.
178 assert(ignore_elf32_limitations || !is_android || 174 assert(ignore_elf32_limitations || !is_android ||
179 (android_64bit_target_cpu && !build_apk_secondary_abi) || 175 (android_64bit_target_cpu && !build_apk_secondary_abi) ||
180 is_component_build || symbol_level < 2, 176 is_component_build || symbol_level < 2,
181 "Android 32-bit non-component builds cannot have symbol_level=2 " + 177 "Android 32-bit non-component builds cannot have symbol_level=2 " +
182 "due to 4GiB file size limit, see https://crbug.com/648948. " + 178 "due to 4GiB file size limit, see https://crbug.com/648948. " +
183 "If you really want to try this out, " + 179 "If you really want to try this out, " +
184 "set ignore_elf32_limitations=true.") 180 "set ignore_elf32_limitations=true.")
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698