Bug 1269279 - GCC does not find gold linker if it is not in PATH
GCC does not find gold linker if it is not in PATH
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc (Show other bugs)
DTS 3.1 RHEL 6
Unspecified Unspecified
unspecified Severity unspecified
: beta2
: 4.0
Assigned To: Jakub Jelinek
Miroslav Franc
Depends On:
  Show dependency treegraph
Reported: 2015-10-06 16:48 EDT by Gregor Jasny
Modified: 2016-01-31 21:30 EST (History)
7 users (show)

See Also:
Fixed In Version: devtoolset-4-gcc-5.2.1-2.2.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-16 10:11:05 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Gregor Jasny 2015-10-06 16:48:27 EDT
Description of problem:
  In our build scripts we point cmake to the DTS compiler by using the absolute path (/opt/rh/devtoolset-3/root/usr/bin/gcc).

  If we now add -fuse-ld=gold it cannot find the linker:

  collect2: fatal error: cannot find 'ld'

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
0. Do not have devtoolset in PATH
1. echo 'int main() { return 0; }' > main.c
2. /opt/rh/devtoolset-3/root/usr/bin/gcc -fuse-ld=gold main.c

Actual results:

  collect2: fatal error: cannot find 'ld'

Expected results:

  links without problems

Additional info:

  An strace shows the following (linker related):

10360 stat("/usr/opt/rh/devtoolset-3/root/usr/bin/../libexec/gcc/x86_64-redhat-linux/4.9.2/ld.gold", 0x7fff40df82b0) = -1 ENOENT (No such file or directory)
10360 stat("/usr/opt/rh/devtoolset-3/root/usr/bin/../libexec/gcc/ld.gold", 0x7fff40df82b0) = -1 ENOENT (No such file or directory)

  So the problem should be gone if gcc would provide in x86_64-redhat-linux/4.9.2 not only a symlink to ld but also to ld.gold and ld.bfd. If I create the symlink there manually it works as expected.

Could you please provide the needed symlinks?

Comment 1 Gregor Jasny 2015-10-06 16:50:59 EDT
Forgot to add: This is a RHEL6 host.
Comment 2 Gregor Jasny 2015-10-06 17:35:29 EDT
One could work around by setting the search path with -B
Comment 7 errata-xmlrpc 2015-11-16 10:11:05 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.