Skip to content

Commit

Permalink
Use DWARF4 for mac and ios simulator builds, use DWARF3 for ios devic…
Browse files Browse the repository at this point in the history
…e builds.

Removes some special-case code and potentially makes debug info a bit smaller.

Also stop passing -g2 to (non-pnacl) nacl compiles on mac, like already the case
on linux -- this helps with build determinism.

Bug: 942155,899438,906741,429358
Change-Id: Ic4c7138d232813e12426de2c161c78121bd3fc80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525041
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640963}
  • Loading branch information
nico authored and Commit Bot committed Mar 14, 2019
1 parent 6001a82 commit 889a966
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ if (gold_path == false) {
}

if (use_debug_fission == "default") {
use_debug_fission = is_debug && !is_android && !is_fuchsia && !is_win &&
(use_gold || use_lld) && cc_wrapper == ""
use_debug_fission =
is_debug && !is_android && !is_fuchsia && !is_ios && !is_mac && !is_win &&
(use_gold || use_lld) && cc_wrapper == ""
}

# default_include_dirs ---------------------------------------------------------
Expand Down Expand Up @@ -2254,40 +2255,38 @@ config("symbols") {
}
}
} else {
if (is_mac || is_ios) {
cflags = [ "-gdwarf-2" ]
if (is_mac && enable_dsyms) {
# If generating dSYMs, specify -fno-standalone-debug. This was
# originally specified for https://crbug.com/479841 because dsymutil
# could not handle a 4GB dSYM file. But dsymutil from Xcodes prior to
# version 7 also produces debug data that is incompatible with Breakpad
# dump_syms, so this is still required (https://crbug.com/622406).
cflags += [ "-fno-standalone-debug" ]
}
} else {
cflags = []
if (!use_debug_fission && current_cpu == "arm") {
# dump_syms has issues with dwarf4 on arm, https://crbug.com/744956
# TODO(thakis): Remove this again once dump_syms is fixed.
#
# debug fission needs DWARF DIEs to be emitted at version 4.
# Chrome OS emits Debug Frame in DWARF1 to make breakpad happy. [1]
# Unless Android needs debug fission, DWARF3 is the simplest solution.
#
# [1] crrev.com/a81d5ade0b043208e06ad71a38bcf9c348a1a52f
cflags += [ "-gdwarf-3" ]
}
if (is_mac && enable_dsyms) {
# If generating dSYMs, specify -fno-standalone-debug. This was
# originally specified for https://crbug.com/479841 because dsymutil
# could not handle a 4GB dSYM file. But dsymutil from Xcodes prior to
# version 7 also produces debug data that is incompatible with Breakpad
# dump_syms, so this is still required (https://crbug.com/622406).
cflags += [ "-fno-standalone-debug" ]
}
cflags = []
if (!use_debug_fission && current_cpu == "arm") {
# dump_syms has issues with dwarf4 on arm, https://crbug.com/744956
# TODO(thakis): Remove this again once dump_syms is fixed.
#
# debug fission needs DWARF DIEs to be emitted at version 4.
# Chrome OS emits Debug Frame in DWARF2's .debug_frame v1 to make breakpad
# happy [1].
# Unless Android needs debug fission, DWARF3 is the simplest solution.
#
# [1] crrev.com/a81d5ade0b043208e06ad71a38bcf9c348a1a52f
cflags += [ "-gdwarf-3" ]
}

# The gcc-based nacl compilers don't support -fdebug-compilation-dir (see
# elsewhere in this file), so they can't have build-dir-independent output.
# Disable symbols for nacl object files to get deterministic,
# build-directory-independent output. pnacl and nacl-clang do support that
# flag, so we can use use -g1 for pnacl and nacl-clang compiles.
# gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
if (!is_nacl || is_clang) {
cflags += [ "-g2" ]
}
# The gcc-based nacl compilers don't support -fdebug-compilation-dir (see
# elsewhere in this file), so they can't have build-dir-independent output.
# Disable symbols for nacl object files to get deterministic,
# build-directory-independent output. pnacl and nacl-clang do support that
# flag, so we can use use -g1 for pnacl and nacl-clang compiles.
# gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.
if (!is_nacl || is_clang) {
cflags += [ "-g2" ]
}

if (use_debug_fission && !is_nacl && !is_android) {
# NOTE: Some Chrome OS builds globally set |use_debug_fission| to true,
# but they also build some targets against Android toolchains which aren't
Expand Down

0 comments on commit 889a966

Please sign in to comment.