libpq.so linking problem on Solaris using --with-gssapi

From: Bjorn Munch <Bjorn(dot)Munch(at)Sun(dot)COM>
To: pgsql-patches(at)postgresql(dot)org
Subject: libpq.so linking problem on Solaris using --with-gssapi
Date: 2008-03-04 11:57:44
Message-ID: 20080304115744.GA5471@khepri12.norway.sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

When building PostgreSQL 8.3 on Solaris using the configure option
"--with-gssapi", libpq.so is not linked correctly.

This line in the libpq Makefile is selecting the appropriate linker
options:

---
SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi_krb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(LDAP_LIBS_FE) $(PTHREAD_LIBS)
---

This includes "-lgssapi_krb5", but for Solaris this should be just
"-lgss".

The result is that libpq.so does not load libgss.so. psql still works
because it apparently loads libgss.so before it loads libpq.so, otherwise
it would surely have been discovered earlier.

But when I tried to run a test for the TCL client interface I got:

---
TCL test status: Started
couldn't load file "libpgtcl1.5.so": ld.so.1: tclsh8.4: fatal: relocation error: file <....>/lib/libpq.so.5: symbol GSS_C_NT_HOSTBASED_SERVICE: referenced symbol not found
while executing
"load libpgtcl1.5.so"
(file "./import_sampledata.tcl" line 7)
---

This could affect other clients too.

The fix is simply to add "-lgss" to the list, as the attached patch
does. I'm pretty sure no other Makefiles are affected.

Tested on Solaris (x86 and sparc), and also Linux (RHEL 5).

I plan to apply this patch when I integrate 8.3.0 into OpenSolaris.

--
Bjorn Munch
Database Technology Group
Sun Microsystems

Attachment Content-Type Size
libpq-make.patch text/plain 1.1 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-03-04 13:19:15 Re: [PATCHES] Show INHERIT in \du
Previous Message Bruce Momjian 2008-03-04 03:32:56 Re: Incomplete docs for restore_command for hot standby