Skip to content

Commit 9c47667

Browse files
debohmanned-deily
andauthored
bpo-45405: Prevent internal configure error when running configure with recent versions of non-Apple clang. (#28845)
Change the configure logic to function properly on macOS when the compiler outputs a platform triplet for option --print-multiarch. Co-authored-by: Ned Deily <[email protected]>
1 parent dbe213d commit 9c47667

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 non-Apple clang. Patch by David Bohman.

configure

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

52295229

5230-
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
5231-
5232-
52335230
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
52345231
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
52355232
cat >> conftest.c <<EOF
@@ -5388,6 +5385,11 @@ $as_echo "none" >&6; }
53885385
fi
53895386
rm -f conftest.c conftest.out
53905387

5388+
if test x$PLATFORM_TRIPLET != xdarwin; then
5389+
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
5390+
fi
5391+
5392+
53915393
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
53925394
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
53935395
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
@@ -717,9 +717,6 @@ then
717717
fi
718718

719719

720-
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
721-
AC_SUBST(MULTIARCH)
722-
723720
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
724721
cat >> conftest.c <<EOF
725722
#undef bfin
@@ -875,6 +872,11 @@ else
875872
fi
876873
rm -f conftest.c conftest.out
877874

875+
if test x$PLATFORM_TRIPLET != xdarwin; then
876+
MULTIARCH=$($CC --print-multiarch 2>/dev/null)
877+
fi
878+
AC_SUBST(MULTIARCH)
879+
878880
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
879881
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
880882
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])

0 commit comments

Comments
 (0)