Unix Technical Forum

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

This is a discussion on some linker troubles with rc5 on sun studio 9 ... within the pgsql Hackers forums, part of the PostgreSQL category; --> i have encountered some problems with sun studio 9 (version 8 always worked for me). obviously it does not ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 03:16 AM
=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?=
 
Posts: n/a
Default some linker troubles with rc5 on sun studio 9 ...

i have encountered some problems with sun studio 9 (version 8 always
worked for me).
obviously it does not like my linker flags ...

when running the following script I get ...

#!/bin/sh

LD_LIBRARY_PATH=/opt/sfw/lib:/usr/local/lib:$LD_LIBRARY_PATH
# PATH=/opt/SUNWspro/bin/:/opt/sfw/bin:$PATH:/usr/ccs/bin
PATH=/usr/ccs/bin/:/opt/SUNWspro/bin/:/opt/sfw/bin::/usr/sbin:/usr/bin

gmake distclean
CC='/usr/ucb/cc'

export CC
export PATH
export LD_LIBRARY_PATH

../configure --prefix=/usr/local/pgsql --disable-rpath --enable-debug
--without-readline --without-gnu-ld

the right compiler and linker are chosen ...

checking whether we are using the GNU C compiler... no
checking whether /usr/ucb/cc accepts -g... yes
configure: using CFLAGS=-v -g
checking whether the C compiler still works... yes
checking how to run the C preprocessor... /usr/ucb/cc -Xa -E
....
checking for flex... /opt/sfw/bin/flex
checking whether ln -s works... yes
checking for non-GNU ld... /usr/ccs/bin//ld
checking if the linker (/usr/ccs/bin//ld) is GNU ld... no
checking for ranlib... ranlib


running gmake will leave me with an error ...


/opt/SUNWspro/prod/bin/acomp -Qy -y-o -yhio.o -I../../../../src/include
-I/usr/ucbinclude -g "/opt/SUNWspro/prod/bin/acc -Xs
-YP,:/usr/ucblib:/opt/SUNWspro/prod/bin/../lib:/opt/SUNWspro/prod/bin:/usr/ccs/lib:/usr/lib
-Xa -v -g -I../../../../src/include -c -I/usr/ucbinclude -c" -b -y-fbe
-y/opt/SUNWspro/prod/bin/fbe -y-xarch=generic -y-xmemalign=4s -y-verbose
-Xa -D__SunOS_5_8 -D__SUNPRO_C=0x560 -Dunix -Dsun -Dsparc -D__unix
-D__sun -D__sparc -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__RESTRICT
-D__PRAGMA_REDEFINE_EXTNAME -dg -y-g -I/opt/SUNWspro/prod/include/cc
-destination_ir=yabe -i hio.c
"/usr/ucbinclude/sys/signal.h", line 223: warning: typedef redeclared:
sig_atomic_t
/usr/ucb/cc -Xa -v -g -I../../../../src/include -c -o tuptoaster.o
tuptoaster.c
ucbcc: Warning: Option
-YP,:/usr/ucblib:/opt/SUNWspro/prod/bin/../lib:/opt/SUNWspro/prod/bin:/usr/ccs/lib:/usr/lib
passed to ld, if ld is invoked, ignored otherwise
ucbcc: Warning: "-Xa" redefines compatibility mode from "SunC
transition" to "ANSI"
### command line files and options (expanded):
### -v -g -I../../../../src/include -c -o tuptoaster.o tuptoaster.c
-I/usr/ucbinclude -lucb -lsocket -lnsl -lelf -laio
### ucbcc: Note: NLSPATH =
/opt/SUNWspro/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/SUNWspro/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
/opt/SUNWspro/prod/bin/acomp -Qy -y-o -ytuptoaster.o
-I../../../../src/include -I/usr/ucbinclude -g
"/opt/SUNWspro/prod/bin/acc -Xs
-YP,:/usr/ucblib:/opt/SUNWspro/prod/bin/../lib:/opt/SUNWspro/prod/bin:/usr/ccs/lib:/usr/lib
-Xa -v -g -I../../../../src/include -c -I/usr/ucbinclude -c" -b -y-fbe
-y/opt/SUNWspro/prod/bin/fbe -y-xarch=generic -y-xmemalign=4s -y-verbose
-Xa -D__SunOS_5_8 -D__SUNPRO_C=0x560 -Dunix -Dsun -Dsparc -D__unix
-D__sun -D__sparc -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__RESTRICT
-D__PRAGMA_REDEFINE_EXTNAME -dg -y-g -I/opt/SUNWspro/prod/include/cc
-destination_ir=yabe -i tuptoaster.c
"/usr/ucbinclude/sys/signal.h", line 223: warning: typedef redeclared:
sig_atomic_t
"tuptoaster.c", line 966: member can not have variably modified type: data
"tuptoaster.c", line 1075: cannot recover from previous errors
gmake[4]: *** [tuptoaster.o] Error 10
gmake[4]: Leaving directory
`/usr/share/src/pg/postgresql-8.0.0rc5/src/backend/access/heap'
gmake[3]: *** [heap-recursive] Error 2
gmake[3]: Leaving directory
`/usr/share/src/pg/postgresql-8.0.0rc5/src/backend/access'
gmake[2]: *** [access-recursive] Error 2
gmake[2]: Leaving directory
`/usr/share/src/pg/postgresql-8.0.0rc5/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/share/src/pg/postgresql-8.0.0rc5/src'
gmake: *** [all] Error 2

I cannot find something unusual in tuptoaster.c ...

static Datum
toast_save_datum(Relation rel, Datum value)
{
Relation toastrel;
Relation toastidx;
HeapTuple toasttup;
InsertIndexResult idxres;
TupleDesc toasttupDesc;
Datum t_values[3];
char t_nulls[3];
varattrib *result;
struct
{
struct varlena hdr;
char data[TOAST_MAX_CHUNK_SIZE];
} chunk_data;
int32 chunk_size;
int32 chunk_seq = 0;


when using the following configure options I will get a different error:

../configure --prefix=/usr/local/pgsql --enable-debug --without-readline



"/usr/ucbinclude/sys/signal.h", line 223: warning: typedef redeclared:
sig_atomic_t
/usr/ucb/cc -Xa -v -g zic.o ialloc.o scheck.o localtime.o
-L../../src/port -Wl,-R/usr/local/pgsql/lib -lpgport -lz -lrt -lresolv
-lgen -lsocket -lnsl -ldl -lm -o zic
ucbcc: Warning: Option
-YP,:/usr/ucblib:/opt/SUNWspro/prod/bin/../lib:/opt/SUNWspro/prod/bin:/usr/ccs/lib:/usr/lib
passed to ld, if ld is invoked, ignored otherwise
ucbcc: Warning: "-Xa" redefines compatibility mode from "SunC
transition" to "ANSI"
ucbcc: Warning: Option -Wl,-R/usr/local/pgsql/lib passed to ld, if ld is
invoked, ignored otherwise
### command line files and options (expanded):
### -v -g zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport
-lz -lrt -lresolv -lgen -lsocket -lnsl -ldl -lm -o zic -I/usr/ucbinclude
-lucb -lsocket -lnsl -lelf -laio
### ucbcc: Note: NLSPATH =
/opt/SUNWspro/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/SUNWspro/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
### ucbcc: Note: LD_LIBRARY_PATH = /usr/ucblib:/usr/ccs/lib:/usr/lib
### ucbcc: Note: LD_RUN_PATH = /usr/ucblib
### ucbcc: Note: LD_OPTIONS = (null)
/usr/ccs/bin/ld -zld32=-S/opt/SUNWspro/prod/lib/libldstab_ws.so
-zld64=-S/opt/SUNWspro/prod/lib/v9/libldstab_ws.so -o zic
/opt/SUNWspro/prod/lib/crti.o /opt/SUNWspro/prod/lib/crt1.o
/opt/SUNWspro/prod/lib/misalign.o /opt/SUNWspro/prod/lib/values-xa.o -Y
P,/opt/SUNWspro/prod/lib:/usr/ccs/lib:/lib:/usr/lib
-YP,:/usr/ucblib:/opt/SUNWspro/prod/bin/../lib:/opt/SUNWspro/prod/bin:/usr/ccs/lib:/usr/lib
zic.o ialloc.o scheck.o localtime.o -L../../src/port
-Wl,-R/usr/local/pgsql/lib -lpgport -lz -lrt -lresolv -lgen -lsocket
-lnsl -ldl -lm -lucb -lsocket -lnsl -lelf -laio -lc
/opt/SUNWspro/prod/lib/crtn.o
ld: warning: option -YP appears more than once, first setting taken
/usr/ccs/bin/ld: illegal option -- W
usage: ld [-6:abc:d:e:f:h:il:mo:rstu:z:B:CD:F:GI:L:M:N:P:Q:R :S:VY:?]
file(s)
[-64] enforce a 64-bit link-edit
[-a] create an absolute file
[-b] do not do special PIC relocations in a.out
[-B direct] specify `direct' bindings for executable when run
[-B dynamic | static]
search for shared libraries|archives
[-B eliminate] eliminate unqualified global symbols from the
symbol table
[-B group] relocate object from within group
[-B local] reduce unqualified global symbols to local
[-B reduce] process symbol reductions
[-B symbolic] bind external references to definitions when
creating
shared objects
[-c name] record configuration file `name'
[-C] demangle C++ symbol name diagnostics
[-d y | n] operate in dynamic|static mode
[-D token,...] print diagnostic messages
[-e epsym] use `epsym' as entry point address
[-f name] specify library for which this file is an auxiliary
filter
[-F name] specify library for which this file is a filter
[-G] create a shared object
[-h name] use `name' as internal shared object identifier
[-i] ignore LD_LIBRARY_PATH setting
[-I name] use `name' as path of interpreter
[-l x] search for libx.so or libx.a
[-L path] search for libraries in directory `path'
[-m] print memory map
[-M mapfile] use processing directives contained in `mapfile'
[-N string] create a dynamic dependency for `string'
[-o outfile] name the output file `outfile'
[-p auditlib] identify audit library to accompany this object
[-P auditlib] identify audit library for processing the
dependencies
of this object
[-Q y | n] do|do not place version information in output file
[-r] create a relocatable object
[-R path] specify a library search path to be used at run
time
[-s] strip any symbol and debugging information
[-S supportlib]
specify a link-edit support library
[-t] do not warn of multiply-defined symbols that have
different sizes or alignments
[-u symname] create an undefined symbol `symname'
[-V] print version information
[-Y P,dirlist] use `dirlist' as a default path when searching for
libraries
[-z absexec] when building an executable absolute symbols
referenced in dynamic objects are promoted to
the executable
[-z allextract | defaultextract | weakextract]
extract all member files, only members that resolve
undefined tor tentative symbols, or allow
extraction of
archive members to resolvetweak references from
archive files
[-z combreloc] combine multiple relocation sections
[-z nocompstrtab]
disable compression of string tables
[-z defs] disallow undefined symbol references
[-z direct | nodirect]
enable|disable direct binding to shared object
dependencies
[-z endfiltee] marks a filtee such that it will terminate a
filters
search
[-z finiarray=function]
name of function to be appended to the .finiarray
[-z groupperm | nogroupperm]
enable|disable setting of group permissions
on dynamic dependencies
[-z ignore | record]
ignore|record unused dynamic dependencies
[-z initarray=function]
name of function to be appended to the .initarray
[-z initfirst] mark object to indicate that its .init section
should
be executed before the .init section of any other
objects
[-z interpose] dynamic object is to be an `interposer' on direct
bindings
[-z lazyload | nolazyload]
enable|disable delayed loading of shared object
dependencies
[-z ld32=arg1,arg2,...]
define arguments applicable to the 32-bit class
of ld(1)
[-z ld64=arg1,arg2,...]
define arguments applicable to the 64-bit class
of ld(1)
[-z loadfltr] mark filter as requiring immediate loading of its
filtees at runtime
[-z muldefs] allow multiply-defined symbols
[-z nodefs] allow undefined symbol references
[-z nodefaultlib]
mark object to ignore any default library
search path
[-z nodelete] mark object as non-deletable
[-z nodlopen] mark object as non-dlopen()'able
[-z nodump] mark object as non-dldump()'able
[-z nopartial] expand any partially initialized symbols
[-z noversion] don't record any version sections
[-z now] mark object as requiring non-lazy binding
[-z origin] mark object as requiring $ORIGIN processing
[-z preinitarray=function]
name of function to be appended to the
..preinitarray
[-z redlocsym] reduce local syms in .symtab to a minimum
[-z rescan] rescan archive list until no further member
extraction occurs
[-z text] disallow output relocations against text
[-z textoff] allow output relocations against text
[-z textwarn] warn if there are relocations against text
[-z verbose] generate warnings for suspicious processings
gmake[2]: *** [zic] Error 1
gmake[2]: Leaving directory
`/usr/share/src/pg/postgresql-8.0.0rc5/src/timezone'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/share/src/pg/postgresql-8.0.0rc5/src'
gmake: *** [all] Error 2



configure will still find the right path to the linker by the way ...

does anybody know how to fix that problem?

best regards,

hans

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


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 03:17 AM
Tom Lane
 
Posts: n/a
Default Re: some linker troubles with rc5 on sun studio 9 ...

=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <postgres@cybertec.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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 03:31 AM
=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?=
 
Posts: n/a
Default Re: some linker troubles with rc5 on sun studio 9 ...

Tom Lane wrote:
> =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <postgres@cybertec.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


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

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:52 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com