Skip to content

Commit

Permalink
Webkit: keep minimal symbols when remove_webcore_debug_symbols is set.
Browse files Browse the repository at this point in the history
We want to keep minimal symbols when remove_webcore_debug_symbols is
set, so that we can get readable backtrace.

On ChromeOS arm build, the size of debug file increases from
899MB to 1.244GB. It increases 245 MB.

Bug: chromium:792999
Change-Id: Ibc238308754a2727505cfbac3ce24f7a70027529
Reviewed-on: https://chromium-review.googlesource.com/862607
Reviewed-by: Dirk Pranke <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Ryo Hashimoto <[email protected]>
Commit-Queue: Yunlian Jiang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#532545}
  • Loading branch information
yunlia authored and Commit Bot committed Jan 29, 2018
1 parent 4c35374 commit aa5f218
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 27 deletions.
31 changes: 28 additions & 3 deletions third_party/WebKit/Source/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,23 @@ if (current_cpu == "arm") {
}

declare_args() {
# TODO: send a PSA out to tell people to switch to blink_symbol_level
# and remove this.
# If true, doesn't compile debug symbols into webcore reducing the
# size of the binary and increasing the speed of gdb.
remove_webcore_debug_symbols = false

# How many symbols to include in the build of blink. This affects
# the performance of the build since the symbols are large and dealing with
# them is slow.
# 2 means regular build with symbols.
# 1 means minimal symbols, usually enough for backtraces only. Symbols with
# internal linkage (static functions or those in anonymous namespaces) may not
# appear when using this level.
# 0 means no symbols.
# -1 means auto-set according to debug/release and platform.
blink_symbol_level = -1

# If true, defaults image interpolation to low quality.
use_low_quality_image_interpolation = is_android

Expand Down Expand Up @@ -63,6 +76,9 @@ if (use_default_render_theme) {
feature_defines_list += [ "WTF_USE_DEFAULT_RENDER_THEME=1" ]
}

assert(blink_symbol_level == -1 || !remove_webcore_debug_symbols,
"blink_symbol_level and remove_webcore_debug_symbols cannot both be set.")

if (remove_webcore_debug_symbols) {
if (is_win && symbol_level != 0) {
# If we use no_symbols on Windows when symbol_level is not zero then no
Expand All @@ -71,9 +87,18 @@ if (remove_webcore_debug_symbols) {
# situation keeps the build times fast (roughly identical to no_symbols)
# while still generating a PDB to keep ninja happy (and it gives us proper
# call stacks).
remove_webcore_symbols_config =
[ "//build/config/compiler:minimal_symbols" ]
blink_symbol_level = 1
} else {
remove_webcore_symbols_config = [ "//build/config/compiler:no_symbols" ]
blink_symbol_level = 0
}
}

if (blink_symbol_level == 2) {
blink_symbols_config = [ "//build/config/compiler:full_symbols" ]
} else if (blink_symbol_level == 1) {
blink_symbols_config = [ "//build/config/compiler:minimal_symbols" ]
} else if (blink_symbol_level == 0) {
blink_symbols_config = [ "//build/config/compiler:no_symbols" ]
} else {
blink_symbols_config = [ "//build/config/compiler:default_symbols" ]
}
6 changes: 2 additions & 4 deletions third_party/WebKit/Source/controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ component("controller") {
]
}

if (remove_webcore_debug_symbols) {
configs -= [ "//build/config/compiler:default_symbols" ]
configs += remove_webcore_symbols_config
}
configs -= [ "//build/config/compiler:default_symbols" ]
configs += blink_symbols_config
}

group("webkit_unit_tests_data") {
Expand Down
6 changes: 2 additions & 4 deletions third_party/WebKit/Source/core/core.gni
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ if (is_win && is_official_build) {
core_config_add += [ "//build/config/compiler:optimize_max" ]
}

if (remove_webcore_debug_symbols) {
core_config_remove += [ "//build/config/compiler:default_symbols" ]
core_config_add += remove_webcore_symbols_config
}
core_config_remove += [ "//build/config/compiler:default_symbols" ]
core_config_add += blink_symbols_config

# Use this target type to link core targets.
if (is_component_build) {
Expand Down
6 changes: 2 additions & 4 deletions third_party/WebKit/Source/modules/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,8 @@ target("jumbo_" + modules_target_type, "modules") {
cflags = [ "/wd4334" ] # Result of 32-bit shift implicitly converted to 64 bits.
}

if (remove_webcore_debug_symbols) {
configs -= [ "//build/config/compiler:default_symbols" ]
configs += remove_webcore_symbols_config
}
configs -= [ "//build/config/compiler:default_symbols" ]
configs += blink_symbols_config
}

jumbo_source_set("modules_testing") {
Expand Down
6 changes: 2 additions & 4 deletions third_party/WebKit/Source/modules/modules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ set_defaults("blink_modules_sources") {
"//third_party/WebKit/Source:non_test_config",
"//third_party/WebKit/Source:inside_blink",
]
if (remove_webcore_debug_symbols) {
configs -= [ "//build/config/compiler:default_symbols" ]
configs += remove_webcore_symbols_config
}
configs -= [ "//build/config/compiler:default_symbols" ]
configs += blink_symbols_config
}
6 changes: 2 additions & 4 deletions third_party/WebKit/Source/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1674,10 +1674,8 @@ jumbo_component("platform") {
deps += [ "//third_party/openmax_dl/dl" ]
}

if (remove_webcore_debug_symbols) {
configs -= [ "//build/config/compiler:default_symbols" ]
configs += remove_webcore_symbols_config
}
configs -= [ "//build/config/compiler:default_symbols" ]
configs += blink_symbols_config
}

jumbo_static_library("test_support") {
Expand Down
6 changes: 2 additions & 4 deletions third_party/WebKit/Source/platform/wtf/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,8 @@ jumbo_component("wtf") {
]
}

if (remove_webcore_debug_symbols) {
configs -= [ "//build/config/compiler:default_symbols" ]
configs += remove_webcore_symbols_config
}
configs -= [ "//build/config/compiler:default_symbols" ]
configs += blink_symbols_config
}

test("wtf_unittests") {
Expand Down

0 comments on commit aa5f218

Please sign in to comment.