pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: __pg_log_level in anonynous enum should be initialized? (Was: pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro)
Date: Wed, 30 Sep 2020 14:50:25 +0900
Message-ID: <20200930055025.GA1996@paquier.xyz> (raw)
In-Reply-To: <607460.1601386158@sss.pgh.pa.us>
References: <E1kMk96-0008Gm-7c@gemulon.postgresql.org>
	<20200928073330.GC2316@paquier.xyz>
	<300644.1601311769@sss.pgh.pa.us>
	<20200929020312.GA10200@paquier.xyz>
	<607460.1601386158@sss.pgh.pa.us>

On Tue, Sep 29, 2020 at 09:29:18AM -0400, Tom Lane wrote:
> Hm, it doesn't seem like "OBJS_PGCOMMON" conveys much.  I think
> OBJS_FRONTEND ought to be the set of files built for frontend
> application use (i.e., libpgcommon.a), so we need a new name
> for what will go into libpgcommon_shlib.a.  Maybe OBJS_SHLIB,
> or to be even more explicit, OBJS_FRONTEND_SHLIB.

OBJS_SHLIB is already used to list the _shlib.o objects compiled with
libpgcommon_shlib.a, which is why I switched OBJS_FRONTEND to
OBJS_PGCOMMON, and an object cannot reference itself so we either need
two variables for the shlib list, or we could just do something like
that:
OBJS_FRONTEND = \
        $(OBJS_COMMON) \
	fe_memutils.o \
	restricted_token.o \
	sprompt.o
OBJS_SHLIB = $(OBJS_FRONTEND:%.o=%_shlib.o)
OBJS_FRONTEND += logging.o

However I would prefer the style of the attached.

> As for the comment, maybe "logging.c is excluded from OBJS_SHLIB
> as a matter of policy, because it is not appropriate for general
> purpose libraries such as libpq to report errors directly."

WFM.  Thanks!
--
Michael

Attachments:

common-shlib-split-v2.patch (text/x-diff, 997B) download diff --git a/src/common/Makefile b/src/common/Makefile index f281762885..25c55bd642 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -88,16 +88,21 @@ OBJS_COMMON += sha2.o endif # A few files are currently only built for frontend, not server -# (Mkvcbuild.pm has a copy of this list, too) -OBJS_FRONTEND = \ +# (Mkvcbuild.pm has a copy of this list, too). logging.c is excluded +# from OBJS_FRONTEND_SHLIB (shared library) as a matter of policy, +# because it is not appropriate for general purpose libraries such +# as libpq to report errors directly. +OBJS_FRONTEND_SHLIB = \ $(OBJS_COMMON) \ fe_memutils.o \ - logging.o \ restricted_token.o \ sprompt.o +OBJS_FRONTEND = \ + $(OBJS_FRONTEND_SHLIB) \ + logging.o # foo.o, foo_shlib.o, and foo_srv.o are all built from foo.c -OBJS_SHLIB = $(OBJS_FRONTEND:%.o=%_shlib.o) +OBJS_SHLIB = $(OBJS_FRONTEND_SHLIB:%.o=%_shlib.o) OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o) # where to find gen_keywordlist.pl and subsidiary files
signature.asc (application/pgp-signature, 832B) download

view thread (7+ messages)  latest in thread

Message-ID: <20200930055025.GA1996@paquier.xyz>
Permalink:  ../20200930055025.GA1996@paquier.xyz/
Also on:    postgresql.org/message-id/20200930055025.GA1996@paquier.xyz

 ·  · 

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: michael@paquier.xyz, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: __pg_log_level in anonynous enum should be initialized? (Was: pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro)
  In-Reply-To: <20200930055025.GA1996@paquier.xyz>
  References: <E1kMk96-0008Gm-7c@gemulon.postgresql.org> <20200928073330.GC2316@paquier.xyz> <300644.1601311769@sss.pgh.pa.us> <20200929020312.GA10200@paquier.xyz> <607460.1601386158@sss.pgh.pa.us> <20200930055025.GA1996@paquier.xyz>

* 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