[OpenIndiana-discuss] SunStudio

Chris Ridd chrisridd at mac.com
Thu Nov 18 06:51:02 UTC 2010

On 17 Nov 2010, at 17:58, Apostolos Syropoulos wrote:

>> Or better, when SunStudio is open-source.   #6-)
> Well, I don't know whether SunStudio will become open-source (probably
> it won't), but these days I am trying to compile bombono-dvd-0.8.1 on b134.
> I have Sun C++ 5.11 SunOS_i386 2010/08/13 and g++  v.4.5.1. The problem
> is that somehow the Sun C++ compiler cannot properly handle templates. 
> The following code snipped from /usr/include/sigc++-2.0/sigc++/signal.h 
> shows how the two compilers handle things:
>  #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR // the coorect (g++) way 
>  typedef std::reverse_iterator<iterator>       reverse_iterator;
>  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
>  #else // Sun C++ way 
>  typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
>                                int, int&, int*, ptrdiff_t> reverse_iterator;
>  typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
>                                int, const int&, const int*, ptrdiff_t> 
> const_reverse_iterator;
> Regardless of my little problem, this little example shows that we should move
> away from Sun Studio. It's simply buggy.

I wouldn't entirely trust the comments in signal.h to be correct. They *might* be, but they might not. G++'s opinion of C++ is not guaranteed to be correct. Sun Studio also keeps supporting old cruddy versions of C++ and the C++ STL, and that's *probably* what's biting you here.

Polemics aside you simply need to match the compiler flags you're using to build bombono-dvd with the ones used to build the GNOME C++ libraries. Once you do that IME other C++ things seem to build OK.

The flags I seem to have used before (I haven't checked things compile still, but it should help) are:

CC -compat=5 -norunpath -features=zla -xannotate=no

I think -compat=5 is the important one. zla means allow (illegal?) zero-length arrays, but I didn't see that in the manpage. The xannotate thing is to avoid a snafu in the OpenSolaris ld.

So one question is why JDS builds the GNOME C++ libraries with these flags. You could check the JDS spec-files repo to verify the exact CC flags being used.



More information about the OpenIndiana-discuss mailing list