If you do compile and link in separate steps, consistent compiling and linking is critical when using the following compiler options:
-fast
-g
-g0
-library
-misalign
-mt
-p
-xa
-xarch=a
-xcg92 and -xcg89
-xpg
-xprofile
-xtarget=t
If you compile any subprogram with any of these options, be sure to link with the same option as well:
In the case of the -library, -fast, and -xarch options, you must be sure to include the linker options that would have been passed if you had compiled and linked together.
With -p, -xpg and -xprofile, including the option in one phase and leaving it out of the other will not affect the correctness of the program but you will not be able to do profiling.
With -g and -g0, including the option in one phase and leaving it out of the other will not affect the correctness of the program, but the program will not be prepared properly for debugging.
In the following example, the programs are compiled using the -xcg92 compiler option. This option is a macro for -xtarget=ss1000 and expands to: -xarch=v8 -xchip=super -xcache=16/64/4:1024/64/1
If the program uses templates, it is possible that some templates will get instantiated at link time. In that case the command line options from last line (the link line) will be used to compile the instantiated templates.
demo% CC -c -xcg92 sbr.cc demo% CC -c -xcg92 smain.cc demo% CC -xcg92 sbr.o smain.o