Use the Intel® linker, xild instead of step 2 in Command Line for Creating an IPO Executable. The linker xild performs the following steps:
Invokes the compiler to perform IPO if objects containing IR are found.
Invokes GCC ld to link the application.
The command-line syntax for xild is the same as that of the GCC linker:
xild [<options>] <LINK_commandline>
where:
[<options>] (optional) may include any GCC linker options or options supported only by xild.
<LINK_commandline> is your linker command line containing a set of valid arguments to the ld.
To create app using IPO, use the option -ofilename as shown in the following example:
xild -oapp a.o b.o c.o
xild calls the compiler to perform IPO for objects containing IR and creates a new list of object(s) to be linked. Then xild calls ld to link the object files that are specified in the new list and produce app.
Note
The -ipo option can reorder object files and linker arguments on the command line. Therefore, if your program relies on a precise order of arguments on the command line, -ipo can affect the behavior of your program.
The xild command recognizes all three spellings the IPO switch (-ipo, -ipoN, and -ipo_separate).
You must use the Intel linker xild to link your application if:
Your source files were compiled with IPO enabled. IPO is enabled by specifying the -ipo command-line option
You normally would invoke the GCC linker (ld) to link your application.
The additional options supported by xild may be used to examine the results of IPO. These options are described in the following table.
-qipo_fa[file.s] |
Produces an assembly listing for the IPO compilation. You can specify an optional name for the listing file, or a directory (with the backslash) in which to place the file. The default listing name is ipo_out.s. |
-qipo_fo[file.o] |
Produces an object file for the IPO compilation. You can specify an optional name for the object file, or a directory (with the backslash) in which to place the file. The default object file name is ipo_out.o. |
-ipo_fcode-asm |
Adds code bytes to the assembly listing. |
-ipo_fsource-asm |
Adds high-level source code to the assembly listing. |
-ipo_fverbose-asm, |
Enables and disables, respectively, inserting comments containing version and options used in the assembly listing for xild. |
If the xild invocation leads to an IPO multi-object compilation (either because the application is big, or because the user explicity asked for multiple objects), the first .s file takes its name from the -qipo_fa option. The compiler derives the names of subsequent .s files by appending a number to the name, for example, foo.s and foo1.s for -qipo_fafoo.s. The same is true for the -qipo_fo option.