question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getting bad gold linker value

See original GitHub issue

ATTENTION! Please read and follow:

  • if this is a question about how to build / test / query / deploy using Bazel, or a discussion starter, send it to bazel-discuss@googlegroups.com
  • if this is a bug or feature request, fill the form below as best as you can.

Description of the problem / feature request:

building bazel from source for the first time and getting below error: gcc: error: unrecognized command line option ‘-fuse-ld=–enable-gold=yes’

the issue is unix_cc_configure.bzl where it is trying to determine whether ‘-fuse-ld=gold’ is set. It is going through each line to find first line that contains the word ‘gold’. Unfortunately, it found below line and return flag as ‘–enable-gold=yes’: x86-64.rhel.6 --enable-gold=yes --enable-tls --enable-rpath --enable-shared --enable-languages=c,c++,objc,fortran

Feature requests: what underlying problem are you trying to solve with this feature?

Replace this line with your answer.

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Replace this line with your answer.

What operating system are you running Bazel on?

redhat 6

What’s the output of bazel info release?

If bazel info release returns “development version” or “(@non-git)”, tell us how you built Bazel.

Replace this line with your answer.

What’s the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Replace this line with your answer.

Have you found anything relevant by searching the web?

Replace these lines with your answer.

Places to look:

Any other information, logs, or outputs that you want to share?

Replace these lines with your answer.

If the files are large, upload as attachment or provide link.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boegelcommented, Sep 26, 2019

I saw the same issue, was able to dance around it with this patch:

--- tools/cpp/unix_cc_configure.bzl.orig        2019-09-26 20:39:13.350751339 +0200
+++ tools/cpp/unix_cc_configure.bzl     2019-09-26 20:39:44.033325970 +0200
@@ -200,6 +200,8 @@
         for flag in line.split(" "):
             if flag.find("gold") == -1:
                 continue
+            if flag.find("enable-gold") > -1 or flag.find("with-plugin-ld") > -1:
+                continue

             # flag is '-fuse-ld=gold' for GCC or "/usr/lib/ld.gold" for Clang
             # strip space, single quote, and double quotes
0reactions
hlopkocommented, Nov 25, 2019

I fixed the issue in the rules_cc repo so you can use that instead of the snapshot of it that is distributed with Bazel (so you don’t have to wait for Bazel release).

And TBH, I just forgot to fix it in Bazel. Will do that this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getting bad gold linker value #8256 - envoyproxy/envoy - GitHub
Issue Template Title: getting bad gold linker value Description: ... the bug, for example: Envoy should not crash, the expected value isn't
Read more >
[Linux] Gold linker should not be the default system linker
Hi Folks,. Google's Linux kernel team has found several cases where the gold linker does not correctly link kernel modules, resulting in computers...
Read more >
Striking gold in binutils - LWN.net
Once gold gets to that point, Taylor is already thinking about concurrent linking—running compiler and linker at the same time—as the next big...
Read more >
Gold linker fails (#13810) · Issues - GHC - Haskell GitLab
When using gold linker in the project, the compilation fails. The same error occurs even when using nix, without stack.
Read more >
GoldIncompatibilities - Fedora Project Wiki
Gold will not use indirect dependent shared libraries to resolve symbols in the main program whereas the old GNU linker will search indirect ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found