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

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

Issue 1965143003: Don't omit frame pointers in profiling GN builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/nacl/config.gni") 8 import("//build/config/nacl/config.gni")
9 import("//build/toolchain/cc_wrapper.gni") 9 import("//build/toolchain/cc_wrapper.gni")
10 import("//build/toolchain/toolchain.gni") 10 import("//build/toolchain/toolchain.gni")
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 # This is here so that all files get recompiled after a clang roll and 234 # This is here so that all files get recompiled after a clang roll and
235 # when turning clang on or off. (defines are passed via the command line, 235 # when turning clang on or off. (defines are passed via the command line,
236 # and build system rebuild things when their commandline changes). Nothing 236 # and build system rebuild things when their commandline changes). Nothing
237 # should ever read this define. 237 # should ever read this define.
238 defines += [ "CR_CLANG_REVISION=$clang_revision" ] 238 defines += [ "CR_CLANG_REVISION=$clang_revision" ]
239 } 239 }
240 240
241 # Non-Mac Posix compiler flags setup. 241 # Non-Mac Posix compiler flags setup.
242 # ----------------------------------- 242 # -----------------------------------
243 if (is_posix && !(is_mac || is_ios)) { 243 if (is_posix && !(is_mac || is_ios)) {
244 if (enable_profiling && !is_debug) { 244 if (enable_profiling) {
245 cflags += [ 245 # Explicitly ask for frame pointers. Otherwise they are omitted when
246 "-fno-omit-frame-pointer", 246 # any optimization level is used (and Android debug builds use -Os).
247 "-g", 247 cflags += [ "-fno-omit-frame-pointer" ]
248 ] 248 if (!is_debug) {
249 cflags += [ "-g" ]
249 250
250 if (enable_full_stack_frames_for_profiling) { 251 if (enable_full_stack_frames_for_profiling) {
251 cflags += [ 252 cflags += [
252 "-fno-inline", 253 "-fno-inline",
253 "-fno-optimize-sibling-calls", 254 "-fno-optimize-sibling-calls",
254 ] 255 ]
256 }
255 } 257 }
256 } 258 }
257 259
258 defines += [ "_FILE_OFFSET_BITS=64" ] 260 defines += [ "_FILE_OFFSET_BITS=64" ]
259 261
260 if (!is_android) { 262 if (!is_android) {
261 defines += [ 263 defines += [
262 "_LARGEFILE_SOURCE", 264 "_LARGEFILE_SOURCE",
263 "_LARGEFILE64_SOURCE", 265 "_LARGEFILE64_SOURCE",
264 ] 266 ]
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 # can be removed at link time with --gc-sections. 1204 # can be removed at link time with --gc-sections.
1203 "-fdata-sections", 1205 "-fdata-sections",
1204 "-ffunction-sections", 1206 "-ffunction-sections",
1205 ] 1207 ]
1206 common_optimize_on_ldflags = [] 1208 common_optimize_on_ldflags = []
1207 1209
1208 if (is_android) { 1210 if (is_android) {
1209 # We don't omit frame pointers on arm64 since they are required 1211 # We don't omit frame pointers on arm64 since they are required
1210 # to correctly unwind stackframes which contain system library 1212 # to correctly unwind stackframes which contain system library
1211 # function frames (crbug.com/391706). 1213 # function frames (crbug.com/391706).
1212 if (!using_sanitizer && target_cpu != "arm64") { 1214 if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") {
1213 common_optimize_on_cflags += [ "-fomit-frame-pointer" ] 1215 common_optimize_on_cflags += [ "-fomit-frame-pointer" ]
1214 } 1216 }
1215 1217
1216 # TODO(jdduke) Re-enable on mips after resolving linking 1218 # TODO(jdduke) Re-enable on mips after resolving linking
1217 # issues with libc++ (crbug.com/456380). 1219 # issues with libc++ (crbug.com/456380).
1218 if (current_cpu != "mipsel" && current_cpu != "mips64el") { 1220 if (current_cpu != "mipsel" && current_cpu != "mips64el") {
1219 common_optimize_on_ldflags += [ 1221 common_optimize_on_ldflags += [
1220 # Warn in case of text relocations. 1222 # Warn in case of text relocations.
1221 "-Wl,--warn-shared-textrel", 1223 "-Wl,--warn-shared-textrel",
1222 ] 1224 ]
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 # much even when optimization is disabled to get the binary size down. 1294 # much even when optimization is disabled to get the binary size down.
1293 cflags = [ 1295 cflags = [
1294 "-Os", 1296 "-Os",
1295 "-fdata-sections", 1297 "-fdata-sections",
1296 "-ffunction-sections", 1298 "-ffunction-sections",
1297 ] 1299 ]
1298 1300
1299 # We don't omit frame pointers on arm64 since they are required 1301 # We don't omit frame pointers on arm64 since they are required
1300 # to correctly unwind stackframes which contain system library 1302 # to correctly unwind stackframes which contain system library
1301 # function frames (crbug.com/391706). 1303 # function frames (crbug.com/391706).
1302 if (!using_sanitizer && target_cpu != "arm64") { 1304 if (!using_sanitizer && !enable_profiling && target_cpu != "arm64") {
1303 cflags += [ "-fomit-frame-pointer" ] 1305 cflags += [ "-fomit-frame-pointer" ]
1304 } 1306 }
1305 1307
1306 # Don't use gc-sections since it can cause links to succeed when they 1308 # Don't use gc-sections since it can cause links to succeed when they
1307 # actually shouldn't. http://crbug.com/159847 1309 # actually shouldn't. http://crbug.com/159847
1308 ldflags = common_optimize_on_ldflags - [ "-Wl,--gc-sections" ] 1310 ldflags = common_optimize_on_ldflags - [ "-Wl,--gc-sections" ]
1309 } else { 1311 } else {
1310 cflags = [ "-O0" ] 1312 cflags = [ "-O0" ]
1311 ldflags = [] 1313 ldflags = []
1312 } 1314 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 1455
1454 if (is_ios || is_mac) { 1456 if (is_ios || is_mac) {
1455 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1457 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1456 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1458 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1457 config("enable_arc") { 1459 config("enable_arc") {
1458 common_flags = [ "-fobjc-arc" ] 1460 common_flags = [ "-fobjc-arc" ]
1459 cflags_objc = common_flags 1461 cflags_objc = common_flags
1460 cflags_objcc = common_flags 1462 cflags_objcc = common_flags
1461 } 1463 }
1462 } 1464 }
OLDNEW
« 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