[Python-checkins] [3.9] bpo-38443: Check that the specified universal architectures work (GH-22910) (GH-23451)

miss-islington webhook-mailer at python.org
Sat Nov 21 20:45:29 EST 2020


https://github.com/python/cpython/commit/748d38bf529d71d87cc7ef6d63e9df7d7d771ac9
commit: 748d38bf529d71d87cc7ef6d63e9df7d7d771ac9
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2020-11-21T17:45:21-08:00
summary:

[3.9] bpo-38443: Check that the specified universal architectures work (GH-22910) (GH-23451)



As [[bpo-38443]()]() says the error message from configure when specifying --enable-universalsdk with a set of architectures that is not supported by the compiler is not very helpful.   This PR explicitly checks if the compiler works and bails out if it doesn't.
(cherry picked from commit 0f20bd9042c9b7fce20c3b9511cd0820b30094c3)


Co-authored-by: Ronald Oussoren <ronaldoussoren at mac.com>

files:
A Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst
M configure
M configure.ac

diff --git a/Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst b/Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst
new file mode 100644
index 0000000000000..008c972e5c6ab
--- /dev/null
+++ b/Misc/NEWS.d/next/macOS/2020-10-23-10-26-53.bpo-38443.vu64tl.rst
@@ -0,0 +1,2 @@
+The ``--enable-universalsdk`` and ``--with-universal-archs`` options for the
+configure script now check that the specified architectures can be used.
diff --git a/configure b/configure
index 9e6fd4658333b..040c828bf95ec 100755
--- a/configure
+++ b/configure
@@ -7571,6 +7571,31 @@ $as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; }
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5
 $as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5
+$as_echo_n "checking if specified universal architectures work... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+printf("%d", 42);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+             as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
         # end of Darwin* tests
         ;;
     esac
diff --git a/configure.ac b/configure.ac
index d60f05251ab72..29acb8efa1ad3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1976,6 +1976,13 @@ yes)
         EXPORT_MACOSX_DEPLOYMENT_TARGET=''
         AC_MSG_RESULT($MACOSX_DEPLOYMENT_TARGET)
 
+        AC_MSG_CHECKING(if specified universal architectures work)
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[printf("%d", 42);]])],
+            [AC_MSG_RESULT(yes)],
+            [AC_MSG_RESULT(no)
+             AC_MSG_ERROR(check config.log and use the '--with-universal-archs' option)
+        ])
+
         # end of Darwin* tests
         ;;
     esac



More information about the Python-checkins mailing list