Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

gnu-prefix

Lets you specify a prefix that will be added to the names of gnu utilities called from the compiler.

Syntax

Linux:

-gnu-prefix=prefix

macOS:

None

Windows:

None

Arguments

prefix

Is a string that prepends the name of gnu tools called from the compiler. The value depends on the gnu toolchain used for a particular operating system. For example, for Wind River* Linux 6.x, the prefix value will be x86_64-wrs-linux-. You must append a hyphen to prefix only if the toolchain prefix ends with a hyphen.

You can specify a short name or a pathname:

  • short name: -gnu-prefix=prefix

    In this case, the compiler calls prefix<gnu_utility> instead of <gnu_utility>. The utility with this name should be in the PATH environment variable.

  • pathname: -gnu-prefix=/directory_name/prefix

    In this case, the compiler calls /directory_name/prefix<gnu_utility>. The utility with this name will be invoked by its full pathname.

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* or Linux*.

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.

IDE Equivalent
None
Alternate Options

None

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 operating system 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 operating system 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

See Also