Bug 1269279 - GCC does not find gold linker if it is not in PATH
Summary: GCC does not find gold linker if it is not in PATH
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 3.1 RHEL 6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta2
: 4.0
Assignee: Jakub Jelinek
QA Contact: Miroslav Franc
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-06 20:48 UTC by Gregor Jasny
Modified: 2016-02-01 02:30 UTC (History)
7 users (show)

Fixed In Version: devtoolset-4-gcc-5.2.1-2.2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-16 15:11:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:2040 0 normal SHIPPED_LIVE new packages: devtoolset-4-gcc 2015-11-16 20:08:13 UTC

Description Gregor Jasny 2015-10-06 20:48:27 UTC
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):

  devtoolset-3-gcc-4.9.2-6.el6.x86_64

How reproducible:

  always

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?

Thanks,
Gregor

Comment 1 Gregor Jasny 2015-10-06 20:50:59 UTC
Forgot to add: This is a RHEL6 host.

Comment 2 Gregor Jasny 2015-10-06 21:35:29 UTC
One could work around by setting the search path with -B

Comment 7 errata-xmlrpc 2015-11-16 15:11:05 UTC
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.

https://rhn.redhat.com/errata/RHEA-2015-2040.html


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