New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 735101 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Blocked on:
issue 746505

Blocking:
issue 607968



Sign in to add a comment

lld fails to compute relocations on x86-64 on linux and fuchsia in debug builds

Project Member Reported by thakis@chromium.org, Jun 20 2017

Issue description

I figured I'd benchmark using lld for regular builds on linux.

thakis@thakis:~/src/chrome/src$ time ninja -C out/gn -j1000 chrome 
ninja: Entering directory `out/gn'
[5721/32095] SOLINK ./libprotobuf_lite.so
error: failed to compute relocation: R_X86_64_DTPOFF64
[7057/32095] SOLINK ./libbase.so
error: failed to compute relocation: R_X86_64_DTPOFF64
[7629/32095] LINK ./proto_zero_plugin
error: failed to compute relocation: R_X86_64_DTPOFF64
[7630/32095] LINK ./protoc
error: failed to compute relocation: R_X86_64_DTPOFF64
[11343/32095] SOLINK swiftshader/libGLESv2.so
error: failed to compute relocation: R_X86_64_DTPOFF64
error: failed to compute relocation: R_X86_64_DTPOFF64
error: failed to compute relocation: R_X86_64_DTPOFF64
[17457/32095] SOLINK ./libGLESv2.so
error: failed to compute relocation: R_X86_64_DTPOFF64


args.gn is:
use_goma = true
use_lld = true


We already use lld for LTO'd production builds -- I'm guessing we don't see that there because those are not debug builds?


Also, despite lld writing `error: `, it doesn't actually fail, it exits cleanly and writes an output file (which might be corrupt?) If lld prints `error: ` then it should exit with a non-0 exit code and not write its output.
 

Comment 1 by p...@chromium.org, Jun 20 2017

This was with --gdb-index enabled, right?

I think there are still a few known issues with lld's --gdb-index support. This one in particular was being fixed in https://reviews.llvm.org/D33673 but it looks like that work has stalled for some reason.

Perhaps for now we should disable --gdb-index with lld.

Comment 2 by thakis@chromium.org, Jun 20 2017

Yes, just the default settings.

I think we can just wait. Switching the default is blocked on having a working --gdb-index (someone told me a while ago that work is ongoing, so I figured it's probably in a decent spot by now :-P), and if we make the defaults very different for use_lld, then it's easy to forget about the different defaults when doing benchmarks (e.g.  issue 735126 ).

Comment 3 by thakis@chromium.org, Jun 30 2017

Cc: jam...@chromium.org thakis@chromium.org phosek@chromium.org mcgrathr@chromium.org
 Issue 738552  has been merged into this issue.

Comment 4 by thakis@chromium.org, Jun 30 2017

Summary: lld fails to compute relocations on x86-64 on linux and fuchsia in debug builds (was: lld fails to compute relocations on x86-64 on linux in debug builds)
Also affects fuchsia builds. We use lld by default there.
Cc: scottmg@chromium.org
Project Member

Comment 6 by bugdroid1@chromium.org, Jul 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3e629c165a838883cd338801810068a6fdcc5c6d

commit 3e629c165a838883cd338801810068a6fdcc5c6d
Author: Nico Weber <thakis@chromium.org>
Date: Wed Jul 12 18:49:25 2017

Disable --gdb-index in fuchsia builds for now.

fuchsia builds use lld by default, and it looks like the recent clang roll
made this "error" an actual error (meaning it makes the link fail) in lld.

So disable --gdb-index for now to get the fuchsia builds green. Don't disable
for use_lld in general so we don't forget to fix this before enabling
lld on linux.

Bug:  735101 , 735328 
Change-Id: Iadf2547af91d2c15290824ada6dddc5c15b40426
Reviewed-on: https://chromium-review.googlesource.com/568678
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486038}
[modify] https://crrev.com/3e629c165a838883cd338801810068a6fdcc5c6d/build/config/compiler/BUILD.gn

Comment 7 by thakis@chromium.org, Jul 12 2017

(llvm r307370 addressed the 2nd half of comment 0 in that this error is now actually an error that aborts the build)

Comment 8 by thakis@chromium.org, Jul 28 2017

Looks like r308544 fixed the relocation.
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8c2b2e019a91c196969a473c64c189a2cf0701af

commit 8c2b2e019a91c196969a473c64c189a2cf0701af
Author: Nico Weber <thakis@chromium.org>
Date: Fri Jul 28 21:43:49 2017

fuchsia: Reenable -Wl,-gdb-index

lld should support the relocation types needed for this by now.
This reverts https://chromium-review.googlesource.com/568678

Bug:  735101 
Change-Id: I4c85445fc8f045acf0eb569dbf46fbd1d52aebe0
Reviewed-on: https://chromium-review.googlesource.com/591618
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490517}
[modify] https://crrev.com/8c2b2e019a91c196969a473c64c189a2cf0701af/build/config/compiler/BUILD.gn

Blockedon: 746505
Status: Fixed (was: Untriaged)

Sign in to add a comment