Skip to content

Commit 720bb45

Browse files
ned-deilydebohman
andauthored
bpo-45405: Prevent internal configure error when running configure with recent versions of clang. (GH-28845) (GH-31890)
Change the configure logic to function properly on macOS when the compiler outputs a platform triplet for option --print-multiarch. The Apple Clang included with Xcode 13.3 now supports --print-multiarch causing configure to fail without this change. Co-authored-by: Ned Deily <[email protected]> (cherry picked from commit 9c47667) Co-authored-by: David Bohman <[email protected]>
1 parent 80cc10f commit 720bb45

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Prevent ``internal configure error`` when running ``configure``
2+
with recent versions of clang. Patch by David Bohman.

configure

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5183,9 +5183,6 @@ $as_echo "$as_me:
51835183
fi
51845184

51855185

5186-
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
5187-
5188-
51895186
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
51905187
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
51915188
cat >> conftest.c <<EOF
@@ -5342,6 +5339,11 @@ $as_echo "none" >&6; }
53425339
fi
53435340
rm -f conftest.c conftest.out
53445341

5342+
if test x$PLATFORM_TRIPLET != xdarwin; then
5343+
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
5344+
fi
5345+
5346+
53455347
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
53465348
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
53475349
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5

configure.ac

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,6 @@ then
724724
fi
725725

726726

727-
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
728-
AC_SUBST(MULTIARCH)
729-
730727
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
731728
cat >> conftest.c <<EOF
732729
#undef bfin
@@ -880,6 +877,11 @@ else
880877
fi
881878
rm -f conftest.c conftest.out
882879

880+
if test x$PLATFORM_TRIPLET != xdarwin; then
881+
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
882+
fi
883+
AC_SUBST(MULTIARCH)
884+
883885
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
884886
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
885887
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])

0 commit comments

Comments
 (0)