pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: Removing link-time cross-module refs in contrib
Date: Sat, 28 Jan 2017 02:59:17 +0000
Message-ID: <20170128025917.GA714552@tornado.leadboat.com> (raw)
In-Reply-To: <2652.1475512158@sss.pgh.pa.us>
References: <2652.1475512158@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Mon, Oct 03, 2016 at 12:29:18PM -0400, Tom Lane wrote:
> Pursuant to Andres' suggestion in
> https://www.postgresql.org/message-id/20161002223927.57xns3arkdg4hu6x@alap3.anarazel.de
> attached is a draft patch that gets rid of link-time references
> from hstore_plpython to both hstore and plpython.  I've verified
> that this allows "LOAD 'hstore_plpython'" to succeed in a fresh
> session without having loaded the prerequisite modules first.

I like how that turned out.  However, ...

> *** a/contrib/hstore_plpython/Makefile
> --- b/contrib/hstore_plpython/Makefile

> --- 23,40 ----
>   include $(top_srcdir)/contrib/contrib-global.mk
>   endif
>   
> ! # We must link libpython explicitly
>   ifeq ($(PORTNAME), aix)
>   rpathdir = $(pkglibdir):$(python_libdir)

... adding $(pkglibdir) to rpath is obsolete, now that this ceased to link to
hstore explicitly.

> ! SHLIB_LINK += $(python_libspec) $(python_additional_libs)
> ! else
>   ifeq ($(PORTNAME), win32)
> ! # ... see silliness in plpython Makefile ...
> ! SHLIB_LINK += $(sort $(wildcard ../../src/pl/plpython/libpython*.a))
> ! else
> ! rpathdir = $(python_libdir)
> ! SHLIB_LINK += $(python_libspec)

For consistency with longstanding src/pl/plpython practice, $(python_libspec)
should always have an accompanying $(python_additional_libs).  This matters on
few configurations.

I propose to clean up both points as attached.  Tested on AIX, which ceases to
be a special case.

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

no-link-xmodule-code-review-v1.patch (text/plain, 2.3K) download diff --git a/contrib/hstore_plperl/Makefile b/contrib/hstore_plperl/Makefile index 41d3435..34e1e13 100644 --- a/contrib/hstore_plperl/Makefile +++ b/contrib/hstore_plperl/Makefile @@ -24,10 +24,6 @@ include $(top_srcdir)/contrib/contrib-global.mk endif # We must link libperl explicitly -ifeq ($(PORTNAME), aix) -rpathdir = $(pkglibdir):$(perl_archlibexp)/CORE -SHLIB_LINK += $(perl_embed_ldflags) -else ifeq ($(PORTNAME), win32) # these settings are the same as for plperl override CPPFLAGS += -DPLPERL_HAVE_UID_GID -Wno-comment @@ -37,7 +33,6 @@ else rpathdir = $(perl_archlibexp)/CORE SHLIB_LINK += $(perl_embed_ldflags) endif -endif # As with plperl we need to make sure that the CORE directory is included # last, probably because it sometimes contains some header files with names diff --git a/contrib/hstore_plpython/Makefile b/contrib/hstore_plpython/Makefile index a55c9a1..7ff787a 100644 --- a/contrib/hstore_plpython/Makefile +++ b/contrib/hstore_plpython/Makefile @@ -24,17 +24,12 @@ include $(top_srcdir)/contrib/contrib-global.mk endif # We must link libpython explicitly -ifeq ($(PORTNAME), aix) -rpathdir = $(pkglibdir):$(python_libdir) -SHLIB_LINK += $(python_libspec) $(python_additional_libs) -else ifeq ($(PORTNAME), win32) # ... see silliness in plpython Makefile ... SHLIB_LINK += $(sort $(wildcard ../../src/pl/plpython/libpython*.a)) else rpathdir = $(python_libdir) -SHLIB_LINK += $(python_libspec) -endif +SHLIB_LINK += $(python_libspec) $(python_additional_libs) endif REGRESS_OPTS += --load-extension=hstore diff --git a/contrib/ltree_plpython/Makefile b/contrib/ltree_plpython/Makefile index c45b7c2..bc7502b 100644 --- a/contrib/ltree_plpython/Makefile +++ b/contrib/ltree_plpython/Makefile @@ -24,17 +24,12 @@ include $(top_srcdir)/contrib/contrib-global.mk endif # We must link libpython explicitly -ifeq ($(PORTNAME), aix) -rpathdir = $(pkglibdir):$(python_libdir) -SHLIB_LINK += $(python_libspec) $(python_additional_libs) -else ifeq ($(PORTNAME), win32) # ... see silliness in plpython Makefile ... SHLIB_LINK += $(sort $(wildcard ../../src/pl/plpython/libpython*.a)) else rpathdir = $(python_libdir) -SHLIB_LINK += $(python_libspec) -endif +SHLIB_LINK += $(python_libspec) $(python_additional_libs) endif REGRESS_OPTS += --load-extension=ltree

view thread (8+ messages)  latest in thread

Message-ID: <20170128025917.GA714552@tornado.leadboat.com>
Permalink:  ../20170128025917.GA714552@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20170128025917.GA714552@tornado.leadboat.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, tgl@sss.pgh.pa.us
  Subject: Re: Removing link-time cross-module refs in contrib
  In-Reply-To: <20170128025917.GA714552@tornado.leadboat.com>
  References: <2652.1475512158@sss.pgh.pa.us> <20170128025917.GA714552@tornado.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox