Re: Preventing abort() and exit() calls in libpq

From: Jacob Champion <pchampion(at)vmware(dot)com>
To: "peter(dot)eisentraut(at)enterprisedb(dot)com" <peter(dot)eisentraut(at)enterprisedb(dot)com>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "daniel(at)yesql(dot)se" <daniel(at)yesql(dot)se>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "michael(at)paquier(dot)xyz" <michael(at)paquier(dot)xyz>
Subject: Re: Preventing abort() and exit() calls in libpq
Date: 2021-07-01 18:21:04
Message-ID: 05ced65e02e53c61bc182a24e385395c8a3718ff.camel@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2021-07-01 at 14:14 -0400, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> writes:
> > Somewhere in the $(shlib) rule would seem most appropriate. But I don't
> > understand the rest: What ifeq, and why .DELETE_ON_ERROR?
>
> The variant of this I'd been thinking of was
>
> $(shlib): $(OBJS) | $(SHLIB_PREREQS)
> $(LINK.shared) -o $@ $(OBJS) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
> +ifneq (,$(SHLIB_EXTRA_ACTION))
> + $(SHLIB_EXTRA_ACTION)
> +endif
>
> (and similarly in several other places); then libpq's Makefile
> could set SHLIB_EXTRA_ACTION to the desired thing.
>
> The problem then is, what happens when the extra action fails?
> Without .DELETE_ON_ERROR, the shlib is still there and the next
> make run will think everything's good.

Yep, that was pretty much what was in my head. ifeq (or ifneq in your
example) to gate the extra nm check, and .DELETE_ON_ERROR to make the
failure stick for future make invocations.

--Jacob

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-07-01 18:41:09 Re: rand48 replacement
Previous Message Tom Lane 2021-07-01 18:14:24 Re: Preventing abort() and exit() calls in libpq