[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: flag issue in AC_PROG_CXX for Sun Studio

From: Ralf Wildenhues
Subject: Re: flag issue in AC_PROG_CXX for Sun Studio
Date: Fri, 26 Feb 2010 07:30:34 +0100
User-agent: Mutt/1.5.20 (2009-10-28)

* Eric Blake wrote on Fri, Feb 26, 2010 at 03:41:02AM CET:
> According to Bob Friesenhahn on 2/25/2010 7:03 PM:
> > On Thu, 25 Feb 2010, Eric Blake wrote:
> >> According to Monty Taylor on 7/30/2009 1:28 PM:
> >>> The ever helpful setting of -g into CXXFLAGS by AC_PROG_CXX is incorrect
> >>> on Sun Studio (IMHO). Currently, the test checks for Sun Studio compiler
> >>> and, if so, injects -g. The problem is, -g on Sun Studio means "include
> >>> symbols _AND_ disable inlining" The appropriate flag that's similar to
> >>> -g on GCC is -g0. (Thanks Sun Studio, for being weird)

> > Note that this weirdness only applies to the C++ compiler.  I don't
> > believe that the C compiler will accept it.
> Thankfully, CFLAGS and CXXFLAGS are separate variables.  So it sounds like
> all we have to do is teach AC_PROG_CXX to decide if this is the Sun C++
> compiler, and if so, use -g0 instead of -g. But I don't have quick access
> to the Sun compiler, to write a reliable test for deciding between the two
> ideas, so I'm relying on some help on that front.

I agree that also disabling inlining may be weird, and that the default
choices for CFLAGS and CXXFLAGS may make questionable assumptions about
bug distribution in (esp. past) compilers, but is it worth changing this
long-known semantics for that?

More, is it worth deviating from feature tests for this setting?  Other
compilers accept -g0 too, for example GCC does and it doesn't do what
we would like to have.

Libtool uses something like this ($CC is set to the C++ compiler at this

case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)  Yes;;

but that won't work with this Solaris 5.6 compiler
$ CC -V
CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-23 2005/10/14

but starting from 5.7 it should "work" (in the sense that it is not
CC: Sun C++ 5.5 Patch 113817-21 2007/08/28
CC: Sun C++ 5.8 Patch 121017-20 2009/04/22
CC: Sun C++ 5.9 SunOS_sparc Patch 124863-20 2010/01/19
(used on this Solaris 10 as well)
CC: Sun C++ 5.9 SunOS_i386 Patch 124864-20 2010/01/19
(this is Solaris 10 too)

other than that I can help test is:
CC: Sun C++ 5.9 Linux_i386 Build35_2 2006/12/04

Note that anyway autoconf.texi would need a patch too.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]