Page 1 of 1

Creating a GCC Cross-Compiler for the Raspberry Pi?

Posted: Fri May 24, 2013 1:35 am
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!

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

Posted: Fri May 24, 2013 2:05 am
by Griwes
stdint.h is a freestanding header. It's highlighted somewhere on the wiki.

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

Posted: Fri May 24, 2013 3:23 am
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

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

Posted: Fri May 24, 2013 4:16 am
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.

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

Posted: Fri May 24, 2013 4:45 am
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!