Sign in

Not a member? | Forgot your Password?

Search lpc2000

Search tips

Subscribe to lpc2000

Free PDF Downloads

An Engineer's Guide to the LPC2100 Series

Advanced Linux Programming

What Every Programmer Should Know About Memory

Introduction to Embedded Systems

C++ Tutorial

Embedded Systems - Theory and Design Methodology

Microcontroller Programming and Interfacing

Introduction to Microcontrollers


More Free PDF Downloads

Discussion Groups

See Also

ElectronicsDSPFPGA

Find us on Facebook





Discussion Groups | LPC2000 | Compiler vs cross compiler

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

Compiler vs cross compiler - Author Unknown - Mar 20 11:33:00 2006

hey friends,
  I want to know a fact...
  what is the difference between a compiler and a cross-compiler
  please help me find out...
  Thanks...
  Umang Malhotra
	---------------------------------
	
	


Re: Compiler vs cross compiler - Leon Heller - Mar 20 11:48:00 2006

----- Original Message ----- 
From: <malhotra_umang@malh...>
To: <lpc2000@lpc2...>
Sent: Monday, March 20, 2006 3:33 PM
Subject: [lpc2000] Compiler vs cross compiler
	> 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.

Leon
	


Re: Compiler vs cross compiler - Paul Curtis - Mar 20 12:04:00 2006

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).

There are also things that are difficult to categorize, such as Apple's
recent introduction of Universal Binaries, for instance.

--
Paul Curtis, Rowley Associates Ltd   http://www.rowley.co.uk 
CrossWorks for MSP430, ARM, AVR and now MAXQ processors
	

_____________________________
 Free pdf download: An Engineer's Guide to the LPC2100 Series.


Re: Compiler vs cross compiler - Tom Walsh - Mar 20 12:50:00 2006

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..."
----------------
	


Re: Compiler vs cross compiler - Micron Engineering - Mar 20 16:52:00 2006

malhotra_umang@malh... ha scritto:
> hey friends,
>   I want to know a fact...
>   what is the difference between a compiler and a cross-compiler
>   please help me find out...
>   Thanks...
>   Umang Malhotra
>   
A cross compiler is a compiler that produce object code for a different 
cpu/calculator then the cpu of the calculator where it is runnig.
So if you have a compiler running on your PC that may produce object 
code for an ARM processor, that compiler is a cross compiler.
> 		
> ---------------------------------
>  
>
> 
>
>
>
>  
> Yahoo! Groups Links
>
>
>
>  
>
>
>
>
>
	  ----------


	
	


Re: Compiler vs cross compiler - David Hawkins - Mar 20 17:26:00 2006

>>hey friends,
>>  I want to know a fact...
>>  what is the difference between a compiler and a cross-compiler
>>  please help me find out...
>>  Thanks...

Its what you get when you feed your compiler bad code.

:)