Invoking IPA using the c89 and xlc utilities

You can invoke the IPA compile step, the IPA link step, or both. The step that c89 invokes depends upon the invocation parameters and type of files you specify. You must specify the I phase indicator along with the W option of the c89 utility.

If you invoke the c89 utility with at least one source file and the -c option and the -WI option, c89 automatically specifies the IPA(NOLINK) option and invokes the IPA compile step. For example, the following command invokes the IPA compile step for the source file hello.c:

c89 -c -WI hello.c

The syntax when using the xlc utility is:

c89 -c -qipa hello.c
If you invoke the c89 utility with the -WI option and with at least one object file, do not specify the -c option and do not specify any source files. c89 automatically specifies IPA(LINK) and automatically invokes the IPA link step and the binder. For example, the following command invokes the IPA link step and the binder, to create a program called hello:
c89 -o hello -WI hello.o
The syntax when using the xlc utility is:
c89 -o hello -qipa hello.o
If you invoke c89 with the -WI option and with at least one source file for compilation and any number of object files, and do not specify the -c c89 compiler option, c89 automatically invokes the IPA compile step once for each compilation unit and the IPA link step once for the entire program. It then invokes the binder. For example, the following command invokes the IPA compile step, the IPA link step, and the binder to create a program called foo:
c89 -o foo -WI,object foo.c

The syntax when using the xlc utility is:

c89 -o foo -qipa=object foo.c

When linking an application built with IPA(PDF1), you must specify -Wl,PDF1 so that the application links correctly.

Specifying options

When using c89, you can pass options to IPA, as follows:

The following example shows how to pass options using the c89 utility:

c89 -O2 -WI,noobject -Wc,source -Wl,I,"maxmem(2048)" file.c

If you specify the previous command, you pass the IPA(NOOBJECT) and the SOURCE option to the IPA compile step, and the MAXMEM(2048) option to both the IPA Compile and the IPA link step.

The syntax when using the xlc utility is:

c89 -O2 -qipa=noobject -qsource -qmaxmem=2048 hello.c

Other considerations

The c89 and xlc utilities automatically generate all INCLUDE and LIBRARY IPA Link control statements.

IPA under c89 and xlc supports the following types of files: