Thread: Solaris cc compiler on amd: PostgreSQL does not have native spinlock support on this platform

Hello,
    I'm trying to compile postgresql and I got this message telling me
to inform you:

"../../../../src/include/storage/s_lock.h", line 806: #error: PostgreSQL
does not have native spinlock support on this platform.  To continue the
compilation, rerun configure using --disable-spinlocks.  However,
performance will be poor.  Please report this to pgsql-bugs@postgresql.org.

This is the configure line i used:
MAKE=gmake CC=/opt/SUNWspro/bin/cc CFLAGS="-xtarget=opteron
-xarch=amd64" CXX=/opt/SUNWspro/bin/CC CXXFLAGS="-xtarget=opteron
-xarch=amd64" LDFLAGS="-xtarget=opteron -xarch=amd64" ./configure
--without-readline

If i try this configuration command instead:
MAKE=gmake CC=/opt/SUNWspro/bin/cc CFLAGS="-fast"
CXX=/opt/SUNWspro/bin/CC CXXFLAGS="-fast" LDFLAGS="-fast" ./configure
--without-readline

It compiles but then i get a 32 bit executable which is not what i want.

This is on a solaris 10 with amd processor using the sun forte 11 compilers.

Are there any fix for this?

Thanks.
Pierre Girard <pierre.girard@gerad.ca> writes:
> It compiles but then i get a 32 bit executable which is not what i want.
> This is on a solaris 10 with amd processor using the sun forte 11 compilers.
> Are there any fix for this?

You'd need to do something about adapting src/backend/port/tas/solaris_i386.s
to amd64, and then change the part of s_lock.h that mentions Solaris/386
to also accept x86_64 not just __i386.  Also see src/template/solaris
which controls configure's determination of which tas file is needed.

It's possible that the assembly code would work as-is on amd, in which
case you'd just need a one-liner change in s_lock.h and maybe some
adjustment of the template file.

Please send a patch if you fix this.

            regards, tom lane

Re: Solaris cc compiler on amd: PostgreSQL does not have native

From
Pierre Girard
Date:
Tom Lane wrote:

>You'd need to do something about adapting src/backend/port/tas/solaris_i386.s
>
>It's possible that the assembly code would work as-is on amd, in which
>case you'd just need a one-liner change in s_lock.h and maybe some
>adjustment of the template file.
>
>
It doesn't compile with the options to create amd code.
cc -Xa -xtarget=opteron -xarch=amd64 -c solaris_i386.s
Assembler: tas.s
        "solaris_i386.s", line 12 : Illegal mnemonic
        "solaris_i386.s", line 14 : Illegal mnemonic
        "solaris_i386.s", line 15 : Syntax error
        "solaris_i386.s", line 17 : Syntax error
        "solaris_i386.s", line 26 : Illegal mnemonic
        "solaris_i386.s", line 28 : Illegal mnemonic
cc: assembler failed for solaris_i386.s

The same file compiles without those options:
cc -Xa -c solaris_i386.s

>Please send a patch if you fix this.
>
>
Unfortunately i won't be able to help unless you have some code for me
to try out.