Individuals using OS X 10.7 or earlier might want to invest in either building a system GCC (that outputs native Mach-O), or upgrading the local LLVM/Clang installation. However, if you want to use the latest and greatest GCC version for your cross-compiler, we recommend that you bootstrap the newest GCC as your system compiler first. For instance, GCC 4.7.3 may be able to build a GCC 4.8.0 cross-compiler. You may be able to use an older major GCC release to build a cross-compiler of a newer major GCC release. This command prints the current compiler version: If your local system compiler isn't too terribly old (at least GCC 4.6.0), you may wish to save yourself the trouble and just pick the latest minor release (such as 4.6.3 if your system compiler is 4.6.1) for your cross-compiler. You can also use older releases as they are usually reasonably good. Here is how to build the newest GCC as your system compiler. For instance, using GCC 4.6.3 to build a GCC 4.8.0 cross-compiler would create troubles. The newest GCC is recommended as it is the latest and greatest release. Which compiler version to choose Main article: Building GCC The solution is to build a cross-compiler. The compiler that comes with the host system does not know by default that it is compiling something else entirely, unless a lot of problematic options are passed to it, which will create a lot of problems in the future. The compiler must know the correct target platform (CPU, operating system). Why cross-compilers are necessary Main article: Why do I need a Cross Compiler? It is important to realize that these two platforms are not the same the operating system you are developing is always going to be different from the operating system you currently use. In our case, the host platform is your current operating system and the target platform is the operating system you are about to make. These two platforms may (but do not need to) differ in CPU, operating system, and/or executable format. Generally speaking, a cross-compiler is a compiler that runs on platform A (the host), but generates executables for platform B (the target).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |