Whole document tree
2.13 Specifying Target Machine and Compiler VersionBy default, GCC compiles code for the same type of machine that you are using. However, it can also be installed as a cross-compiler, to compile for some other type of machine. In fact, several different configurations of GCC, for different target machines, can be installed side by side. Then you specify which one to use with the `-b' option. In addition, older and newer versions of GCC can be installed side by side. One of them (probably the newest) will be the default, but you may sometimes wish to use another.
The `-b' and `-V' options actually work by controlling part of the file name used for the executable files and libraries used for compilation. A given version of GCC, for a given target machine, is normally kept in the directory `/usr/local/lib/gcc-lib/machine/version'. Thus, sites can customize the effect of `-b' or `-V' either by changing the names of these directories or adding alternate names (or symbolic links). If in directory `/usr/local/lib/gcc-lib/' the file `80386' is a link to the file `i386v', then `-b 80386' becomes an alias for `-b i386v'.
In one respect, the `-b' or `-V' do not completely change
to a different compiler: the top-level driver program The only way that the driver program depends on the target machine is in the parsing and handling of special machine-specific options. However, this is controlled by a file which is found, along with the other executables, in the directory for the specified version and target machine. As a result, a single installed driver program adapts to any specified target machine and compiler version. The driver program executable does control one significant thing, however: the default version and target machine. Therefore, you can install different instances of the driver program, compiled for different targets or versions, under different names.
For example, if the driver for version 2.0 is installed as
This document was generated by root on January, 30 2002 using texi2html |