Home > Archive > Porting PostgreSQL > September 2005 > Compile with Solaris 10 AMD 64bit Sun CC









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Compile with Solaris 10 AMD 64bit Sun CC
Martijn de Munnik

2005-09-01, 8:24 pm

Hi

I'm trying to compile PostgreSQL 8.0.3 on a Sun Solaris 10 box, dual
opteron and using the sun studio cc compiler. I get the following error;

cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
xarch=amd64 -c -o clog.o clog.c
cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
xarch=amd64 -c -o transam.o transam.c
cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
xarch=amd64 -c -o varsup.o varsup.c
cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
xarch=amd64 -c -o xact.o xact.c
cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
xarch=amd64 -c -o xlog.o xlog.c
"../../../../src/include/storage/s_lock.h", line 701: #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.
cc: acomp failed for xlog.c
gmake[4]: *** [xlog.o] Error 2
gmake[4]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src/backend/access/transam'
gmake[3]: *** [transam-recursive] Error 2
gmake[3]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src/backend/access'
gmake[2]: *** [access-recursive] Error 2
gmake[2]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src'
gmake: *** [all] Error 2

then I add --disable-spinlocks to the configuration and I get the
following error;

gmake[3]: Entering directory `/export/home/users/munnik/software/
postgresql-8.0.3/src/backend/port'
cc -Xa -fast -xarch=amd64 -I../../../src/include -fast -xarch=amd64
-c -o dynloader.o dynloader.c
"dynloader.c", line 4: warning: empty translation unit
cc -Xa -fast -xarch=amd64 -I../../../src/include -fast -xarch=amd64
-c -o pg_sema.o pg_sema.c
cc -Xa -fast -xarch=amd64 -I../../../src/include -fast -xarch=amd64
-c -o pg_shmem.o pg_shmem.c
cc -Xa -fast -xarch=amd64 -c tas.s
Assembler: tas.s
"tas.s", line 12 : Illegal mnemonic
"tas.s", line 14 : Illegal mnemonic
"tas.s", line 15 : Syntax error
"tas.s", line 17 : Syntax error
"tas.s", line 26 : Illegal mnemonic
"tas.s", line 28 : Illegal mnemonic
cc: assembler failed for tas.s
gmake[3]: *** [tas.o] Error 2
gmake[3]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src/backend/port'
gmake[2]: *** [port-recursive] Error 2
gmake[2]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/export/home/users/munnik/software/
postgresql-8.0.3/src'
gmake: *** [all] Error 2

CFLAGS=-fast -xarch=amd64
CPPFLAGS=-fast -xarch=amd64

cc: Sun C 5.7 2005/01/07
SunOS chet 5.10 Generic i86pc i386 i86pc

1st attempt
../configure --prefix=/opt/postgresql --without-readline
2nd attempt
../configure --prefix=/opt/postgresql --without-readline --disable-
spinlocks

any ideas?

Martijn

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Michael Crozier

2005-09-01, 8:24 pm


Hello,

Recently I had a seemingly related problem, but using GCC on Solaris
10/Opteron. I attempted to post to this list, but the message was never
posted (due to moderation?).

Eventually, I ended up manually re-symlinking tas.s to dummy.s, with the
intent to determine the problem before this machine went into production.

tas.s was previously linked to src/backend/port/tas/solaris_i386.s

GCC's error message was:

gcc -m64 -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations -c tas.s
tas.s: Assembler messages:
tas.s:12: Error: suffix or operands invalid for `push'
tas.s:14: Error: suffix or operands invalid for `push'
tas.s:15: Error: `8(%ebp)' is not a valid 64 bit base/index expression
tas.s:17: Error: `(%ebx)' is not a valid 64 bit base/index expression
tas.s:26: Error: suffix or operands invalid for `pop'
tas.s:28: Error: suffix or operands invalid for `pop'
gmake: *** [tas.o] Error 1

My configure command and environment was:

export LD_LIBRARY_PATH=/usr/sfw/lib/amd64
export LIBS="-lpthread -lssl -lcrypto -lgcc_s_amd64"
export LIBPATHS="-L/usr/sfw/lib/amd64 -R/usr/sfw/lib/amd64 -L/usr/lib/64 \
-R/usr/lib/64 -L/usr/lib -R/usr/lib \
-L/opt/python/lib -R/opt/python/lib -L/opt/readline/lib \
-R/opt/readline/lib -L/opt/openssl/lib \
-R/opt/postgresql-POSTGRESQL_VERSION"
export INCPATHS="-I/opt/readline/include -I/opt/python/include/python2.3"
export CC="/usr/sfw/bin/gcc -m64 -O2"
export CFLAGS="$LIBPATHS $INCPATHS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="$LIBPATHS $LIBS"
export SHLIB_LINK="$LDFLAGS"
export BE_DLLLIBS=$SHLIB_LI
NK
./configure --prefix=/opt/postgresql-POSTGRESQL_VERSION --with-python
--with-libraries=/opt/readline/lib:/opt/python/lib:/opt/python/lib/python2.3/config
--with-java --with-maxbackends=128
--with-includes=/opt/python/include/python2.3:/opt/readline/include
--with-gnu-ld --enable-thread-safety


> Hi
>
> I'm trying to compile PostgreSQL 8.0.3 on a Sun Solaris 10 box, dual
> opteron and using the sun studio cc compiler. I get the following error;
>
> cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
> xarch=amd64 -c -o clog.o clog.c
> cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
> xarch=amd64 -c -o transam.o transam.c
> cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
> xarch=amd64 -c -o varsup.o varsup.c
> cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
> xarch=amd64 -c -o xact.o xact.c
> cc -Xa -fast -xarch=amd64 -I../../../../src/include -fast -
> xarch=amd64 -c -o xlog.o xlog.c
> "../../../../src/include/storage/s_lock.h", line 701: #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.
> cc: acomp failed for xlog.c
> gmake[4]: *** [xlog.o] Error 2
> gmake[4]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src/backend/access/transam'
> gmake[3]: *** [transam-recursive] Error 2
> gmake[3]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src/backend/access'
> gmake[2]: *** [access-recursive] Error 2
> gmake[2]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src/backend'
> gmake[1]: *** [all] Error 2
> gmake[1]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src'
> gmake: *** [all] Error 2
>
> then I add --disable-spinlocks to the configuration and I get the
> following error;
>
> gmake[3]: Entering directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src/backend/port'
> cc -Xa -fast -xarch=amd64 -I../../../src/include -fast -xarch=amd64
> -c -o dynloader.o dynloader.c
> "dynloader.c", line 4: warning: empty translation unit
> cc -Xa -fast -xarch=amd64 -I../../../src/include -fast -xarch=amd64
> -c -o pg_sema.o pg_sema.c
> cc -Xa -fast -xarch=amd64 -I../../../src/include -fast -xarch=amd64
> -c -o pg_shmem.o pg_shmem.c
> cc -Xa -fast -xarch=amd64 -c tas.s
> Assembler: tas.s
> "tas.s", line 12 : Illegal mnemonic
> "tas.s", line 14 : Illegal mnemonic
> "tas.s", line 15 : Syntax error
> "tas.s", line 17 : Syntax error
> "tas.s", line 26 : Illegal mnemonic
> "tas.s", line 28 : Illegal mnemonic
> cc: assembler failed for tas.s
> gmake[3]: *** [tas.o] Error 2
> gmake[3]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src/backend/port'
> gmake[2]: *** [port-recursive] Error 2
> gmake[2]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src/backend'
> gmake[1]: *** [all] Error 2
> gmake[1]: Leaving directory `/export/home/users/munnik/software/
> postgresql-8.0.3/src'
> gmake: *** [all] Error 2
>
> CFLAGS=-fast -xarch=amd64
> CPPFLAGS=-fast -xarch=amd64
>
> cc: Sun C 5.7 2005/01/07
> SunOS chet 5.10 Generic i86pc i386 i86pc
>
> 1st attempt
> ./configure --prefix=/opt/postgresql --without-readline
> 2nd attempt
> ./configure --prefix=/opt/postgresql --without-readline --disable-
> spinlocks
>
> any ideas?
>
> Martijn
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql
.org so that your
> message can get through to the mailing list cleanly


