Skip to content

Commit

Permalink
Enable strip_absolute_paths_from_debug_symbol on windows build with g…
Browse files Browse the repository at this point in the history
…oma by default

By this CL, we remove absolute path from obj files in windows build with goma.
And this allows to share build result even if it is built in different directory.
This will give faster build time to windows developers and also let goma team focus on cache hit build more.

This change removes absolute path from obj files, but lld linker absolutizes the path not to confuse debugger.
Also this CL enables the feature by default only for lld with goma build on windows.

Build stats of chrome on Z840 windows with -j1000
* is_debug=true and symbol_level=2
cache hit: 658 seconds
non-cache hit: 728 seconds

* is_debug=false and symbol_level=0
cache hit: 275 seconds
non-cache hit: 411 seconds

TODO: add build speed comparison of cache hit/no-hit build in symbol_level = 0 and symbol_level = 2

Bug: 712796
Change-Id: I88532a43addf693f93b30c96d08c8e93515d4344
Reviewed-on: https://chromium-review.googlesource.com/1143663
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577807}
  • Loading branch information
Takuto Ikuta authored and Commit Bot committed Jul 25, 2018
1 parent 7e0c92b commit 4ea122b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ declare_args() {
auto_profile_path = ""

# Optimize symbol files for maximizing goma cache hit rate. This is on by
# default only when goma is enabled on Linux because setting this to true may
# make it harder to debug binaries.
# default when goma is enabled on Linux and Windows.
# But setting this to true may make it harder to debug binaries on Linux.
# See below reference for detail.
# https://chromium.googlesource.com/chromium/src/+/master/docs/linux_debugging.md#Source-level-debug-with-fdebug_compilation_dir
strip_absolute_paths_from_debug_symbols = is_linux && use_goma
strip_absolute_paths_from_debug_symbols =
(is_linux || (is_win && use_lld)) && use_goma

# Allow projects that wish to stay on C++11 to override Chromium's default.
use_cxx11 = false
Expand Down Expand Up @@ -508,7 +509,6 @@ config("compiler") {
}

# Makes builds independent of absolute file path.
# clang-cl (used if is_win) doesn't expose this flag.
# Currently disabled for nacl since its toolchain lacks this flag (too old).
# TODO(zforman): Once nacl's toolchain is updated, remove check.
if (symbol_level != 0 && is_clang && !is_nacl && !is_mac && !is_ios &&
Expand All @@ -524,6 +524,11 @@ config("compiler") {
"-Xclang",
".",
]

if (is_win && use_lld) {
# Absolutize source file path for PDB.
ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ]
}
}

# Tells the compiler not to use absolute paths when passing the default
Expand Down

0 comments on commit 4ea122b

Please sign in to comment.