LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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: 145

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
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,848

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
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: 145

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,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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: 145

Original Poster
Rep: Reputation: Disabled
Thanks
Elico
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration