Creating a GCC Cross-Compiler for the Raspberry Pi?

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
leejbaxter
Member
Member
Posts: 25
Joined: Sat Jan 15, 2011 8:40 pm

Creating a GCC Cross-Compiler for the Raspberry Pi?

Post by leejbaxter »

Hi folks,

I'm creating a GCC cross-compiler for the Raspberry Pi in order to program it at the bare-metal level, and I'm still a bit of a n00b I'm afraid when it comes to creating the cross-compiler. I've gotten a naked cross-compiler built, but I'm not sure how to build a complete cross-compiler with the standard and runtime libraries (it looks like the C Raspberry Pi tutorials require these as they contain code that includes 'stdint.h'). I followed the instructions on the GCC cross-compiler tutorial for the Raspberry Pi; I just wondered whether I need to build the required headers myself, or do I need to get pre-built headers from somewhere else? If I need to build the required headers myself, then how do I go about doing this when I have no kernel to make calls to?

Sorry if I come across as a confused little man...in all truth, I am!!! #-o

Thanks in advanced to anybody who can help me with this!
Lee.J.Baxter - Designer of CHAOS (Cybernetic Hivemind Adaptive Operating System)
User avatar
Griwes
Member
Member
Posts: 374
Joined: Sat Jul 30, 2011 10:07 am
Libera.chat IRC: Griwes
Location: Wrocław/Racibórz, Poland
Contact:

Re: Creating a GCC Cross-Compiler for the Raspberry Pi?

Post by Griwes »

stdint.h is a freestanding header. It's highlighted somewhere on the wiki.
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
leejbaxter
Member
Member
Posts: 25
Joined: Sat Jan 15, 2011 8:40 pm

Re: Creating a GCC Cross-Compiler for the Raspberry Pi?

Post by leejbaxter »

Griwes wrote:stdint.h is a freestanding header. It's highlighted somewhere on the wiki.
Brilliant! I've just re-read the Wiki page and noticed that it said that, as you pointed out! Forgive me for sounding n00bish again with another question, but it seems as though this header would have been compiled when I built the 'naked' compiler; am I right in saying that this header, as well as other freestanding headers, will be available for me to use (i.e. they'll have been created when I built the naked compiler)?

Thanks again! :D
Lee.J.Baxter - Designer of CHAOS (Cybernetic Hivemind Adaptive Operating System)
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Creating a GCC Cross-Compiler for the Raspberry Pi?

Post by sortie »

Your cross-compiler comes with all the freestanding headers and a few compiler-specific headers. Things such as <stdint.h>, <stddef.h>, <stdbool.h> and more all work out of the box.
leejbaxter
Member
Member
Posts: 25
Joined: Sat Jan 15, 2011 8:40 pm

Re: Creating a GCC Cross-Compiler for the Raspberry Pi?

Post by leejbaxter »

sortie wrote:Your cross-compiler comes with all the freestanding headers and a few compiler-specific headers. Things such as <stdint.h>, <stddef.h>, <stdbool.h> and more all work out of the box.
Fantastic! Looks like I'll be able to jump into development then! :D

Cheers!
Lee.J.Baxter - Designer of CHAOS (Cybernetic Hivemind Adaptive Operating System)
Post Reply