Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Compiler vs cross compiler

2006-03-20 by Tom Walsh

Paul Curtis wrote:

>Leon, 
>
>  
>
>>>hey friends,
>>> I want to know a fact...
>>> what is the difference between a compiler and a cross-compiler
>>> please help me find out...
>>>      
>>>
>>A cross-compiler generates code for a different CPU than the 
>>the one that it 
>>is running on. Most compilers for embedded systems are 
>>cross-compilers.
>>    
>>
>
>Actually, not quite true.
>
>There are native compilers (aka hosted compilers in ISO C speak) which
>generate code for direct execution on the processor and operating system
>on which the compiler is hosted.  For example, MS VC generating Win32
>apps is a native compiler, as is the Ultra compiler on OS-9 which
>generates code for 68K/386/PPC-based OS-9 systems, as is the classic cc
>compiler shipped with many older Unicies.
>
>A cross compiler generates code that cannot be directly executed on the
>host because either (a) it targets a different processor or (b) it
>targets a different OS.  An example of this type of compiler is your
>regular embedded C compiler provided by IAR, RAL, GHS, and so on.  But
>there are (many) non-commercial never-to-be-seen cross compilers that
>are used internally (for instance, I always used to build our Modula-2
>products on a Sun-3, but they targeted transputers, ARMs, 386s and 68Ks
>on various operating systems, I never built them native).
>
>  
>
Heh, you should try it sometime, it will quickly convince you that a 
compiler running natively on an embedded platform is a horrible idea. 
:P  I tried that with an SA1100 running @ 166MHz, terribly slow!

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.