| From: | Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: Strip -mmacosx-version-min options from plperl build | 
| Date: | 2022-08-19 07:12:06 | 
| Message-ID: | 9518842c-6844-0c99-85ec-ec43fba3115f@enterprisedb.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 18.08.22 15:53, Tom Lane wrote:
> Agreed on rejecting -mmacosx-version-min, but I wonder if we should
> think about adopting a whitelist-instead-of-blacklist approach to
> adopting stuff from perl_embed_ldflags.  ISTR that in pltcl we already
> use the approach of accepting only -L and -l, and perhaps similar
> strictness would serve us well here.
> 
> As an example, on a not-too-new MacPorts install, I see
> 
> $ /opt/local/bin/perl -MExtUtils::Embed -e ldopts
>      -L/opt/local/lib -Wl,-headerpad_max_install_names   -fstack-protector-strong  -L/opt/local/lib/perl5/5.28/darwin-thread-multi-2level/CORE -lperl
> 
> I can't see any really good reason why we should allow perl
> to be injecting that sort of -f option into the plperl build,
> and I'm pretty dubious about the -headerpad_max_install_names
> bit too.
> 
> I think also that this would allow us to drop the weird dance of
> trying to subtract ccdlflags.
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.
| Attachment | Content-Type | Size | 
|---|---|---|
| v2-0001-Remove-further-unwanted-linker-flags-from-perl_em.patch | text/plain | 2.9 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Smith | 2022-08-19 07:46:12 | Re: Perform streaming logical transactions by background workers and parallel apply | 
| Previous Message | Drouvot, Bertrand | 2022-08-19 06:12:51 | Re: shared-memory based stats collector - v70 |