Skip to content

Commit

Permalink
Ignore is_win_fastlink when linking with lld rather than asserting
Browse files Browse the repository at this point in the history
lld doesn't support /debug:fastlink, and so we used to assert when
trying to use those two together.

However, as we're planning to switch over to lld by default, we don't
want to break the builds of those who have specified is_win_fastlink
manually. Instead, ignore the flag when linking with lld, and eventually
it will be phased out altogether.

Bug: 792131
Change-Id: I83ff749254d4dbc55aedbfc6e87702e8e8a06a23
Reviewed-on: https://chromium-review.googlesource.com/966225
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543714}
  • Loading branch information
zmodem authored and Commit Bot committed Mar 16, 2018
1 parent 83d6e44 commit 8299aa5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1968,8 +1968,11 @@ config("symbols") {
cflags = [ "/Zi" ] # Produce PDB file, no edit and continue.
}

if (is_win_fastlink) {
assert(!use_lld, "is_win_fastlink=true cannot be used with use_lld=true.")
if (is_win_fastlink && !use_lld) {
# TODO(hans): is_win_fastlink=true is incompatible with use_lld. However,
# some developers might have enabled it manually, so to ease the
# transition to lld, just ignore it rather than asserting. Eventually we
# want to assert instead.

# Tell VS 2015+ to create a PDB that references debug
# information in .obj and .lib files instead of copying
Expand All @@ -1982,7 +1985,7 @@ config("symbols") {
if (is_clang) {
# /DEBUG:FASTLINK requires every object file to have standalone debug
# information.
if (is_win_fastlink) {
if (is_win_fastlink && !use_lld) {
cflags += [ "-fstandalone-debug" ]
} else {
cflags += [ "-fno-standalone-debug" ]
Expand Down
2 changes: 1 addition & 1 deletion build/config/win/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ config("compiler") {
ldflags = [ "/PROFILE" ]
} else {
if (!is_debug && !is_component_build) {
if (is_win_fastlink) {
if (is_win_fastlink && !use_lld) {
# /PROFILE implies the following linker flags. Therefore if we are
# skipping /PROFILE because it is incompatible with /DEBUG:FASTLINK
# we should explicitly add these flags in order to avoid unintended
Expand Down

0 comments on commit 8299aa5

Please sign in to comment.