-mapcs-frame is a gcc flag that stores frame pointer in a reliable location that allows frame unwinding for perf. In gyp this flag was passed for arm profiling builds and it looks like it got lost in the gyp->gn transition.
However, this flag causes Chrome to crash in conjunction with arm_use_thumb = false. The stack trace wasn't symbolized. It also crashes if I add an explicit -marm in addition to not using thumb. It does not crash if thumb is allowed. So explicit -marm does not make a difference.
I added -mapcs-frame by changing the default_stack_frames config like this:
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" ]
} else if (is_android) {
cflags = [ "-fomit-frame-pointer" ]
}
}
if (is_android && enable_profiling && current_cpu == "arm") {
cflags += [ "-mapcs-frame" ]
}
}
And -marm to compiler_arm config (or you can add it to compiler_arm_thumb if you like) like this:
config("compiler_arm") {
if (current_cpu == "arm" && is_chromeos) {
# arm is normally the default mode for clang, but on chromeos a wrapper
# is used to pass -mthumb, and therefor change the default.
cflags = [ "-marm" ]
}
if (current_cpu == "arm" && is_android && !arm_use_thumb) {
cflags = [ "-marm" ]
}
}
I verified that both flags are passed to the compiler (goma).
gn args:
target_os = "android"
target_cpu = "arm"
is_debug = false
is_component_build = false
enable_nacl = false
ffmpeg_branding = "Chrome"
proprietary_codecs = true
use_goma = true
enable_profiling = true
remove_webcore_debug_symbols = true
symbol_level = 2
ignore_elf32_limitations = true
arm_use_thumb = false