From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Avoid unsatisfied-external-reference errors in static inlines.
Date: Thu, 14 Jul 2022 16:48:25 +0200
Message-ID: <01214fad-1249-183c-2161-837d8f1c1de0@enterprisedb.com> (raw)
In-Reply-To: <1b09ac8a-5906-3a52-3763-44a9b2115805@enterprisedb.com>
References: <E1oBgIW-002ehP-VJ@gemulon.postgresql.org>
<864b47bd-6e82-2d02-070d-ae5076d8c4c1@enterprisedb.com>
<2431300.1657736689@sss.pgh.pa.us>
<1b09ac8a-5906-3a52-3763-44a9b2115805@enterprisedb.com>
On 14.07.22 12:05, Peter Eisentraut wrote:
> On 13.07.22 20:24, Tom Lane wrote:
>> Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
>>> What platforms did this fail on? How can one observe the failure
>>> locally?
>>
>> wrasse at least:
>>
>> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=wrasse&dt=2022-07-13%2014%3A49%3A17
>>
>>
>> I think possibly you could duplicate the problem with gcc
>> by using -fkeep-inline-functions, but I've not tried.
>
> Confirmed, -fkeep-inline-functions will catch it. Good to know.
It seems that -fkeep-inline-functions is more demanding than what wrasse
is running on. I need the attached patch to get it to build cleanly.
(The first hunk undoes some parts of
2cd2569c72b8920048e35c31c9be30a6170e1410, but the others are unrelated
and old.)
I think this would be good to apply so that this method of checking
inline functions is available in the future.
Attachments:0001-WIP-Support-gcc-fkeep-inline-functions.patch (text/plain, 3.2K) download
From 9e57d1d42490ac37e8bd27804a6180ddee0fbf53 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Thu, 14 Jul 2022 15:54:40 +0200
Subject: [PATCH] WIP: Support gcc -fkeep-inline-functions
---
src/include/storage/bufpage.h | 24 +++++++++---------------
src/include/utils/rel.h | 2 ++
src/include/utils/snapmgr.h | 2 ++
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.hindex fc67d396b6..6a947021ac 100644--- a/src/include/storage/bufpage.h+++ b/src/include/storage/bufpage.h@@ -466,6 +466,15 @@ do { \
#define PIV_LOG_WARNING (1 << 0)
#define PIV_REPORT_STAT (1 << 1)
+#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \+ PageAddItemExtended(page, item, size, offsetNumber, \+ ((overwrite) ? PAI_OVERWRITE : 0) | \+ ((is_heap) ? PAI_IS_HEAP : 0))++#define PageIsVerified(page, blkno) \+ PageIsVerifiedExtended(page, blkno, \+ PIV_LOG_WARNING | PIV_REPORT_STAT)+
/*
* Check that BLCKSZ is a multiple of sizeof(size_t). In
* PageIsVerifiedExtended(), it is much faster to check if a page is
@@ -480,21 +489,6 @@ extern void PageInit(Page page, Size pageSize, Size specialSize);
extern bool PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags);
extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size,
OffsetNumber offsetNumber, int flags);
--static inline OffsetNumber-PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber, bool overwrite, bool is_heap)-{- return PageAddItemExtended(page, item, size, offsetNumber,- (overwrite ? PAI_OVERWRITE : 0) |- (is_heap ? PAI_IS_HEAP : 0));-}--static inline bool-PageIsVerified(Page page, BlockNumber blkno)-{- return PageIsVerifiedExtended(page, blkno, PIV_LOG_WARNING | PIV_REPORT_STAT);-}-
extern Page PageGetTempPage(Page page);
extern Page PageGetTempPageCopy(Page page);
extern Page PageGetTempPageCopySpecial(Page page);
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.hindex 2854839ec2..00b83b8924 100644--- a/src/include/utils/rel.h+++ b/src/include/utils/rel.h@@ -564,6 +564,7 @@ typedef struct ViewOptions
* each time you need to access the SMgrRelation. It's quite cheap in
* comparison to whatever an smgr function is going to do.
*/
+#ifndef FRONTEND
static inline SMgrRelation
RelationGetSmgr(Relation rel)
{
@@ -571,6 +572,7 @@ RelationGetSmgr(Relation rel)
smgrsetowner(&(rel->rd_smgr), smgropen(rel->rd_locator, rel->rd_backend));
return rel->rd_smgr;
}
+#endif
/*
* RelationCloseSmgr
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.hindex 67b217b1c1..06eafdf118 100644--- a/src/include/utils/snapmgr.h+++ b/src/include/utils/snapmgr.h@@ -97,11 +97,13 @@ extern PGDLLIMPORT SnapshotData CatalogSnapshotData;
((snapshot)->snapshot_type == SNAPSHOT_MVCC || \
(snapshot)->snapshot_type == SNAPSHOT_HISTORIC_MVCC)
+#ifndef FRONTEND
static inline bool
OldSnapshotThresholdActive(void)
{
return old_snapshot_threshold >= 0;
}
+#endif
extern Snapshot GetTransactionSnapshot(void);
extern Snapshot GetLatestSnapshot(void);
--
2.37.0
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: peter.eisentraut@enterprisedb.com, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Avoid unsatisfied-external-reference errors in static inlines.
In-Reply-To: <01214fad-1249-183c-2161-837d8f1c1de0@enterprisedb.com>
References: <E1oBgIW-002ehP-VJ@gemulon.postgresql.org> <864b47bd-6e82-2d02-070d-ae5076d8c4c1@enterprisedb.com> <2431300.1657736689@sss.pgh.pa.us> <1b09ac8a-5906-3a52-3763-44a9b2115805@enterprisedb.com> <01214fad-1249-183c-2161-837d8f1c1de0@enterprisedb.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