Linker error using GCC, incl. for binutils and textinfo
Asked Answered
D

2

11

I am getting this error every time, while compiling programs, configuring and installing some things like binutils, textinfo, etc.:

/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status

When will it come and what is the actual problem? Also, how do I solve it?

I removed binutils using the Synaptic package manager, but with the same result.

Desolate answered 8/5, 2013 at 9:42 Comment(3)
It seems you have a custom installation of the binutils package, and it was not properly configured.Exhaustive
actually, what ever i do the private installations i'll install them in seperate directories with --prefix=/private/. But, this time luck came from back. LoL Help me out yaar.. - @devnullDesolate
Re "textinfo": Do you mean texinfo (without the second "t")?Muscadel
P
3

Try to use gcc with the following option: gcc --sysroot=/usr/local

But, as the others told you in the comments, don't try to mess your system with critical packages such as the binutils, except if you know what you are doing.

Petersen answered 8/5, 2013 at 10:10 Comment(0)
U
5

If you were attempting to install a version of binutils that should work alike the one found in /usr/bin, you should know that

  • gcc invokes ld with a --sysroot=/ option.
  • ld of binutils built from source with the default options rejects a --sysroot option.
  • A --sysroot option will only be accepted by ld if binutils was configured with option --with-sysroot.

So, to cover this use case, configure binutils with option --with-sysroot=/.

Uptotheminute answered 4/1, 2017 at 10:0 Comment(1)
Thanks for this answer - it should be the accepted one. For anyone compiling binutils from source, I recommend this resource: linuxfromscratch.org/lfs/view/development/chapter06/…Kirkuk
P
3

Try to use gcc with the following option: gcc --sysroot=/usr/local

But, as the others told you in the comments, don't try to mess your system with critical packages such as the binutils, except if you know what you are doing.

Petersen answered 8/5, 2013 at 10:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.