diff --git a/third_party/WebKit/Source/config.gni b/third_party/WebKit/Source/config.gni index 73f25a10b702b3..bb4825d832575a 100644 --- a/third_party/WebKit/Source/config.gni +++ b/third_party/WebKit/Source/config.gni @@ -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 @@ -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 @@ -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" ] +} diff --git a/third_party/WebKit/Source/controller/BUILD.gn b/third_party/WebKit/Source/controller/BUILD.gn index d10cff4a0fddf8..cf5e741edda553 100644 --- a/third_party/WebKit/Source/controller/BUILD.gn +++ b/third_party/WebKit/Source/controller/BUILD.gn @@ -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") { diff --git a/third_party/WebKit/Source/core/core.gni b/third_party/WebKit/Source/core/core.gni index f1f7963faae310..98d6a11ccbb801 100644 --- a/third_party/WebKit/Source/core/core.gni +++ b/third_party/WebKit/Source/core/core.gni @@ -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) { diff --git a/third_party/WebKit/Source/modules/BUILD.gn b/third_party/WebKit/Source/modules/BUILD.gn index 6537cbf2edaeab..2454cd6f47047a 100644 --- a/third_party/WebKit/Source/modules/BUILD.gn +++ b/third_party/WebKit/Source/modules/BUILD.gn @@ -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") { diff --git a/third_party/WebKit/Source/modules/modules.gni b/third_party/WebKit/Source/modules/modules.gni index 368956c8c69f21..93c2f23082faaf 100644 --- a/third_party/WebKit/Source/modules/modules.gni +++ b/third_party/WebKit/Source/modules/modules.gni @@ -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 } diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index b7b1d7b721e663..b7485f2e59ea3d 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn @@ -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") { diff --git a/third_party/WebKit/Source/platform/wtf/BUILD.gn b/third_party/WebKit/Source/platform/wtf/BUILD.gn index fb9704e406574f..20672f76a155a1 100644 --- a/third_party/WebKit/Source/platform/wtf/BUILD.gn +++ b/third_party/WebKit/Source/platform/wtf/BUILD.gn @@ -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") {