LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Cross C compiler for LINUX based boards (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/cross-c-compiler-for-linux-based-boards-4175427996/)

elico 09-19-2012 09:43 AM

Cross C compiler for LINUX based boards
 
Hi all

As a newbe to LINUX based embedded bords, I need to understand
the concept of C cross compilers .

How c code is written on those cross compilers ?

Do I have to include LINUX header files at design time,
so I can write tasks and threads within the C code?

Example of C cross compiers for LINUX based SBC boards ?

Elico

pan64 09-19-2012 10:16 AM

to make it simple: you write your code as usual, you compile and build your code as usual, the only difference is that the target environment is not the local system but another one. You need to have platform specific headers and platform specific compiler (you need to install this cross-compiler, headers and all the related stuff).

elico 09-19-2012 01:54 PM

Thanks

Elico

theNbomr 09-21-2012 08:32 AM

The process of creating a cross compiler or more accurately, cross toolchain, is not trivial. If you do not already have one, I suggest using something such as Crosstool-NG and others, to aid you. You will need to understand some key things about your target environment, such as the hardware architecture (CPU and CPU variant type, and perhaps other CPU factors such as MMU and FPU), OS if present, standard C library, and some build-host based factors. It is not quite as simple as a complete mix & match of toolchain components, as the cross dependencies are abundant. If building a cross toolchain, be prepared to spend a considerable time trying different combinations before you find one that works for your build-host and target. Don't even think about trying to build one yourself.
--- rod.

elico 09-23-2012 02:04 AM

Thanks
Elico


All times are GMT -5. The time now is 12:17 AM.