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

Unified Diff: build/config/compiler/BUILD.gn

Issue 2266073002: Explicitly ask for stack frame pointers on Debug posix builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move stack frame flag to it's own config. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 79723f6cc76c041697955f5c7de91e2935e78aa5..fad39ce24cfc273c3e20b306488bd4479a322159 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -232,9 +232,6 @@ config("compiler") {
# -----------------------------------
if (is_posix && !(is_mac || is_ios)) {
if (enable_profiling) {
- # Explicitly ask for frame pointers. Otherwise they are omitted when
- # any optimization level is used (and Android debug builds use -Os).
- cflags += [ "-fno-omit-frame-pointer" ]
if (!is_debug) {
cflags += [ "-g" ]
@@ -1238,13 +1235,6 @@ if (is_win) {
common_optimize_on_ldflags = []
if (is_android) {
- # We don't omit frame pointers on arm64 since they are required
- # to correctly unwind stackframes which contain system library
- # function frames (crbug.com/391706).
- if (!using_sanitizer && !enable_profiling && current_cpu != "arm64") {
- common_optimize_on_cflags += [ "-fomit-frame-pointer" ]
brettw 2016/08/23 22:26:43 This was lost. It's not clear to me that the inten
vmiura 2016/08/23 23:16:18 You're right. I removed this here as well as the
vmiura 2016/08/24 00:14:45 Thinking some more, we probably want to force -fom
vmiura 2016/08/24 01:06:50 Done.
- }
-
# TODO(jdduke) Re-enable on mips after resolving linking
# issues with libc++ (crbug.com/456380).
if (current_cpu != "mipsel" && current_cpu != "mips64el") {
@@ -1298,6 +1288,19 @@ if (is_win) {
}
}
+config("default_stack_frames") {
+ if (is_posix && !(is_mac || is_ios)) {
+ if (using_sanitizer || enable_profiling || is_debug ||
+ current_cpu == "arm64") {
+ # Explicitly ask for frame pointers, otherwise:
+ # * Stacks may be missing for sanitizer and profiling builds.
+ # * Debug tcmalloc can crash (crbug.com/636489).
+ # * Stacks may be missing for arm64 crash dumps (crbug.com/391706).
+ cflags = [ "-fno-omit-frame-pointer" ]
+ }
+ }
+}
+
# Default "optimization on" config.
config("optimize") {
if (is_win) {
@@ -1357,13 +1360,6 @@ config("no_optimize") {
"-ffunction-sections",
]
- # We don't omit frame pointers on arm64 since they are required
- # to correctly unwind stackframes which contain system library
- # function frames (crbug.com/391706).
- if (!using_sanitizer && !enable_profiling && current_cpu != "arm64") {
- cflags += [ "-fomit-frame-pointer" ]
- }
-
# Don't use gc-sections since it can cause links to succeed when they
# actually shouldn't. http://crbug.com/159847
ldflags = common_optimize_on_ldflags - [ "-Wl,--gc-sections" ]
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698