Compilers and cross compilers are designed for specific appl

Compilers and cross compilers are designed for specific applications. Cross-compilers are used specifically for embedded applications. Each cross compiler is designed for a specific language, and it has its own limitations. Good or bad compilers are decided on the basis of how well they support programming features. The students are required to document the following. Introduction to cross-compilers B2.2 Need for cross-compilers Discussion on how normal compilers are useful in the development of cross-compilers for another architecture B2.4 Conclusion

Solution

Introduction to cross-compilers:

When someone develop a desktop or server application, almost always the development platform (the machine that runs your compiler) and the target platform (the machine that runs your application) are the same. \"platform\" means the combination of CPU architecture, and Operating System. The process of building executable binaries on one machine, and run them on another machine when the CPU architecture or the Operating System are different is called \"cross compilation\". A special compiler is needed for doing cross compilation that is called \"cross compiler\".

On the other hand, developers of an embedded Linux application that runs on a non PC architecture (like ARM, PowerPC, MIPS, etc.) tend to use a cross compiler to generate executable binaries from source code. The cross compiler must be specifically tailored for doing cross compilation from the development machine\'s architecture (sometimes called \"host\"), to the embedded machine\'s architecture (called \"target\").

So we can define cross-compiler as \"Cross compilation occurs when a compiler running on one system produces executables for another system -- this is an important concept when the target system doesn\'t have a native set of compilation tools, or when the host system is faster or has greater resources.

Need for a Cross-compilers:

The target machine has a different CPU architecture that the development host. In this case cross compilation is necessary because the binaries that the native compiler generates won\'t run on the target embedded machine.

Sometimes cross compilation is not strictly necessary, but native compilation in not practical, or inconvenient. Consider, for example, a slow ARM9 based target machine running Linux. Having the compiler run on this target will make the build process painfully slow. In many cases target machine is just under-powered, in terms of storage and RAM, for the task of running a modern compiler.

Almost all embedded Linux development is being done with cross compilers. Strong PC workstation machines are used as development hosts to run the development environment (text editor, IDE), and the cross compile. Some of the use cases of cross-compilers are

normal compliers for developing new cross-compilers:

desktop PC application developers for Windows or Linux can build and run their binaries on the very same machine. Even developers of server applications generally have the same basic architecture and Operating System on both their development machine and server machine. The compiler used in these cases is called \"native compiler\".

GCC, a free software collection of compilers, can be set up to cross compile. It supports many platforms and languages.

GCC requires that a compiled copy of binutils be available for each targeted platform. Especially important is the GNU Assembler. Therefore, binutils first has to be compiled correctly with the switch --target=some-target sent to the configure script. GCC also has to be configured with the same --target option. GCC can then be run normally provided that the tools, which binutils creates, are available in the path,

A compiler for a relatively simple language written by one person might be a single, monolithic piece of software. When the source language is large and complex, and high quality output is required, the design may be split into a number of relatively independent phases. Having separate phases means development can be parceled up into small parts and given to different people. It also becomes much easier to replace a single phase by an improved one, or to insert new phases later This basics of normal compilers will help in building new compliers.

Conclusion:

If we need a customized root filesystem or need to compile packages that have many dependencies, then here cross compiler design will come in picture. Cross-compilers are very capable of creating executable code for a platform other than the one on which the compiler is running.

 Compilers and cross compilers are designed for specific applications. Cross-compilers are used specifically for embedded applications. Each cross compiler is d
 Compilers and cross compilers are designed for specific applications. Cross-compilers are used specifically for embedded applications. Each cross compiler is d

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site