Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

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 I am on the latest Ubuntu 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 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

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... 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/yayvid/scr'
Makefile:876: recipe for target 'all' failed
make: *** [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' failed
make[1]: *** [configure-zlib] Error 1
make[1]: Leaving directory '/home/yayvid/scr'
Makefile:876: recipe for target 'all' failed
make: *** [all] Error 2

Can anyone tell me what I am doing wrong and how I would fix it?

Thanks!

share|improve this question
1  
This message could be helpful to you. – FUZxxl Oct 31 '15 at 10:27
    
@FUZxxl thanks! I will tell later if this worked. – David A Oct 31 '15 at 10:29
    
@FUZxxl OMG THANKS I have literally spent over 50 hours on this, and it finally worked. – David A Oct 31 '15 at 11:25
2  
It was a pleasure to me. If you don't mind, would you write down the steps you took for future people with the same problem? – FUZxxl Oct 31 '15 at 12:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.