Subject: Re: sunpro and -xarch=v9 on Solaris 10
To: Steven Gurr <Steven.Gurr@Sun.COM>
From: None <segv@netctl.net>
List: tech-pkg
Date: 12/04/2005 18:56:00
On Sun, 04 Dec 2005 18:48:29 +0000
Steven Gurr <Steven.Gurr@Sun.COM> wrote:

> I've recently installed the Sun Studio 11 packages from Sun, and  
> tried to start building packages with it. In my mk.conf I have this:
> 
> PKGSRC_COMPILER=sunpro
> CFLAGS+=-xarch=v9
> LDFLAGS+=-xarch=v9
> CC=/opt/SUNWspro/bin/cc
> CXX=/opt/SUNWspro/bin/CC
> 
> 
> Most things seem to have worked, but some packages don't build  
> properly as it makes all the .o files with the -xarch=v9, but then  
> tries to link them without the -xarch=v9 flag. This ends up giving an  
> error. Below is an example of it, taken from databases/db4.

I think that's because you didn't set C++ flags
Below is what it should look like in mk.conf (add your -xarch=v9 to
PKGSRC_CFLAGS and PKGSRC_CXXFLAGS)

# -- Begin compiler and optimisation flags --
#
# Set these when building packages with gcc
#USE_PKGSRC_GCC=YES
#GCC_REQD=4.0.2
#PKGSRC_CFLAGS=-O2 -mcpu=ultrasparc -mvis -mv8plus -pipe
#PKGSRC_CXXFLAGS=-O2 -mcpu=ultrasparc -mvis -mv8plus -pipe

# Set these when building packages with sunpro
PKGSRC_COMPILER=sunpro
CC=/opt/SUNWspro/bin/cc
CXX=/opt/SUNWspro/bin/CC
PKGSRC_CFLAGS=-xO3 -xtarget=native
PKGSRC_CXXFLAGS=-xO3 -xtarget=native -features=%all

# Set optimisation flags
COPTS+=${PKGSRC_CFLAGS}
CFLAGS+=${PKGSRC_CFLAGS}
CXXFLAGS+=${PKGSRC_CXXFLAGS}
#
# -- End compiler and optimisation flags --