1

In order to upgrade a VortexDX86 custom linux with a gcc 3.2.3 compiler, I´m trying to built the GCC 5.2.0 compiler to support the latest C++ 11 standard.

I have downloaded its source code from gcc.gnu.org and did the standard linux package builder based on this link.

$ mkdir ../gcc-build
$ cd    ../gcc-build
$ ../gcc-5.2.0/configure --prefix=/usr --disable-multilib --with-system-zlib --enable-languages=c,c++

The configuration runs fine. The I do:

$ make

And I´m getting the following error:

    make[3]: Entering directory `/home/ftp/pub/gcc-5.2.0/host-i586-pc-linux-gnu/gcc'
g++ -c   -g -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -fno-common  -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../.././gcc/../include  -I../.././gcc/../libcpp/include  \
    -o build/genmddeps.o ../.././gcc/genmddeps.c
cc1plus: warning: -Wmissing-format-attribute ignored without -Wformat
In file included from ../../gcc/genmddeps.c:19:
../../gcc/system.h:201:19: string: No such file or directory
../../gcc/system.h:218:22: algorithm: No such file or directory
../../gcc/system.h:219:20: cstring: No such file or directory
../../gcc/system.h:220:20: utility: No such file or directory
../../gcc/system.h:249:19: cstdlib: No such file or directory
make[3]: *** [build/genmddeps.o] Error 1
make[3]: Leaving directory `/home/ftp/pub/gcc-5.2.0/host-i586-pc-linux-gnu/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/ftp/pub/gcc-5.2.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/ftp/pub/gcc-5.2.0'
make: *** [all] Error 2

After that the make procedure aborts. I´ve installed all the dependencies (tcl, expect, dejagnu, perl, m4, gmp, mpfr and mpc) and I don´t know what is missing.

As said, the original Vortex linux has a gcc 3.2.3 compiler version.

I need to solve that but I don´t know where to start from. It seens to have confusion with the own gcc libraries....

Help appreciated to solve that.

Mendes
  • 17,489
  • 35
  • 150
  • 263
  • I think you didn't just run **./configure** ? – Michi Sep 24 '15 at 22:33
  • Yes, I did. `./configure` and then `make` with no options. Check the posted text. – Mendes Sep 24 '15 at 22:44
  • 3
    You will never compile GCC like that , please read here https://gcc.gnu.org/wiki/InstallingGCC, it says **do not run ./configure, this is not supported**. – Michi Sep 24 '15 at 22:44
  • Good point Michi. I´ve read it and will start over from scratch using these instructions.... – Mendes Sep 24 '15 at 22:52
  • I gave you a short Answer, maybe it will help someone else too. – Michi Sep 24 '15 at 22:54
  • I encountered the same error when I'm building toolchain in Linux From Scratch v8.6. The answers below didn't help (p.s. I'm on an Ubuntu with GCC 5.2.0 already installed, trying to cross-compile) – Raptor Mar 04 '16 at 10:34

2 Answers2

0

You need a working C++ compiler to build recent releases of GCC, and you don't seem to have that (your GCC 3.2.3 seems to be missing the C++ standard library headers).

I suggest that you use the existing compiler to build GCC 4.7.4 (which can still be built by a C compiler) to get a working C++ compiler. Then use GCC 4.7.4 to build GCC 5.2

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
-2

Bad. This did not solved the issue.... I´ve followed all the steps and the same error remains...

It happens maybe because you do not know enough your Operating System or maybe because you don't know to much about gcc

Here is step-by-step how to compile GCC-5.2.0 from scratches On Ubuntu.

1)

mkdir $HOME/gcc-5.2.0

2)

cd gcc-5.2.0/

3)

sudo apt-get install libmpfr-dev libgmp3-dev libmpc-dev flex bison gcc-multilib texinfo

4)

wget http://ftp.gnu.org/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.gz

5)

tar -xzvf gcc-5.2.0.tar.gz

6)

cd gcc-5.2.0/

7)

mkdir build

8)

cd build/

9)

../configure --enable-multilib --disable-checking --enable-languages=c,c++ \
  --enable-multiarch --enable-shared --enable-threads=posix \
  --program-suffix=5.2 --with-gmp=/usr/local/lib --with-mpc=/usr/lib \
  --with-mpfr=/usr/lib --without-included-gettext --with-system-zlib \
  --with-tune=generic \
  --prefix=$HOME/install/gcc-5.2.0

10)

make -j4

11)

make install
Michi
  • 5,175
  • 7
  • 33
  • 58