Skip site navigation (1) Skip section navigation (2)

Re: some linker troubles with rc5 on sun studio 9 ...

From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, eg(at)cybertec(dot)at
Subject: Re: some linker troubles with rc5 on sun studio 9 ...
Date: 2005-01-29 09:39:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane wrote:
> =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <postgres(at)cybertec(dot)at> writes:
>>"tuptoaster.c", line 966: member can not have variably modified type: data
> We've seen that before.  Apparently there are some versions of Sun's
> compiler that are too stupid to reduce this constant expression to a
> constant.  File a bug with Sun.
> 			regards, tom lane
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

As Tom pointed it this is truly a compiler bug of zthe compiler included 
in Sun Studio 9. It seems as if Sun is attempting to fix that.

Here is a test case which will fail on Sun CC 5.6.

#include <stddef.h>
#include <stdio.h>

typedef struct {
int s1;
char data[10];
unsigned char bits[1];
} Ss;

int main(int argc, char **argv){
struct {
int ap;
char data[offsetof(Ss,bits)];

printf("offsetof: %d, sizeof %d\n",
offsetof(Ss, bits),
return 0;

When I'm using Studio 9 cc, compilation failed:
 >/opt/F9/SUNWspro/bin/cc -V -Xa -o test test.c
cc: Sun C 5.6 2004/07/15
acomp: Sun C 5.6 2004/07/15
"test.c", line 14: member can not have variably modified type: data
cc: acomp failed for test.c

8.0.0 compiles now with --disable-spinlocks.

When spinlocks are enabled we will see one more problem ...

gmake[4]: Entering directory 
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o lmgr.o lmgr.c
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o lock.o lock.c
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o proc.o proc.c
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o 
deadlock.o deadlock.c
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o lwlock.o 
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o spin.o spin.c
/opt/SUNWspro/bin/cc -Xa -v -g -I../../../../src/include -c -o s_lock.o 
/opt/SUNWspro/prod/bin/fbe: "/tmp/yabeAAAQ.aaFl", line 277: error: can't 
compute difference between symbols in different segments
Failure in /opt/SUNWspro/prod/bin/fbe, status = 0x100
Fatal Error exec'ing /opt/SUNWspro/prod/bin/fbe
cc: acomp failed for s_lock.c
gmake[4]: *** [s_lock.o] Error 2
gmake[4]: Leaving directory 
gmake[3]: *** [lmgr-recursive] Error 2
gmake[3]: Leaving directory 
gmake[2]: *** [storage-recursive] Error 2
gmake[2]: Leaving directory `/usr/share/src/pg/postgresql-8.0.0/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/share/src/pg/postgresql-8.0.0/src'
gmake: *** [all] Error 2

The nice thing is: This error is not documented and we have not found a 
flag to preserve /tmp/yabeAAAQ.aaFl (which makes this error very useful).

google does not contain information about this issue because all four 
sites I have found are down.

Has anybody ever seen something like that before?


Cybertec Geschwinde u Schoenig
Schoengrabern 134, A-2020 Hollabrunn, Austria
Tel: +43/660/816 40 77,

In response to

pgsql-hackers by date

Next:From: MischaDate: 2005-01-29 10:10:22
Subject: Re: Group-count estimation statistics
Previous:From: Oleg BartunovDate: 2005-01-29 08:23:56
Subject: Re: strange 'vacuum verbose analyze' behaviour

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group