From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Strip -mmacosx-version-min options from plperl build
Date: Wed, 24 Aug 2022 18:56:00 -0400
Message-ID: <1181344.1661381760@sss.pgh.pa.us> (raw)
In-Reply-To: <65922608-fe34-fee0-a0be-82b6cd7daaea@dunslane.net>
References: <8c4fcb72-2574-ff7c-4c25-1f032d4a2a57@enterprisedb.com>
<2369869.1660830828@sss.pgh.pa.us>
<9518842c-6844-0c99-85ec-ec43fba3115f@enterprisedb.com>
<843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com>
<1009406.1661347818@sss.pgh.pa.us>
<65922608-fe34-fee0-a0be-82b6cd7daaea@dunslane.net>
Andrew Dunstan <andrew@dunslane.net> writes:
> On 2022-08-24 We 09:30, Tom Lane wrote:
>> Presumably this is caused by not having
>> > -Wl,--export-all-symbols
>> which is something we ought to be injecting for ourselves if we
>> aren't doing anything to export the magic-block constant explicitly.
>> But I too am confused why we haven't seen this elsewhere.
> Me too. I note that we have -Wl,--out-implib=libplperl.a but we don't
> appear to do anything with libplperl.a.
I've poked around and formed a vague theory, based on noting this
from the ld(1) man page:
--export-all-symbols
... When symbols are
explicitly exported via DEF files or implicitly exported via
function attributes, the default is to not export anything else
unless this option is given.
So we could explain the behavior if, say, plperl's _PG_init were
explicitly marked with __attribute__((visibility("default"))) while
its Pg_magic_func was not. That would work anyway as long as
--export-all-symbols was being used at link time, and would produce
the observed symptom as soon as it wasn't.
Now, seeing that both of those functions are surely marked with
PGDLLEXPORT in the source code, how could such a state of affairs
arise? What I'm thinking about is that _PG_init's marking will be
determined by the extern declaration for it in fmgr.h, while
Pg_magic_func's marking will be determined by the extern declaration
obtained from expanding PG_MODULE_MAGIC. And there are a boatload
of Perl-specific header files read between those points in plperl.c.
In short: if the Cygwin Perl headers redefine PGDLLEXPORT (unlikely)
or somehow #define "__attribute__()" or "visibility()" into no-ops
(perhaps more likely) then we could explain this failure, and that
would also explain why it doesn't fail elsewhere.
I can't readily check this, since I have no idea exactly which version
of the Perl headers lorikeet uses.
regards, tom lane
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: tgl@sss.pgh.pa.us, andrew@dunslane.net, peter.eisentraut@enterprisedb.com
Subject: Re: Strip -mmacosx-version-min options from plperl build
In-Reply-To: <1181344.1661381760@sss.pgh.pa.us>
References: <8c4fcb72-2574-ff7c-4c25-1f032d4a2a57@enterprisedb.com> <2369869.1660830828@sss.pgh.pa.us> <9518842c-6844-0c99-85ec-ec43fba3115f@enterprisedb.com> <843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com> <1009406.1661347818@sss.pgh.pa.us> <65922608-fe34-fee0-a0be-82b6cd7daaea@dunslane.net> <1181344.1661381760@sss.pgh.pa.us>
* 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