Hello,

I have a report from compiling PostgreSQL 6.5.3 on Solaris/SPARC with gcc/ld
(it was not run by me, I was ask to help to solve this problem). Everything
goes OK (with template solaris_sparc_gcc autodetected when running
configure) but when trying to load plpgsql or other loaded module it woes
with 

ERROR:  Load of file /usr/local/pgsql/lib/plpgsql.so failed: ld.so.1:
/usr/local/pgsql/bin/postmaster: fatal: relocation error: file
/usr/local/pgsql/lib/plpgsql.so: symbol CurrentMemoryContext: referenced
symbol not found

it is caused by the fact that the symbol CurrentMemoryContext is not
exported from the main executable (postmaster). The solution is to use
"-export-dynamic" switch when linking postgres executable (it is used on
Linux).

I think it will require a new system specific makefile. The
Makefile.solaris_sparc is done for solaric_sparc_cc template. More details
can be send.


			Dan

----------------------------------------------
Daniel Horak
network and system administrator
e-mail: horak@sit.plzen-city.cz
privat e-mail: dan.horak@email.cz ICQ:36448176
----------------------------------------------

Wed, 1 Mar 2000 17:01:10 +0100 
=?iso-8859-2?Q?Hor=E1k_Daniel?= <horak@sit.plzen-city.cz>
PostgreSQL on Solaris/SPARC with gcc
On Wed, 1 Mar 2000, [iso-8859-2] HorО©╫k Daniel wrote:
> I have a report from compiling PostgreSQL 6.5.3 on Solaris/SPARC with gcc/ld
> (it was not run by me, I was ask to help to solve this problem). Everything
> goes OK (with template solaris_sparc_gcc autodetected when running
> configure) but when trying to load plpgsql or other loaded module it woes
> with 
> 
> ERROR:  Load of file /usr/local/pgsql/lib/plpgsql.so failed: ld.so.1:
> /usr/local/pgsql/bin/postmaster: fatal: relocation error: file
> /usr/local/pgsql/lib/plpgsql.so: symbol CurrentMemoryContext: referenced
> symbol not found
> 
> it is caused by the fact that the symbol CurrentMemoryContext is not
> exported from the main executable (postmaster). The solution is to use
> "-export-dynamic" switch when linking postgres executable (it is used on
> Linux).
> 
> I think it will require a new system specific makefile. The
> Makefile.solaris_sparc is done for solaric_sparc_cc template. More details
> can be send.

   I ran many versions of Postgres (6.4.2, 6.5, 6.5.2, 7.0beta1) on Sun
SPARC Solaris 2.5.1, compiled with gcc 2.8.1 and never saw any such
problem...

Oleg.
---- 
    Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net
           Programmers don't die, they just GOSUB without RETURN.


Wed, 1 Mar 2000 16:14:10 +0000 (GMT)
Oleg Broytmann <phd@phd.russ.ru>
Re: [HACKERS] PostgreSQL on Solaris/SPARC with gcc
On Wed, 1 Mar 2000, [iso-8859-2] Horï¿½k Daniel wrote:

> it is caused by the fact that the symbol CurrentMemoryContext is not
> exported from the main executable (postmaster). The solution is to use
> "-export-dynamic" switch when linking postgres executable (it is used on
> Linux).
> 
> I think it will require a new system specific makefile. The
> Makefile.solaris_sparc is done for solaric_sparc_cc template. More details
> can be send.

Couldn't we just test for gcc in general on any platform? For right now
you might get away with doing a little ifeq($(CC),gcc) action in the
solaris makefile, but that's bogus in the long run.

-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Thu, 2 Mar 2000 17:13:55 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: [HACKERS] PostgreSQL on Solaris/SPARC with gcc