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

Bug #584: postgresql will not build on Solaris with cc

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #584: postgresql will not build on Solaris with cc
Date: 2002-02-12 19:54:15
Message-ID: 200202121954.g1CJsFG52169@postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Andre Blanchard (andre(at)synchronicity(dot)com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
postgresql will not build on Solaris with cc

Long Description
This is the input to build on Solaris 

OS Version 5.6 5.7 5.8 (same results)
Ansi C Compiler version cc -V =  4.0, or 5.1 (same results)

I have many arguments to configure, however I believe the relevant one to this bug is the choice of compiler (aka cc vs gcc)

gcc configures and will build fine.

cc will fail with the following error


ranlib libpsqlodbc.a
cc -Xa -G -h libpsqlodbc.so.0 -Wl,-Bsymbolic info.o bind.o columninfo.o connection.o convert.o drvconn.o environ.o execute.o lobj.o md5.o misc.o options.o pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o statement.o tuple.o tuplelist.o dlg_specific.o odbcapi.o multibyte.o gpps.o -L/home/andre/build/relbf1/sbin/SunOS_56_CC_41 -lnsl -lsocket -lm -R/home/andre/build/relbf1/sbin/SunOS_56_CC_41 -o libpsqlodbc.so.0.27
ld: fatal: symbol `_fini' is multiply defined:
        (file /opt/SUNWspro/SC4.0/lib/crti.o and file psqlodbc.o);
ld: fatal: symbol `_init' is multiply defined:
        (file /opt/SUNWspro/SC4.0/lib/crti.o and file psqlodbc.o);
ld: fatal: File processing errors. No output written to libpsqlodbc.so.0.27
make[3]: *** [libpsqlodbc.so.0.27] Error 1


I would receive this on the first library build, which I corrected with with the following options CFLAGS options to configure

-z muldefs

aka inform the link editor to process code with multiply defined symbols.  This will allow the build to proceed further but it eventually halts at the point indicated in the output above 


Sample Code
I am providing my complete script for completeness.

 cat build_pg.template 
#!/usr/local/bin/bash 
PATH=/usr/local/jakarta-ant-1.4.1/bin:$PATH ; export PATH
unset EXTRA_CONFIG_OPTIONS
if [ ! -z "`echo ${SYNC_PLATFORM} | grep dbg`" ] ; then
        echo Debug
        EXTRA_CONFIG_OPTIONS=`echo --with-debug` ; export EXTRA_CONFIG_OPTIONS
else
        echo No Debug
fi
SRC_DIR=${SYNC_DEV_DIR}/${SYNC_RELEASE}/src/vendor/postgresql/72 ; export SRC_DIR
SBIN_DIR=${SYNC_DEV_DIR}/${SYNC_RELEASE}/sbin/${SYNC_PLATFORM} ; export SBIN_DIR
SOBJ_DIR=${SYNC_DEV_DIR}/${SYNC_RELEASE}/obj/${SYNC_PLATFORM}/postgresql-72 ; export SOBJ_DIR
#NOTE JAVA_HOME is different for each platform
if [ `uname` = "AIX" ] ; then
JAVA_HOME=/usr/local/java.130 ; export JAVA_HOME;
echo Press Return
read input
fi
if [ `uname` = "HP-UX" ] ; then
JAVA_HOME=/usr/local/java.130 ; export JAVA_HOME;
fi
if [ `uname` = "SunOS" ] ; then
JAVA_HOME=/usr/local/j2sdk1_3_1 ; export JAVA_HOME;
CONFIGURE_ENV="CC=cc" ; export CONFIGURE_ENV
CONFIGURE_ENV1="CFLAGS='-z muldefs'" ; export CONFIGURE_ENV1
fi
echo EXTRA CONFIG OPTIONS : ${EXTRA_CONFIG_OPTIONS}
echo CONFIGURE_ENV : ${CONFIGURE_ENV}
TCL_HOME=${HOME}/build/${SYNC_RELEASE}/src/vendor/tcl/tcl8.3.3 ; export TCL_HOME
TK_HOME=${HOME}/build/${SYNC_RELEASE}/src/vendor/tk/tk8.3.3 ; export TK_HOME
TCL_INST=${HOME}/build/${SYNC_RELEASE}/sbin/${SYNC_PLATFORM} ; export TCL_INST
TK_INST=${HOME}/build/${SYNC_RELEASE}/sbin/${SYNC_PLATFORM} ; export TK_INST
#VPATH=${SRC_DIR}/src ; export VPATH
echo "env ${CONFIGURE_ENV} ${CONFIGURE_ENV1} ${SRC_DIR}/configure --srcdir=${SRC_DIR} \
        --prefix=${SOBJ_DIR}/install \
        --enable-locale \
        --enable-multibyte \
        --with-CXX \
        ${EXTRA_CONFIG_OPTIONS} \
        --with-tcl \
        --without-tk \
        --with-java \
        --with-x \
        --with-odbc \
        --with-tclconfig=${TCL_INST} \
        --with-tkconfig=${TK_INST} \
        --with-includes="${SOBJ_DIR}/../tk/include ${SOBJ_DIR}/../tcl/include" \
        --with-libraries=${TCL_INST} \
        --bindir=${SBIN_DIR} \
        --libdir=${SBIN_DIR} "
env ${CONFIGURE_ENV} CFLAGS='-z muldefs' bash  ${SRC_DIR}/configure --srcdir=${SRC_DIR} \
        --prefix=${SOBJ_DIR}/install \
        --enable-locale \
        --enable-multibyte \
        --with-CXX \
        ${EXTRA_CONFIG_OPTIONS} \
        --with-tcl \
        --without-tk \
        --with-java \
        --with-x \
        --with-odbc \
        --with-tclconfig=${TCL_INST} \
        --with-tkconfig=${TK_INST} \
        --with-includes="${SOBJ_DIR}/../tk/include ${SOBJ_DIR}/../tcl/include" \
        --with-libraries=${TCL_INST} \
        --bindir=${SBIN_DIR} \
        --libdir=${SBIN_DIR}
make
  

No file was uploaded with this report


pgsql-bugs by date

Next:From: Brent VernerDate: 2002-02-12 20:09:28
Subject: Re: [BUGS] Bug #581: Sequence cannot be deleted
Previous:From: pgsql-bugsDate: 2002-02-12 19:34:39
Subject: Bug #584: postgresql will not build on Solaris with cc

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