stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: config with wide has no effect on Solaris/Intel + patch
Date Sat, 07 Jul 2007 21:08:46 GMT
Michael van der Westhuizen wrote:
> Aplogies for replying to my own mail.
> 
> On 7/7/07, Michael van der Westhuizen <r1mikey@gmail.com> wrote:
>> Hi,
> [snip]
>> Note that on Solaris CXXFLAGS.wide is supposed to be -xarch=amd64, but
>> this is not being used by the build system.
>>
>> Hunting this down, it seems that sunpro.config expects "uname -p" to
>> return amd64 on 64 bit Solaris/Intel. This is not true, it returns
>> i386.

I don't have access to Solaris/AMD64 at the moment but from our logs
uname -a does include i386 and not amd64. I wonder what made us think
it was amd64.

> 
> Here's a better diff. This handles the correct wide flags when using
> Sun C++ 5.9 or better (Studio 12).

Thanks!

I recall reading somewhere that Sun C++ 5.9 supports the gcc -m64
option but I can't find the reference. Do you happen to have a link?
The x86 equivalent I was able to find in the online documentation is
still -xarch=amd64 (I couldn't find -m64 in the manual):
http://docs.sun.com/source/819-3690/Comp_Options_App.html#pgfId-999544

We're only just getting around to setting up the compiler but once it's
up and running we'll test your patch with it.

Martin

PS I think I've figured out why I couldn't find -m64 on the Compiler
Options pages: they are for Sun Studio 11, even though they're pointed
to from the Sun Studio 12 Documentation page here:

   http://developers.sun.com/sunstudio/documentation/ss12/
   --> http://developers.sun.com/sunstudio/documentation/ss12/opts

> 
> Michael
> 
> Index: etc/config/sunpro.config
> ===================================================================
> --- etc/config/sunpro.config    (revision 554241)
> +++ etc/config/sunpro.config    (working copy)
> @@ -77,21 +77,32 @@
> SINGL_CPPFLAGS =
> SINGL_LDFLAGS  =
> 
> -# (try to) determine the architecture via the (non-standard) -p option
> -# recognized on (at least) Linux and Solaris
> -arch=$(shell uname -p 2>/dev/null)
> +CCMAJOR=$(shell echo $(CCVER) | cut -f1 -d'.')
> +CCMINOR=$(shell echo $(CCVER) | cut -f2 -d'.')
> 
> -ifeq ($(arch),sparc)
> -    # wide (64-bit) flags -- must be set explicitly
> -    # narrow (32-bit) flags are implicit on SPARC
> -    wide_flags     = -xarch=v9
> -    narrow_flags   = -xarch=v8
> +ifeq ($(shell expr $(CCMAJOR) \>= 5 \& $(CCMINOR) \>= 9),1)
> +    wide_flags     = -m64
> +    narrow_flags   = -m32
> else
> -    # wide (64-bit) flags -- must be set explicitly
> -    # narrow (32-bit) flags are implicit on AMD64
> -    ifeq ($(arch),amd64)
> -        wide_flags     = -xarch=amd64
> -        narrow_flags   =
> +    # (try to) determine the architecture via the (non-standard) -p option
> +    # recognized on (at least) Linux and Solaris
> +    arch=$(shell uname -p 2>/dev/null)
> +
> +    ifeq ($(arch),sparc)
> +        # wide (64-bit) flags -- must be set explicitly
> +        # narrow (32-bit) flags are implicit on SPARC
> +        wide_flags     = -xarch=v9
> +        narrow_flags   = -xarch=v8
> +    else
> +        # wide (64-bit) flags -- must be set explicitly
> +        # narrow (32-bit) flags are implicit on AMD64
> +        ifeq ($(OSNAME),SunOS)
> +            arch=$(shell /usr/bin/optisa amd64)
> +        endif
> +        ifeq ($(arch),amd64)
> +            wide_flags     = -xarch=amd64
> +            narrow_flags   =
> +        endif
>     endif
> endif
> 


Mime
View raw message