Sun Studio 12 Update 1: C++ User's Guide

Warnings

If you compile and link in separate steps, the same -xprofile option must appear in both the compile command and the link command. Including -xprofile in one step and excluding it from the other step will not affect the correctness of the program, but you will not be able to do profiling.

-xprofile=collect or -xprofile=tcov should not be used with -G to build shared libraries on Linux platforms.