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

Поиск
Список
Период
Сортировка
От Nishad Prakash
Тема Re: Bug #584: postgresql will not build on Solaris with cc
Дата
Msg-id Pine.GSO.4.44.0202121401090.12261-100000@e4e.oac.uci.edu
обсуждение исходный текст
Ответ на Re: Bug #584: postgresql will not build on Solaris with cc  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Tue, 12 Feb 2002, Tom Lane wrote:

> pgsql-bugs@postgresql.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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug #584: postgresql will not build on Solaris with cc
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug #583: Wrong example in 7.2 Tutorial