GCC Cross-compiler: error compiling libgcc

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
lodo1995
Posts: 16
Joined: Thu Nov 12, 2015 6:31 am

GCC Cross-compiler: error compiling libgcc

Post 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
Octocontrabass
Member
Member
Posts: 5588
Joined: Mon Mar 25, 2013 7:01 pm

Re: GCC Cross-compiler: error compiling libgcc

Post by Octocontrabass »

lodo1995 wrote:"x86_64-w64-mingw32"
Why are you using this as your target?
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: GCC Cross-compiler: error compiling libgcc

Post by Roman »

Octocontrabass wrote:
lodo1995 wrote:"x86_64-w64-mingw32"
Why are you using this as your target?
(U)EFI?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: GCC Cross-compiler: error compiling libgcc

Post 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.
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: GCC Cross-compiler: error compiling libgcc

Post by kzinti »

There is no need to compile mingw on Ubuntu. Try this:

Code: Select all

sudo apt-get install mingw-w64
Post Reply