[OpenIndiana-discuss] use cases of Sun Studio-compiled C++ libraries on OI

Alan Coopersmith alan.coopersmith at oracle.com
Sun Dec 7 20:51:06 UTC 2014


On 11/28/14 06:25 PM, Richard L. Hamilton wrote:
> If it’s C++, the name mangling is different; look up the options for the Sun
 > and GNU versions of nm respectively, use each version of nm with its
 > demangling option, and whichever has sensible output corresponds to the
 > compiler used.

Even with Studio, there are now at least 7 different binary incompatible
options for building C++ code:

  -compat=4 - pre-C++98 SunPro 4.x compiler ABI (only in Studio 12.2 & older)
  -compat=5 (aka -std=sun03) - C++03 Sun compiler ABI
  -compat=g (aka -std=c++03) - C++03 with g++ extensions/ABI
  -std=c++11 - C++11 features & g++ library/ABI (only in Studio 12.4 & later)
  -library=Cstd - C++03 with Studio libCstd library
  -library=stdcxx4 - C++03 with Apache stdcxx library
  -library=stlport4 - C++03 with STLport library

As you'll see in the CC man page, all C++ code in a program must use the
same -compat, -std, & -library flags - you can't use a library built with
different ones than the program itself uses.

	-alan-

"A strange game. The only winning move is not to play.
  How about a nice game of chess?"



More information about the openindiana-discuss mailing list