| Cross Compiler |
Article Index for Cross |
Website Links For Cross |
Information AboutCross Compiler |
| CATEGORIES ABOUT CROSS COMPILER | |
| cross-compilers | |
|
USES OF CROSS COMPILERS The fundamental use of a cross compiler is to separate the build environment from the target environment. This is useful in a number of situations:
Use of Virtual Machine s (such as Java's JVM ) ameliorate some of the problems for which cross compilers were developed. The virtual machine method allows the same compiler output to be by both the host and the target system. THE GCC CROSS COMPILER Gcc is a free cross compiler that supports dozens of platforms and a handful of languages. However, due to limited volunteer time and the huge amount of work it takes to maintain working cross compilers, in many releases some of the cross compilers are broken. gcc relies upon the Binaries of Binutils for the targeted platform to be available. 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. Then gcc can be compiled as normal provided that the tools binutils creates are available in the Path . On Unix-like Operating System s with Bash , that can be accomplished with the following:PATH=/path/to/binutils/bin: make Cross compiling gcc requires that a portion of the C Standard Library is available for the targeted platform on the host platform. At least the Crt0 , ... components of the library has to be available in some way. You can choose to compile the full C library, but that can be too large for many platforms. The alternative is to use Newlib , which is a small C Library containing only the most essential components required to get C source code compiled. To configure gcc with newlib, use the switch --with-newlib to the configure script.CANADIAN CROSS This is a technique for building cross compilers for other machines. That is, use machine A to build a cross compiler that runs on machine B to create executables for machine C. When using the Canadian Cross with gcc, there may be four compilers involved. On Machine A:
Note that you will not be able to execute the resulting compiler on your build machine A. You would use ''gcc cross compiler from machine B to machine C (4)'' on machine B to compile an application into executable code that would then be copied to machine C and executed on machine C. EXTERNAL LINKS
|
|
|