Skip to content

Commit 07bc6fe

Browse files
committed
Suppress -arch switches in the output of ExtUtils::Embed.
We previously found out that OS X's standard perl installation tries to put -arch switches into Perl link commands, evidently in hopes of building universal binaries. But it doesn't work to add such switches in plperl's link step if they weren't being used earlier, so this is basically unworkable. When using gcc the result is only some warnings; but LLVM fails entirely, so this issue isn't as cosmetic as we originally thought. Hence, back-patch commit d69a419 into pre-9.0 branches.
1 parent 1f5e6cd commit 07bc6fe

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

config/perl.m4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
2525

2626
# PGAC_CHECK_PERL_EMBED_LDFLAGS
2727
# -----------------------------
28+
# We are after Embed's ldopts, but without the subset mentioned in
29+
# Config's ccdlflags; and also without any -arch flags, which recent
30+
# Apple releases put in unhelpfully. (If you want a multiarch build
31+
# you'd better be specifying it in more places than plperl's final link.)
2832
AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
2933
[AC_REQUIRE([PGAC_PATH_PERL])
3034
AC_MSG_CHECKING(for flags to link embedded Perl)
3135
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
3236
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
33-
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"`
37+
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
3438
AC_SUBST(perl_embed_ldflags)dnl
3539
if test -z "$perl_embed_ldflags" ; then
3640
AC_MSG_RESULT(no)

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4955,7 +4955,7 @@ echo "$as_me:$LINENO: checking for flags to link embedded Perl" >&5
49554955
echo $ECHO_N "checking for flags to link embedded Perl... $ECHO_C" >&6
49564956
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
49574957
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
4958-
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed "s/^X//;s%$pgac_tmp2%%"`
4958+
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e "s/ -arch [-a-zA-Z0-9_]*//g"`
49594959
if test -z "$perl_embed_ldflags" ; then
49604960
echo "$as_me:$LINENO: result: no" >&5
49614961
echo "${ECHO_T}no" >&6

0 commit comments

Comments
 (0)