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: 41FB59B5.4000205@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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)];
}s1;

printf("offsetof: %d, sizeof %d\n",
offsetof(Ss, bits),
sizeof(s1.data));
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
`/usr/share/src/pg/postgresql-8.0.0/src/backend/storage/lmgr'
/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
lwlock.c
/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
s_lock.c
/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
`/usr/share/src/pg/postgresql-8.0.0/src/backend/storage/lmgr'
gmake[3]: *** [lmgr-recursive] Error 2
gmake[3]: Leaving directory
`/usr/share/src/pg/postgresql-8.0.0/src/backend/storage'
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?

Hans

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

In response to

Browse pgsql-hackers by date

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