Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is cross compiler and cross platform?

I am bit confused with the terms of cross platform and cross compiler. Let me be first clear about the cross platform. When people talk about cross platform it means the architecture of the CPU, i.e, X86 and X64 ? or the OS i.e windows 32 bit or Windows 64 (server or desktop)? UNIX doesn't have different flavours like 64 bit or 32 bit. Why so?

.NET and java is cross compiler language, what it means? When the program is compiled in .NET, we have to choose the option like X86, X64 or Any CPU. What that means? Also in setup project we have to choose the option between x86 and x64. So if the program is compiled in x86 and msi file has been created on x64 will it run on both X64 and x86 or any one of ?

like image 860
pointlesspolitics Avatar asked Jun 23 '09 07:06

pointlesspolitics


People also ask

What is cross platform compiler?

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

What is meant by cross-compilation?

Cross-compilation is the act of compiling code for one computer system (often known as the target) on a different system, called the host. It's a very useful technique, for instance when the target system is too small to host the compiler and all relevant files.

What is difference between compiler and cross compiler?

The native compiler is a compiler that generates code for the same platform on which it runs and on the other hand, a Cross compiler is a compiler that generates executable code for a platform other than one on which the compiler is running.

What is GCC cross compiler?

Generally speaking, a cross-compiler is a compiler that runs on platform A (the host), but generates executables for platform B (the target). These two platforms may (but do not need to) differ in CPU, operating system, and/or executable format.


1 Answers

When people talk about cross platform it means the architecture of the CPU, i.e, X86 and X64 ? or the OS

Both. It usually means sotfware that runs in a virtual machine or software that is compiled for each platform separately.

UNIX doesn't have different flavours like 64 bit or 32 bit.

It does.

So if the program is compiled in x86 and msi file has been created on x64 will it run on both X64 and x86 or any one of ?

If you target x86, amd64 will also run the code (in 32 bit mode). It shouldn't matter where you create the installer msi file.

Cross compiling means that the host and target platform are not the same. For example building windows software on a Linux computer.

like image 81
John Smith Avatar answered Oct 14 '22 07:10

John Smith