Re: Undefined symbols in pgsql libraries using Solaris 2.8/Sparc

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Oyvind Hallsteinsen <oyvindh(at)idb(dot)hist(dot)no>
Cc: <pgsql-ports(at)postgresql(dot)org>
Subject: Re: Undefined symbols in pgsql libraries using Solaris 2.8/Sparc
Date: 2001-07-14 23:27:56
Message-ID: Pine.LNX.4.30.0107150058330.818-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Oyvind Hallsteinsen writes:

> I've been trying to install PostgreSQL 7.1.2 on machine running Solaris
> 8 4/01 Sparc using GCC 3.95.3, GNU ld 2.11.2 and GNU make 3.79.1.

> Building pgsql 7.1.2 on the solaris/sparc computer:
> % export LD_LIBRARY_PATH=/usr/local/lib;

Why?

> % ./configure --prefix=/www/local/pgsql
> % make
> % make install

> However, when httpd tries to load libphp4.so it dies with the following
> error:
> -----------------------------------------
> bash-2.05# /www/bin/apachectl start
> Syntax error on line 205 of /www/conf/httpd.conf:
> Cannot load /www/libexec/libphp4.so into server: ld.so.1:
> /www/bin/httpd: fatal: relocation error: file /usr/lib/libpq.so.2:
> symbol main: referenced symbol not found
> /www/bin/apachectl start: httpd could not be started
> -----------------------------------------

Hard to know why libpq wants to have a main symbol. Looks like a linker
fault.

> Even worse:
> -----------------------------------------
> bash-2.05# ldd -r /www/local/pgsql/lib/plpgsql.so
> libm.so.1 => /usr/lib/libm.so.1
> libc.so.1 => /usr/lib/libc.so.1
> libdl.so.1 => /usr/lib/libdl.so.1
> /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
> symbol not found: main
> (/www/local/pgsql/lib/plpgsql.so)
> symbol not found: namein
> (/www/local/pgsql/lib/plpgsql.so)
> symbol not found: textout
> (/www/local/pgsql/lib/plpgsql.so)

This is not surprising, those symbols are supposed to be resolved at run
time.

> I also tried compiling PostgreSQL 7.0.3. I now had no trouble with
> libpq, and thus was able to load httpd.

In 7.0.3 you would have gotten your shared libraries linked by Sun's ld,
so the GNU linker would evidently be to blame here. It could be that the
GCC installation doesn't pass the right flags, or that the linker is
simply broken on Solaris (wouldn't be the first time).

Try and see what GCC does (gcc -v, methinks) and/or try to invoke the
linker by hand. Or install GCC to use Sun's linker.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-ports by date

  From Date Subject
Next Message Kovács Péter 2001-07-16 19:24:39 Unable to build on Solaris 2.6
Previous Message Andre Schnabel 2001-07-14 10:16:26 Re: Compilation on Solaris 2.8