Re: [RFC] building postgres with meson - perl embedding

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: [RFC] building postgres with meson - perl embedding
Date: 2022-02-08 01:12:56
Message-ID: 20220208011256.36wv6do4ih5zxutb@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was trying to fix a few perl embedding oddities in the meson
patchset.

Whenever I have looked at the existing code, I've been a bit confused about
the following

code/comment in perl.m4:

# PGAC_CHECK_PERL_EMBED_LDFLAGS
# -----------------------------
# We are after Embed's ldopts, but without the subset mentioned in
# Config's ccdlflags; [...]

pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`

What is the reason behind subtracting ccdlflags?

The comment originates in:

commit d69a419e682c2d39c2355105a7e5e2b90357c8f0
Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Date: 2009-09-08 18:15:55 +0000

Remove any -arch switches given in ExtUtils::Embed's ldopts from our
perl_embed_ldflags setting. On OS X it seems that ExtUtils::Embed is
trying to force a universal binary to be built, but you need to specify
that a lot further upstream if you want Postgres built that way; the only
result of including -arch in perl_embed_ldflags is some warnings at the
plperl.so link step. Per my complaint and Jan Otto's suggestion.

but the subtraction goes all the way back to

commit 7662419f1bc1a994193c319c9304dfc47e121c98
Author: Peter Eisentraut <peter_e(at)gmx(dot)net>
Date: 2002-05-28 16:57:53 +0000

Change PL/Perl and Pg interface build to use configured compiler and
Makefile.shlib system, not MakeMaker.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-02-08 01:22:32 Re: [RFC] building postgres with meson - autogenerated headers
Previous Message Tom Lane 2022-02-08 01:05:19 Re: [PATCH] Add UPDATE WHERE OFFSET IN clause