Lets you specify a prefix that will be added to the names of gnu utilities called from the compiler.
Arguments
Default
OFF | The compiler calls gnu utilities by their short names, and looks for them in the path specified by the PATH environment variable. |
Description
This option lets you specify a prefix that will be added to the names of gnu utilities called from the compiler. This option is available for Linux*-targeted compilers but the host may be either Windows* OS or Linux* OS.
If you specify option -gnu-prefix with option -gcc-name (or -gxx-name), the following occurs:
If a name specified in -gcc-name (or -gxx-name) contains a full path to a binary then option -gnu-prefix has no effect on the specified name; other binutils will have the prefix.
Otherwise, option -gnu-prefix is applied to the name specified in -gcc-name (or -gxx-name).
The above approach provides flexibility to specify an alternative gcc name outside of the default toolchain. At the same time, if a short name is provided in option -gcc-name, it is assumed to be a part of the default toolchain and a prefix will be added.
Instead of using option -gnu-prefix, you can create symlinks for the short names of gnu utilities in the toolchain and add them to the PATH. For example, ld--> i686-wrs-linux-gnu-ld
.
Note
Even though this option is not supported for a Windows-to-Windows native compiler, it is supported for a Windows-host to Linux-target compiler.
Example
Consider that you are setting up the compiler to produce an application for a Wind River* Linux 6.
Assume that your gnu cross toolchain for the target OS is located in the following directory:
/WRL/60/x86_64-linux/usr/bin/x86_64-wrs-linux
and gnu utilities in the toolchain have prefixx86_64-wrs-linux-
.
Assume your sysroot for the target OS is located in the following directory:
/WRL/60/qemux86-64
To compile your application for Wind River* Linux 6, you must enter the following commands:
export PATH=/WRL/60/x86_64-linux/usr/bin/x86_64-wrs-linux:PATH icc --sysroot/WRL/60/qemux86-64 -gnu-prefix=x86_64-wrs-linux- app.c
The following examples show what happens when you specify both -gcc-name and -gnu-prefix.
Example 1:
Command line: -gcc-name=foobar –gnu-prefix=em64t- Actual gcc name used in the compiler: em64t-foobar ld name used in the icc: em64t-ld
Example 2:
Command line: -gcc-name=/a/b/foobar –gnu-prefix=em64t- Actual gcc name used in the compiler: /a/b/foobar ld name used in the icc: em64t-ld