Skip to content

Commit

Permalink
Pass '-gno-inline-line-tables' to clang to limit debuginfo size on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Jan 10, 2020
1 parent be81eec commit 65d7972
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,21 @@ config("minimal_symbols") {
if (!is_nacl || is_clang) {
cflags += [ "-g1" ]
}

# On Linux, debug info is usually embedded in the executable itself. We use
# the 'minimal_symbols' config for official builds to limit the size of this
# embedded debug info to keep the distributed binaries reasonably small.
# However when V8 is built with `clang -g1`, approximately 40MB of debug
# data is added to the final executable, mostly in the form of
# `DW_TAG_inlined_subroutine` tags. Leaving out those tags reduces the size
# of the debug sections to a much more reasonable 5MB while still providing
# pretty usable stack traces when the application crashes.
if (is_linux && is_clang) {
cflags += [ "-gno-inline-line-tables" ]
}

ldflags = []

if (is_android && is_clang) {
# Android defaults to symbol_level=1 builds in production builds
# (https://crbug.com/648948), but clang, unlike gcc, doesn't emit
Expand Down

0 comments on commit 65d7972

Please sign in to comment.