--

Conducive Technology Corporation
Taking air cargo information
to the next level

http://www.conducivetech.com
http://www.pathfinder-web.com

Michael Crozier crozierm@conducivete
ch.com

Voice: 503.445.4233
Fax: 503.274.0939


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Tom Lane

2005-09-02, 3:26 am

Martijn de Munnik < martijndemunnik@gmai
l.com> writes:
> I'm trying to compile PostgreSQL 8.0.3 on a Sun Solaris 10 box, dual
> opteron and using the sun studio cc compiler. I get the following error;


It looks to me like we currently cover amd64 only for gcc. Do you want
to roll up your sleeves and fix that, or is it easier just to use gcc?
If the former, look at:

src/include/storage/s_lock.h

There's a chunk of code here that's
#if defined(__sun) && defined(__i386)
This probably needs to also allow whatever Sun's compiler
defines as the CPU symbol for amd64.

src/backend/port/tas/solaris_i386.s

It sounds like this contains code that is not quite
syntactically right for amd64. We manage to share code
between i386 and amd64 for gcc, so maybe that's fixable;
if not, you'll need to create a parallel file with the right
assembler syntax for amd64.

src/template/solaris

There's a "case $host" here that may need modification,
especially if you decide you need a separate .s file.

It's worth your while to fix this, because the performance with
--disable-spinlocks will seriously suck. If you do fix it,
please send in a patch.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com