Page 1 of 1

GCC Cross-compiler: error compiling libgcc

Posted: Thu Nov 12, 2015 6:40 am
by lodo1995
Hi everybody.

When I try to use the command

Code: Select all

 make all-target-libgcc 
the compiler exits almost immediately with this error:

Code: Select all

 /home/lodo1995/src/gcc_build/gcc/include/stddef.h:1:25: fatal error: stddef.h: No such file or directory 
But I can open that file with "more" without problems.

I'm on Ubuntu Server 15.10. I configured and compiled binutils without problems. I also configured gcc and compiled it with "make all-gcc". I'm using "x86_64-w64-mingw32" as target.

What's going on?
Thanks in advance for your help.

Lodovico

Re: GCC Cross-compiler: error compiling libgcc

Posted: Thu Nov 12, 2015 10:41 am
by Octocontrabass
lodo1995 wrote:"x86_64-w64-mingw32"
Why are you using this as your target?

Re: GCC Cross-compiler: error compiling libgcc

Posted: Sat Nov 14, 2015 10:10 am
by Roman
Octocontrabass wrote:
lodo1995 wrote:"x86_64-w64-mingw32"
Why are you using this as your target?
(U)EFI?

Re: GCC Cross-compiler: error compiling libgcc

Posted: Sat Nov 14, 2015 11:01 am
by jnc100
Mingw is usually a hosted environment. When you compile libgcc, you are using the new compiler you have created to compile a library for the target. As such, it expects all of the target's header files to be available (specifically, GCC's stddef.h includes the mingw system stddef.h). I'm guessing you don't have the mingw headers anywhere (or at least anywhere your compiler can find them). You may want to look at the mingw.org site to see their compilation instructions.

Regards,
John.

Re: GCC Cross-compiler: error compiling libgcc

Posted: Mon Nov 16, 2015 7:00 pm
by kzinti
There is no need to compile mingw on Ubuntu. Try this:

Code: Select all

sudo apt-get install mingw-w64