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

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

Issue 2782063005: Explicitly specify whether to emit frame pointers by default. (Closed)
Patch Set: arm64 -> arm Created 3 years, 8 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 | « base/trace_event/memory_dump_manager.cc ('k') | build/config/compiler/compiler.gni » ('j') | 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 08e9a9ef988737dcc6eaedee39e7b0021f20df0b..d20b3333fdf3d259378345043a6a2568d1a33335 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1381,18 +1381,22 @@ 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).
+ if (is_posix) {
+ if (enabled_frame_pointers) {
cflags = [ "-fno-omit-frame-pointer" ]
- } else if (is_android) {
+ } else {
cflags = [ "-fomit-frame-pointer" ]
}
}
+ # On Windows, the flag to enable framepointers "/Oy-" must always come after
+ # the optimization flag [e.g. "/O2"]. The optimization flag is set by one of
+ # the "optimize" configs, see rest of this file. The ordering that cflags are
+ # applied is well-defined by the GN spec, and there is no way to ensure that
+ # cflags set by "default_stack_frames" is applied after those set by an
+ # "optimize" config. Similarly, there is no way to propagate state from this
+ # config into the "optimize" config. We always apply the "/Oy-" config in the
+ # definition for common_optimize_on_cflags definition, even though this may
+ # not be correct.
}
# Default "optimization on" config.
« no previous file with comments | « base/trace_event/memory_dump_manager.cc ('k') | build/config/compiler/compiler.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698