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 <t...@sss.pgh.pa.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 <pete...@gmx.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