在Vortex86DX上从头开始构建和编译GCC 5.2.0时出错

时间:2015-09-24 22:30:03

标签: c++ c linux gcc

为了使用gcc 3.2.3编译器升级VortexDX86自定义linux,我尝试构建GCC 5.2.0编译器以支持最新的C ++ 11标准。

我从gcc.gnu.org下载了源代码,并根据this link完成了标准的linux包构建器。

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

配置运行正常。我这样做:

$ make

我收到以下错误:

    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

之后make程序中止。我安装了所有依赖项(tclexpectdejagnuperlm4gmpmpfrmpc)我不知道遗失了什么。

如前所述,最初的Vortex linux有一个gcc 3.2.3编译器版本。

我需要解决这个问题,但我不知道从哪里开始。它会与自己的gcc库混淆....

帮助解决这个问题。

2 个答案:

答案 0 :(得分:0)

你需要一个可用的C ++编译器来构建最新版本的GCC,而你似乎没有(你的GCC 3.2.3似乎缺少C ++标准库头)。

我建议您使用现有的编译器来构建GCC 4.7.4(仍然可以由C编译器构建)以获得可用的C ++编译器。然后使用GCC 4.7.4构建GCC 5.2

答案 1 :(得分:-1)

  

坏。这没有解决问题....我已经按照所有步骤进行了同样的错误仍然存​​在......

发生可能因为您对操作系统不够了解或可能因为您对gcc不太了解

以下是如何从Ubuntu上的划痕编译GCC-5.2.0的一步一步。

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
相关问题