Subject: Re: sunpro and -xarch=v9 on Solaris 10
To: None <>
From: Steven Gurr <Steven.Gurr@Sun.COM>
List: tech-pkg
Date: 12/05/2005 11:30:48 wrote:
> On Mon, 5 Dec 2005 10:14:19 +1100
> grant beattie <> wrote:
>>On Sun, Dec 04, 2005 at 10:23:38PM +0000, wrote:
>>>On Sun, 4 Dec 2005 21:51:49 +0000
>>> wrote:
>>>>I've just found out that you need to set the following variable in your
>>>>mk.conf to build 64-bit binaries
>>>>It is used by mk/compiler/ file, that has the following line
>>>>_COMPILER_ABI_FLAG.64=  -xtarget=ultra -xarch=v9
>>>pkgsrc developers, any chance to add a note about ABI variable to
>>>bootstrap/README.Solaris file? I think without it, many packages will fail
>>>to compile into 64-bit binaries.
>>I believe it is already documented in the pkgsrc guide. if not, it
>>should be.
>>what version of Sun Studio are you using that requires this change?
>>I'd rather the options be backward and forward compatible with as many
>>versions as possible.
> I've never seen it in any documentation I've read so far, but then I didn't
> read the entire pkgsrc guide line by line. I'm using Sun Studio 11, but that
> shouldn't matter, the fact is there needs to be a sure way to tell the compiler
> to build 64-bit binaries (which I think ABI=64 does), otherwise some bits are
> built as 64-bit objects and others as 32-bit objects, and then you get wrong
> ELF errors, etc. Setting CFLAGS += -xarch=v9 does not guarantee that, coz I
> think some packages ignore CFLAGS variable, or build/link objects in some weird
> way.

Thanks for the help. I've now added ABI=64 in my mk.conf and everything 
is building without problems. :)

I didn't read the entire pkgsrc guide either before starting, however I 
did read bootstrap/README.Solaris before starting and it doesn't mention 
this ABI variable at all. All it says about 64-bit binaries with Sun 
Studio is the following:

To build 64-bit binaries:
         CFLAGS=         -xtarget=ultra -xarch=v9

I'm also using Sun Studio 11, for the record.