[Python-checkins] bpo-45405: Prevent internal configure error when running configure with recent versions of clang. (GH-28845) (GH-31889)

ambv webhook-mailer at python.org
Tue Mar 15 10:39:25 EDT 2022


https://github.com/python/cpython/commit/dea270a2a80214de22afadaaca2043d0d782eb7d
commit: dea270a2a80214de22afadaaca2043d0d782eb7d
branch: 3.8
author: Ned Deily <nad at python.org>
committer: ambv <lukasz at langa.pl>
date: 2022-03-15T15:39:20+01:00
summary:

bpo-45405: Prevent internal configure error when running configure with recent versions of clang. (GH-28845) (GH-31889)

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 <nad at python.org>
(cherry picked from commit 9c4766772cda67648184f8ddba546a5fc0167f91)

Co-authored-by: David Bohman <debohman at gmail.com>

Automerge-Triggered-By: GH:ned-deily
(cherry picked from commit 9901d153c201d852d27dc9d3074e283c26468f6d)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>

files:
A Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
M configure
M configure.ac

diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
new file mode 100644
index 0000000000000..13c93d1b8a571
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
@@ -0,0 +1,2 @@
+Prevent ``internal configure error`` when running ``configure``
+with recent versions of clang.  Patch by David Bohman.
diff --git a/configure b/configure
index 936f3d4596f53..c091865aff750 100755
--- a/configure
+++ b/configure
@@ -5160,9 +5160,6 @@ $as_echo "$as_me:
 fi
 
 
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
 $as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
 cat >> conftest.c <<EOF
@@ -5321,6 +5318,11 @@ $as_echo "none" >&6; }
 fi
 rm -f conftest.c conftest.out
 
+if test x$PLATFORM_TRIPLET != xdarwin; then
+  MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+fi
+
+
 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
   if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
     as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
diff --git a/configure.ac b/configure.ac
index e02cc2c65622f..de83332dd3c6e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -719,9 +719,6 @@ then
 fi
 
 
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
-AC_SUBST(MULTIARCH)
-
 AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
 cat >> conftest.c <<EOF
 #undef bfin
@@ -877,6 +874,11 @@ else
 fi
 rm -f conftest.c conftest.out
 
+if test x$PLATFORM_TRIPLET != xdarwin; then
+  MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+fi
+AC_SUBST(MULTIARCH)
+
 if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
   if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
     AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])



More information about the Python-checkins mailing list