pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Strip -mmacosx-version-min options from plperl build
Date: Wed, 24 Aug 2022 12:12:15 +0200
Message-ID: <843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com> (raw)
In-Reply-To: <9518842c-6844-0c99-85ec-ec43fba3115f@enterprisedb.com>
References: <8c4fcb72-2574-ff7c-4c25-1f032d4a2a57@enterprisedb.com>
	<2369869.1660830828@sss.pgh.pa.us>
	<9518842c-6844-0c99-85ec-ec43fba3115f@enterprisedb.com>

On 19.08.22 09:12, Peter Eisentraut wrote:
> After analyzing the source code of ExtUtils::Embed's ldopts, I think we 
> can also do this by subtracting $Config{ldflags}, since
> 
> my $linkage = "$ccdlflags $ldflags @archives $ld_or_bs";
> 
> and we really just want the $ld_or_bs part. (@archives should be empty 
> for our uses.)
> 
> This would get rid of -mmacosx-version-min and -arch and all the things 
> you showed, including -L/opt/local/lib, which is probably there so that 
> the build of Perl itself could look there for things, but we don't need it.

This patch has failed on Cygwin lorikeet:

Before:

checking for flags to link embedded Perl...
   -Wl,--enable-auto-import -Wl,--export-all-symbols 
-Wl,--enable-auto-image-base -fstack-protector-strong 
-L/usr/lib/perl5/5.32/x86_64-cygwin-threads/CORE -lperl -lpthread -ldl 
-lcrypt

After:

checking for flags to link embedded Perl... 
-L/usr/lib/perl5/5.32/x86_64-cygwin-threads/CORE -lperl -lpthread -ldl 
-lcrypt

That's as designed.  But the plperl tests fail:

CREATE EXTENSION plperl;
+ERROR:  incompatible library 
"/home/andrew/bf/root/HEAD/inst/lib/postgresql/plperl.dll": missing 
magic block
+HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.

Among the now-dropped options, we can discount -Wl,--enable-auto-import, 
because that is used anyway via src/template/cygwin.

So one of the options

-Wl,--export-all-symbols
-Wl,--enable-auto-image-base
-fstack-protector-strong

is needed.  These options aren't used for any other shared libraries 
AFAICT, so nothing is clear to me.





view thread (33+ messages)  latest in thread

Message-ID: <843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com>
Permalink:  ../843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com/
Also on:    postgresql.org/message-id/843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com

 · 

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-hackers@postgresql.org
  Cc: peter.eisentraut@enterprisedb.com, tgl@sss.pgh.pa.us
  Subject: Re: Strip -mmacosx-version-min options from plperl build
  In-Reply-To: <843fbed9-0749-bba4-b6b0-e3e7d1244b0d@enterprisedb.com>
  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>

* 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