I am trying to set up a cross-compiler for i686-elf on Ubuntu following the OSDev GCC Cross-Compiler Tutuorial. However, the code to set up GCC fails to build every time. I know my sources are not out of date because I sudo apt-get update
'd before doing anything.
In order to get the packages I needed, I did:
sudo apt-get install g++sudo apt-get install makesudo apt-get install bisonsudo apt-get install flexsudo apt-get install libgmp3-devsudo apt-get install libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbgsudo apt-get install mpcsudo apt-get install texinfosudo apt-get install libcloog-isl-dev
I think there is no problem with that method?
Then, with gcc-5.2.0 and binutils-2.25.1 (in ubuntu, bintuils appears to not work with anything above that old version) I installed binutils just fine. I went to build gcc but when I typed in make, I got the following error:
Unfortunately, I can't copy+paste 30 pages in, but this all the code near the end:
checking command to parse nm output from gcc -m32 object... failedchecking how to run the C preprocessor... /lib/cppchecking for ANSI C header files... nochecking for sys/types.h... nochecking for sys/stat.h... nochecking for stdlib.h... nochecking for string.h... nochecking for memory.h... nochecking for strings.h... nochecking for inttypes.h... nochecking for stdint.h... nochecking for unistd.h... nochecking for dlfcn.h... nochecking for objdir... .libschecking if gcc -m32 supports -fno-rtti -fno-exceptions... nochecking for gcc -m32 option to produce PIC... -fPIC -DPICchecking if gcc -m32 PIC flag -fPIC -DPIC works... yeschecking if gcc -m32 static flag -static works... nochecking if gcc -m32 supports -c -o file.o... yeschecking if gcc -m32 supports -c -o file.o... (cached) yeschecking whether the gcc -m32 linker (ld -m elf_x86_64 -m elf_i386) supports shared libraries... yeschecking whether -lc should be explicitly linked in... nochecking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.Makefile:9590: recipe for target 'configure-zlib' failedmake[1]: *** [configure-zlib] Error 1make[1]: Leaving directory '/home/david/scr'Makefile:876: recipe for target 'all' failedmake: *** [all] Error 2
And this is the part (right after that) where something really bad happens:
checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.Makefile:9590: recipe for target 'configure-zlib' failedmake[1]: *** [configure-zlib] Error 1make[1]: Leaving directory '/home/david/scr'Makefile:876: recipe for target 'all' failedmake: *** [all] Error 2
Can anyone tell me what I am doing wrong and how I would fix it?
Thanks!