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

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: 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 | « no previous file | 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..7e65dfa41cf0301123c3af3e376133a59d6eb3fb 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -231,10 +231,13 @@ config("compiler") {
# Non-Mac Posix compiler flags setup.
# -----------------------------------
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).
+ if (enable_profiling || is_debug) {
+ # Explicitly ask for frame pointers, otherwise they are omitted when
+ # any optimization level is used (Android debug builds use -Os.)
+ # This prevents stack frames from working when profiling, and can cause
+ # crashes when unwinding stack frames (crbug.com/636489).
Dirk Pranke 2016/08/22 20:03:48 Do we have any idea what the perf impact of -fno-o
vmiura 2016/08/22 20:32:04 I don't have data but I expect the impact is fairl
cflags += [ "-fno-omit-frame-pointer" ]
+
if (!is_debug) {
cflags += [ "-g" ]
@@ -1274,6 +1277,13 @@ if (is_win) {
"-ffunction-sections",
]
+ if (is_debug) {
+ # Explicitly ask for frame pointers, otherwise they are omitted when
+ # any optimization level is used and can cause crashes when unwinding
+ # stack frames (crbug.com/636489).
+ common_optimize_on_cflags += [ "-fno-omit-frame-pointer" ]
+ }
+
common_optimize_on_ldflags += [
# Specifically tell the linker to perform optimizations.
# See http://lwn.net/Articles/192624/ .
« 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