diff -r a4b66e51e0bf Lib/test/test_sysconfig.py --- a/Lib/test/test_sysconfig.py Mon Apr 13 22:11:34 2015 +0200 +++ b/Lib/test/test_sysconfig.py Mon Apr 13 22:44:42 2015 +0200 @@ -389,12 +389,6 @@ self.assertIsNotNone(vars['SO']) self.assertEqual(vars['SO'], vars['EXT_SUFFIX']) - @unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test') - def test_bitness_in_ext_suffix(self): - suffix = sysconfig.get_config_var('EXT_SUFFIX') - bitness = '-32b' if sys.maxsize < 2**32 else '-64b' - self.assertTrue(suffix.endswith(bitness + '.so'), suffix) - class MakefileTests(unittest.TestCase): diff -r a4b66e51e0bf Misc/NEWS --- a/Misc/NEWS Mon Apr 13 22:11:34 2015 +0200 +++ b/Misc/NEWS Mon Apr 13 22:44:42 2015 +0200 @@ -10,6 +10,10 @@ Core and Builtins ----------------- +- Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include + the architecture triplet in the extension name, to make it easy to test builds + for different ABIs in the same working tree. + - Issue #23731: Implement PEP 488: removal of .pyo files. - Issue #23726: Don't enable GC for user subclasses of non-GC types that @@ -357,10 +361,6 @@ Core and Builtins ----------------- -- Issue #22980: Under Linux, C extensions now include bitness in the file - name, to make it easy to test 32-bit and 64-bit builds in the same - working tree. - - Issue #23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError if a function returns a result and raises an exception. The SystemError is chained to the previous exception. diff -r a4b66e51e0bf configure.ac --- a/configure.ac Mon Apr 13 22:11:34 2015 +0200 +++ b/configure.ac Mon Apr 13 22:44:42 2015 +0200 @@ -425,7 +425,7 @@ esac _PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}" fi - + # Some systems cannot stand _XOPEN_SOURCE being defined at all; they # disable features if it is defined, without any means to access these # features as extensions. For these systems, we skip the definition of @@ -667,6 +667,8 @@ fi fi AC_PROG_CC +AC_PROG_CPP +AC_PROG_EGREP AC_SUBST(CXX) AC_SUBST(MAINCC) @@ -724,6 +726,114 @@ 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 <conftest.out 2>/dev/null; then + PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` + AC_MSG_RESULT([$PLATFORM_TRIPLET]) +else + AC_MSG_RESULT([none]) +fi +rm -f conftest.c conftest.out + +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]) + fi +fi +PLATDIR=plat-$MACHDEP +AC_SUBST(PLATDIR) +AC_SUBST(PLATFORM_TRIPLET) + + AC_MSG_CHECKING([for -Wl,--no-as-needed]) save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--no-as-needed" @@ -791,10 +901,6 @@ esac;; esac -MULTIARCH=$($CC --print-multiarch 2>/dev/null) -AC_SUBST(MULTIARCH) - - AC_SUBST(LIBRARY) AC_MSG_CHECKING(LIBRARY) if test -z "$LIBRARY" @@ -4173,15 +4279,7 @@ AC_MSG_CHECKING(ABIFLAGS) AC_MSG_RESULT($ABIFLAGS) AC_MSG_CHECKING(SOABI) - -case $ac_sys_system in - Linux*|GNU*) - BITNESS_SUFFIX=-$(($ac_cv_sizeof_void_p * 8))b;; - *) - BITNESS_SUFFIX=;; -esac -SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${BITNESS_SUFFIX} - +SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} AC_MSG_RESULT($SOABI) AC_SUBST(EXT_SUFFIX)