Don't omit frame pointers in profiling Android GN builds.

This CL makes sure that frame pointers (used for fast stack unwinding)
are not omitted when enable_profiling is true. There are two changes:

1. Don't add -fomit-frame-pointer flag (Android-specific change).

2. Add -fno-omit-frame-pointer flag even in debug builds. This is needed
   for Android where debug builds are optimized too (-Os).

BUG=602701

Review-Url: https://codereview.chromium.org/1965143003
Cr-Original-Commit-Position: refs/heads/master@{#393320}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 14430a4de781aca8e67f6ec7b8893647d7ee26d9
This commit is contained in:
dskiba 2016-05-12 12:00:45 -07:00 коммит произвёл Commit bot
Родитель e02f33be24
Коммит 39b207f5fd
1 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -241,17 +241,19 @@ config("compiler") {
# Non-Mac Posix compiler flags setup.
# -----------------------------------
if (is_posix && !(is_mac || is_ios)) {
if (enable_profiling && !is_debug) {
cflags += [
"-fno-omit-frame-pointer",
"-g",
]
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" ]
if (enable_full_stack_frames_for_profiling) {
cflags += [
"-fno-inline",
"-fno-optimize-sibling-calls",
]
if (enable_full_stack_frames_for_profiling) {
cflags += [
"-fno-inline",
"-fno-optimize-sibling-calls",
]
}
}
}
@ -1209,7 +1211,7 @@ if (is_win) {
# 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 && target_cpu != "arm64") {
if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") {
common_optimize_on_cflags += [ "-fomit-frame-pointer" ]
}
@ -1299,7 +1301,7 @@ config("no_optimize") {
# 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 && target_cpu != "arm64") {
if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") {
cflags += [ "-fomit-frame-pointer" ]
}