2

I've been having a problem with building pretty much any GNU program. I try to build Binutils, or GCC using:

./configure
make
make install

However, ./configure always seems to throw the error:

configure: error: in `/home/user/Desktop/binutils-2.28':
configure: error: C compiler cannot create executables
See `config.log' for more details.

This happens on both Binutils and GCC. I tried everything from other questions and articles, but nothing solves it...

I'm mostly asking for help with GCC, because I need that one the most. (Binutils is pre-installed on my system.)

++++ Config.log Output for GCC ++++

https://pastebin.com/BJzNMjG2

13
  • Does it work if you configure it without the explicit --build, --host, --target parameters (i.e. keep everything native)? Can you successfully build a simple "hello world" C program? May 26, 2017 at 18:47
  • @steeldriver It doesn't build even without those parameters... I'm also trying to target i686-elf as I'm developing a kernel.
    – GreenJames
    May 26, 2017 at 19:10
  • 1
    Yes, but it should be spelled --enable-languages. Either way, it's probably not the cause of configure's failure, but I was curious about it. May 26, 2017 at 22:19
  • 3
    Why are you trying to build binutils and gcc by hand? Your distribution must have these both. Presumably the C compiler that you say doesn't work is gcc. Was that also built by hand or is it a distribution binary package? May 26, 2017 at 23:09
  • 4
    "however, I was told that I couldn't use my system compiler to do this" Couldn't use it to do what? May 26, 2017 at 23:30

1 Answer 1

5

gcc as a standalone install will not be usable for compiling on the most 'Linux OS'. Install g++ (gcc-c++) and the missing parts will be installed too.

How to build gcc : gcc requires a build folder outside the gcc-7.1.0/ source ! http://www.linuxfromscratch.org/lfs/view/development/chapter05/gcc-pass2.html

Unpack gmp, mpfr, mpc as described in the link, and you can configure, from build/ , example:

../gcc-7.1.0/configure --prefix=/usr/local/gcc7 --program-suffix=7 --enable-languages=c,c++ --disable-multilib

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .