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

From: Nishad Prakash <prakashn(at)uci(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andre(at)synchronicity(dot)com, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Bug #584: postgresql will not build on Solaris with cc
Date: 2002-02-12 22:10:12
Message-ID: Pine.GSO.4.44.0202121401090.12261-100000@e4e.oac.uci.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, 12 Feb 2002, Tom Lane wrote:

> pgsql-bugs(at)postgresql(dot)org writes:
> > postgresql will not build on Solaris with cc
>
> I just found out yesterday that /usr/ucb/cc doesn't work very well on
> Solaris; it tries to provide a BSD-ish environment and doesn't really
> succeed. You want to use the SUNpro compiler directly, or via the
> standard link /usr/ccs/bin/ucbcc.

This is indeed important to keep in mind for Solaris users. However, it
will not fix the original poster's problem, which was this:

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);

_fini and _init are already defined in the C run time environment (to
make sure this is true on your system, write a simple 'hello world'
program, compile and link, and run 'nm' on it).

They are also defined in src/interfaces/odbc/psqlodbc.c. I am
speaking of 7.1.3 here, but it seems to be true of whichever version
the OP was trying to build.

Note the rather disingenuous comment in the code, appearing as it does in
the Solaris port.

-------------------------------------------------------------------------
/* These two functions do shared library initialziation on UNIX, well at
* on Linux. I don't know about other systems.
*/

BOOL
_init(void)
{
getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE);
return TRUE;
}

BOOL
_fini(void)
{
return TRUE;
}

-------------------------------------------------------------------------

After you comment out these two, things should build just fine. However,
I have never tested the ODBC interface. so I don't know if things will
*work* just fine as well.

Cheers,

Nishad
--
"Underneath the concrete, the dream is still alive" -- Talking Heads

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-02-12 22:17:01 Re: [BUGS] Bug #581: Sequence cannot be deleted
Previous Message Ian Barwick 2002-02-12 21:58:18 Re: [BUGS] Bug #581: Sequence cannot be deleted