0

I've done all the installs of dev packages and im trying to build nginx from source.

(UAT) root@vstedbm01d# which cc
/bin/cc

(UAT) root@vstedbm01d# which gcc
/bin/gcc

When I am in the root of nginx and try to run my configure I get this:

(UAT) root@vstedbm01d# /bin/gcc ./configure
collect2: fatal error: cannot find 'ld'

How do I approach this?

Jimmy
  • 239
  • 3
  • 7
  • 21
  • Which is the output of the command "which ld"? Which RHEL version? Which nginx version are you try to build? Where are downloaded nxing source code? – NoNoNo Apr 10 '19 at 13:00
  • @NoNoNo It says no ld in (usr/local etc). Latest nginx and redhat. The sourcecode is in the root folder. – Jimmy Apr 10 '19 at 13:16
  • Start by ensuring that your RHEL subscription is active and installing all available updates. – Michael Hampton Apr 10 '19 at 15:21

1 Answers1

2

On a RHEL7 server ld is a file under /bin

# which ld
/bin/ld

It's provided by binutils package

# rpm -qf /bin/ld
binutils-2.27-27.base.el7.x86_64

You can verify that your server has:

  • binutils installed
  • /bin/ld file exists
  • PATH environment variable contains /bin
NoNoNo
  • 1,939
  • 14
  • 19
  • Hello. I have binutils-2.25.1-32.base.el7_4.1.x86_64 and PATH=$PATH:/bin and I have the /bin/ld file – Jimmy Apr 10 '19 at 14:03
  • Howeever when I do /bin/ld it still says it cant find it – Jimmy Apr 10 '19 at 14:08
  • 1
    Can you paste here the output of the command "which ld" and "ls -la /bin/ld" executed with the same user that you use to run the command "./configure"? – NoNoNo Apr 10 '19 at 15:04
  • /usr/bin/which: no ld in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/bin/gcc:/bin/cc:/root/bin:/bin/) – Jimmy Apr 10 '19 at 16:08
  • lrwxrwxrwx. 1 root root 20 Feb 15 15:04 /bin/ld -> /etc/alternatives/ld – Jimmy Apr 10 '19 at 16:08
  • Last check: can you verify the output of this commands is similar to mine: # ls -la /etc/alternatives/ld lrwxrwxrwx. 1 root root 15 8 gen 13.27 /etc/alternatives/ld -> /usr/bin/ld.bfd # ls -la /usr/bin/ld.bfd -rwxr-xr-x. 1 root root 1006232 30 mag 2018 /usr/bin/ld.bfd – NoNoNo Apr 11 '19 at 13:15