1

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

  • 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? – steeldriver May 26 '17 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. – Kivitoe May 26 '17 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. – Mark Plotnick May 26 '17 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? – Faheem Mitha May 26 '17 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? – Faheem Mitha May 26 '17 at 23:30
3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.