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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 2782063005: Explicitly specify whether to emit frame pointers by default. (Closed)
Patch Set: Clean up. 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/chromecast_build.gni") 7 import("//build/config/chromecast_build.gni")
8 import("//build/config/compiler/compiler.gni") 8 import("//build/config/compiler/compiler.gni")
9 import("//build/config/nacl/config.gni") 9 import("//build/config/nacl/config.gni")
10 import("//build/toolchain/cc_wrapper.gni") 10 import("//build/toolchain/cc_wrapper.gni")
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1374 common_optimize_on_ldflags += [ 1374 common_optimize_on_ldflags += [
1375 # Specifically tell the linker to perform optimizations. 1375 # Specifically tell the linker to perform optimizations.
1376 # See http://lwn.net/Articles/192624/ . 1376 # See http://lwn.net/Articles/192624/ .
1377 "-Wl,-O1", 1377 "-Wl,-O1",
1378 "-Wl,--gc-sections", 1378 "-Wl,--gc-sections",
1379 ] 1379 ]
1380 } 1380 }
1381 } 1381 }
1382 1382
1383 config("default_stack_frames") { 1383 config("default_stack_frames") {
1384 if (is_posix && !(is_mac || is_ios)) { 1384 if (is_posix) {
1385 if (using_sanitizer || enable_profiling || is_debug || 1385 if (enabled_frame_pointers) {
1386 current_cpu == "arm64") {
1387 # Explicitly ask for frame pointers, otherwise:
1388 # * Stacks may be missing for sanitizer and profiling builds.
1389 # * Debug tcmalloc can crash (crbug.com/636489).
1390 # * Stacks may be missing for arm64 crash dumps (crbug.com/391706).
1391 cflags = [ "-fno-omit-frame-pointer" ] 1386 cflags = [ "-fno-omit-frame-pointer" ]
1392 } else if (is_android) { 1387 } else {
1393 cflags = [ "-fomit-frame-pointer" ] 1388 cflags = [ "-fomit-frame-pointer" ]
1394 } 1389 }
1395 } 1390 }
1391 # On Windows, the flag to enable framepointers "/Oy-" must always come after
1392 # the optimization flag [e.g. "/O2"]. The optimization flag is set by one of
1393 # the "optimize" configs, see rest of this file. The ordering that cflags are
1394 # applied is well-defined by the GN spec, and there is no way to ensure that
1395 # cflags set by "default_stack_frames" is applied after those set by an
1396 # "optimize" confnig. Similarly, there is no way to propagate state from this
brettw 2017/04/03 21:17:42 confnig spelling
1397 # config into the "optimize" config. We always apply the "/Oy-" config in the
1398 # definition for common_optimize_on_cflags definition, even though this may
1399 # not be correct.
1396 } 1400 }
1397 1401
1398 # Default "optimization on" config. 1402 # Default "optimization on" config.
1399 config("optimize") { 1403 config("optimize") {
1400 if (is_win) { 1404 if (is_win) {
1401 # TODO(thakis): Remove is_clang here, https://crbug.com/598772 1405 # TODO(thakis): Remove is_clang here, https://crbug.com/598772
1402 if (is_official_build && full_wpo_on_official && !is_clang) { 1406 if (is_official_build && full_wpo_on_official && !is_clang) {
1403 common_optimize_on_cflags += [ 1407 common_optimize_on_cflags += [
1404 "/GL", # Whole program optimization. 1408 "/GL", # Whole program optimization.
1405 1409
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 1716
1713 if (is_ios || is_mac) { 1717 if (is_ios || is_mac) {
1714 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1718 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1715 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1719 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1716 config("enable_arc") { 1720 config("enable_arc") {
1717 common_flags = [ "-fobjc-arc" ] 1721 common_flags = [ "-fobjc-arc" ]
1718 cflags_objc = common_flags 1722 cflags_objc = common_flags
1719 cflags_objcc = common_flags 1723 cflags_objcc = common_flags
1720 } 1724 }
1721 } 1725 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698