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

From: Hans-Jürgen Schönig <postgres(at)cybertec(dot)at>
To: pgsql-hackers(at)postgresql(dot)org, eg(at)cybertec(dot)at
Subject: some linker troubles with rc5 on sun studio 9 ...
Date: 2005-01-13 17:58:31
Message-ID: 41E6B6C7.5050807@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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:p: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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2005-01-13 18:22:42 Re: Much Ado About COUNT(*)
Previous Message Csaba Nagy 2005-01-13 16:07:12 Re: [HACKERS] Much Ado About COUNT(*)