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@gmx.net http://funkturm.homeip.net/~peter