]> granicus.if.org Git - python/commitdiff
Issue #22980: Under Linux, C extensions now include bitness in the file name,
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Mar 2015 19:43:10 +0000 (20:43 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Mar 2015 19:43:10 +0000 (20:43 +0100)
to make it easy to test 32-bit and 64-bit builds in the same working tree.

Lib/test/test_sysconfig.py
Misc/NEWS
configure
configure.ac

index 804c44671695a96ec605c36373dbaee851ec572c..3711784c4f829cf08d4063a6308ec3fcae54847c 100644 (file)
@@ -389,6 +389,12 @@ class TestSysConfig(unittest.TestCase):
         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):
 
index 343cf8f0c269a6acc63c0ae45e21f158ff245e57..aa8237d9a14796cfad124523b054c36d316915d1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,10 @@ Release date: 2015-03-08
 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.
index 799c6c4704512ea1cce0079dbd4d87a622b1c5cf..d91a9c7cbc4cf8ba3aabf0a9b24c932dddf8acd3 100755 (executable)
--- a/configure
+++ b/configure
@@ -14200,7 +14200,15 @@ $as_echo_n "checking ABIFLAGS... " >&6; }
 $as_echo "$ABIFLAGS" >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
 $as_echo_n "checking SOABI... " >&6; }
-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}
+
+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}
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
 $as_echo "$SOABI" >&6; }
 
index 263ae15555c9e51922b41887af5c2cf5ce68133f..c9bb90bd0becf2b9fe7a1bb89d7f82d15ca67ba2 100644 (file)
@@ -4175,7 +4175,15 @@ AC_SUBST(SOABI)
 AC_MSG_CHECKING(ABIFLAGS)
 AC_MSG_RESULT($ABIFLAGS)
 AC_MSG_CHECKING(SOABI)
-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}
+
+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}
+
 AC_MSG_RESULT($SOABI)
 
 AC_SUBST(EXT_SUFFIX)