建立GCC使:*** [全部]错误2

我试图在
OSDev GCC Cross-Compiler Tutuorial.之后在Ubuntu上为i686-elf设置交叉编译器但是,设置GCC的代码每次都无法构建.我知道我的消息来源并没有过时,因为我在做任何事情之前都会更新apt-get update’d.

为了得到我需要的包裹,我做了:

sudo apt-get install g++
sudo apt-get install make
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libgmp3-dev
sudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg
sudo apt-get install mpc
sudo apt-get install texinfo
sudo apt-get install libcloog-isl-dev

我认为这种方法没有问题?

然后,使用gcc-5.2.0和binutils-2.25.1(在ubuntu中,bintuils似乎不适用于旧版本以上的任何东西)我安装了binutils就好了.我去构建gcc但是当我输入make时,我收到以下错误:

不幸的是,我无法复制粘贴30页,但这个代码接近结尾:

checking command to parse nm output from gcc  -m32 object... failed
checking how to run the C preprocessor... /lib/cpp
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if gcc  -m32 supports -fno-rtti -fno-exceptions... no
checking for gcc  -m32 option to produce PIC... -fPIC -DPIC
checking if gcc  -m32 PIC flag -fPIC -DPIC works... yes
checking if gcc  -m32 static flag -static works... no
checking if gcc  -m32 supports -c -o file.o... yes
checking if gcc  -m32 supports -c -o file.o... (cached) yes
checking whether the gcc  -m32 linker (ld -m elf_x86_64 -m elf_i386) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:9590: recipe for target 'configure-zlib' failed
make[1]: *** [configure-zlib] Error 1
make[1]: Leaving directory '/home/david/scr'
Makefile:876: recipe for target 'all' failed
make: *** [all] Error 2

这是发生了一些非常糟糕的事情的部分(就在那之后):

checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
Makefile:9590: recipe for target 'configure-zlib' failed
make[1]: *** [configure-zlib] Error 1
make[1]: Leaving directory '/home/david/scr'
Makefile:876: recipe for target 'all' failed
make: *** [all] Error 2

任何人都可以告诉我我做错了什么以及如何解决它?

谢谢!

最佳答案 除了–with-system-zlib之外,当我使用–disable-multilib选项时,它对我有用.

点赞