pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Always use -fPIC, not -fpic, when building shared libraries with
Date: Thu, 01 Jun 2017 17:33:17 +0000
Message-ID: <E1dGTyH-00060e-7j@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Always use -fPIC, not -fpic, when building shared libraries with gcc.

On some platforms, -fpic fails for sufficiently large shared libraries.
We've mostly not hit that boundary yet, but there are some extensions
such as Citus and pglogical where it's becoming a problem.  A bit of
research suggests that the penalty for -fPIC is small, in the
single-digit-percentage range --- and there's none at all on popular
platforms such as x86_64.  So let's just default to -fPIC everywhere
and provide one less thing for extension developers to worry about.

Per complaint from Christoph Berg.  Back-patch to all supported branches.
(I did not bother to touch the recently-removed Makefiles for sco and
unixware in the back branches, though.  We'd have no way to test that
it doesn't break anything on those platforms.)

Discussion: https://postgr.es/m/20170529155850.qojdfrwkkqnjb3ap@msg.df7cb.de

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8d9b4fe01b5e717ad85d3a3beeabf8e212524b04

Modified Files
--------------
doc/src/sgml/dfunc.sgml        | 26 ++++++++++++--------------
src/makefiles/Makefile.linux   |  7 +++----
src/makefiles/Makefile.netbsd  |  4 ----
src/makefiles/Makefile.openbsd |  4 ----
4 files changed, 15 insertions(+), 26 deletions(-)


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


view thread (6+ messages)  latest in thread

Message-ID: <E1dGTyH-00060e-7j@gemulon.postgresql.org>
Permalink:  ../E1dGTyH-00060e-7j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dGTyH-00060e-7j@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Always use -fPIC, not -fpic, when building shared libraries with
  In-Reply-To: <E1dGTyH-00060e-7j@gemulon.postgresql.org>
  References: <E1dGTyH-00060e-7j@gemulon.postgresql.org>

* 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