You can direct the compiler to specify alternate tools for preprocessing, compilation, assembly, and linking. Further, you can invoke options specific to your alternate tools on the command line. The following sections explain how to use -Qlocation and -Qoption to do this.
Use -Qlocation to specify an alternate path for a tool. This option accepts two arguments using the following syntax:
prompt>icpc -Qlocation,tool,path
tool | Description |
---|---|
cpp | Specifies the compiler front-end preprocessor. |
c | Specifies the C++ compiler. |
asm | Specifies the assembler. |
ld | Specifies the linker. |
gas | Specifies the GNU assembler. |
gld | Specifies the GNU linker. |
path is the complete path to the tool.
Use -Qoption to pass an option specified by optlist to a tool, where optlist is a comma-separated list of options. The syntax for this command is the following:
prompt>icpc -Qoption,tool,optlist
tool | Description |
---|---|
cpp | Specifies the compiler front-end preprocessor. |
c | Specifies the C++ compiler. |
asm | Specifies the assembler. |
ld | Specifies the linker. |
optlist indicates one or more valid argument strings for the designated program. If the argument is a command-line option, you must include the hyphen. If the argument contains a space or tab character, you must enclose the entire argument in quotation characters (""). You must separate multiple arguments with commas. The following example directs the linker to create a memory map when the compiler produces the executable file from the source.
prompt>icpc -Qoption,link,-map,proto.map proto.cpp
The -Qoption,link option in the preceding example is passing the -map option to the linker. This is an explicit way to pass arguments to other tools in the compilation process. Also, you can use the -Xlinker val to pass values (val) to the linker.