| Red Hat Documentation |
|
Specifying target machine and compiler version By default, GNU CC 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 GNU CC, 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 GNU CC can be installed side by side. One of them (probably the newest) will be the default, but you may sometimes wish to use another version, using the following arguments.
The value to use for machine is the same as was specified as the machine type when configuring GNU CC as a cross-compiler. For example, if a cross-compiler was configured with ‘configure i386v’, meaning to compile for an 80386 running System V, then you would specify ‘-b i386v’ to run that cross compiler. When you do not specify ‘-b’, it normally means to compile for the same type of machine that you are using.
The ‘-b’ and ‘-V’ options actually work by controlling part of the filename used for the executable files and libraries used for compilation. A given version of GNU CC, 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’. 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 ogcc and that for version 2.1 is installed as gcc, then the command gcc will use version 2.1 by default, while ogcc will use 2.0 by default. However, you can choose either version with either command with the ‘-V’ option. |
|
© 2001 Red Hat, Inc. All rights reserved. About Red Hat : Legal statement : Privacy statement : Y2K statement : Contact Red Hat |