Re: [PORTS] Postgres 6.5.1 on IRIX 6.5 Locating Shared Object Libs

From: Mark Dalphin <mdalphin(at)amgen(dot)com>
To: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>
Cc: "pgsql-ports(at)postgresql(dot)org" <pgsql-ports(at)postgresql(dot)org>
Subject: Re: [PORTS] Postgres 6.5.1 on IRIX 6.5 Locating Shared Object Libs
Date: 1999-08-31 16:18:26
Message-ID: 37CC0052.2AB0AB21@amgen.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Hi,

Some time ago (Jul 30 for the contents of the letter copied below), there was some discussion about why release 6.5.1 of PostgreSQL seemed to have a problem locating shared object libraries (DSOs) under IRIX 6.5. This problem seems to
have been introduced with the release of 6.5.1 and was not present in 6.4.2. What changed?

I have located a change that fixes the problem for me which involves a command line switch during compilation (ie on the "cc" line, although the swich is actually passed to 'ld'.) which specifies to the dynamic loader, 'rld', where to
locate the particular shared object in question. The relevant section from the man page for 'ld' reads:

-rpath library_path
Adds the library_path to the search path for DSOs. Each
library path is appended to the list of directories at the
time the executable or DSO is loaded. This option directs
rld(5) to look in the named directories, but to look only
for DSOs, and to stop looking when the correct one is found.

This option can be specified only when the -shared or
-call_shared options are also in effect. For more
information, see the rld(5) man page. (C, C++, F77, F90)

A patch to 'Makefile.shlib' is supplied below:

*** Makefile.shlib.orig Mon Aug 30 11:00:23 1999
--- Makefile.shlib Mon Aug 30 11:01:47 1999
***************
*** 59,65 ****
ifeq ($(PORTNAME), irix5)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
! LDFLAGS_SL := -shared
CFLAGS += $(CFLAGS_SL)
endif

--- 59,65 ----
ifeq ($(PORTNAME), irix5)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
! LDFLAGS_SL := -shared -rpath $(LIBDIR)
CFLAGS += $(CFLAGS_SL)
endif

"G. Anthony Reina" wrote:

> Mark Dalphin wrote:
>
> > I have not compiled for multiple modes, only -n32, but I have run into exactly the same problem. Version 6.4.2 seemed to know where to look for the shared object, but something has changed for 6.5.1. I am not sure what, though I have
> > been looking. There is also more information about this under "man rld", but my reading of it suggests that your cc line, above, should work. My current work around is to specify LD_LIBRARY_PATH when I start the postmaster. That
> > won't help when compiling other programs, however, I think
> >
>
> Mark,
>
> Yeah, from my understanding cc should know where to look for the libraries since I specify the correct place with the -L option. It seems like cc isn't even recognizing that this option has been set.
>
> The only difference I can see between Postgres 6.4.2 and 6.5.1 in this matter is that the library has changed from libpq.a to libpq.so.2. For some reason I think that move from .a to .so has made the difference. Copying the
> lipq.so.2 over to the /usr/lib32 directory will fix the bug (or at least I haven't found any problems with it so far). But, I'd rather like to figure out specifically why this is occuring rather than kludging a work around.
>
> Maybe between the two of us working on the problem we'll have a better chance of coming across the reason.
>
> -Tony

--
Mark Dalphin email: mdalphin(at)amgen(dot)com
Mail Stop: 29-2-A phone: +1-805-447-4951 (work)
One Amgen Center Drive +1-805-375-0680 (home)
Thousand Oaks, CA 91320 fax: +1-805-499-9955 (work)

In response to

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message G. Anthony Reina 1999-08-31 16:52:29 Re: [PORTS] Postgres 6.5.1 on IRIX 6.5 Locating Shared Object Libs
Previous Message Steve Patrick 1999-08-31 14:53:08 v6.5.1