Next: , Previous: Spec Files, Up: Invoking GCC



3.16 Specifying Target Machine and Compiler Version

The usual way to run GCC is to run the executable called gcc, or <machine>-gcc when cross-compiling, or <machine>-gcc-<version> to run a version other than the one that was installed last. Sometimes this is inconvenient, so GCC provides options that will switch to another cross-compiler or version.

-b machine
The argument machine specifies the target machine for compilation.

The value to use for machine is the same as was specified as the machine type when configuring GCC 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.

-V version
The argument version specifies which version of GCC to run. This is useful when multiple versions are installed. For example, version might be 2.0, meaning to run GCC version 2.0.

The -V and -b options work by running the <machine>-gcc-<version> executable, so there's no real reason to use them if you can just run that directly.