LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 09-19-2012, 09:43 AM   #1
elico
Member
 
Registered: Dec 2011
Posts: 115

Rep: Reputation: Disabled
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
 
Old 09-19-2012, 10:16 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,466

Rep: Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213Reputation: 1213
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).
 
1 members found this post helpful.
Old 09-19-2012, 01:54 PM   #3
elico
Member
 
Registered: Dec 2011
Posts: 115

Original Poster
Rep: Reputation: Disabled
Thanks

Elico
 
Old 09-21-2012, 08:32 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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.

Last edited by theNbomr; 09-23-2012 at 10:03 AM.
 
1 members found this post helpful.
Old 09-23-2012, 02:04 AM   #5
elico
Member
 
Registered: Dec 2011
Posts: 115

Original Poster
Rep: Reputation: Disabled
Thanks
Elico
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cross compiler for power PC on Linux psmurthy Linux - Software 1 09-22-2010 02:32 PM
linux arm cross compiler habeshkumar Linux - Software 4 07-26-2010 07:52 AM
windows to linux cross-compiler back2morrie Linux - General 8 07-13-2005 03:15 AM
GNU based c++ cross compiler unable to link c library k_taid Programming 1 06-29-2005 09:38 AM


All times are GMT -5. The time now is 08:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration