bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973)
authorVictor Stinner <vstinner@redhat.com>
Fri, 26 Apr 2019 16:56:19 +0000 (18:56 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2019 16:56:19 +0000 (18:56 +0200)
Py_TRACE_REFS ABI is incompatible with release and debug (Py_DEBUG)
ABI.

Include/pyport.h
configure
configure.ac

index acbae5bafeb512a71a38ac0cbc9167cc0e40b22c..568ab8f757d2171ec8fec939561f0193edf9070f 100644 (file)
@@ -797,9 +797,9 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
 #endif /* Py_BUILD_CORE */
 
 #ifdef __ANDROID__
-/* The Android langinfo.h header is not used. */
-#undef HAVE_LANGINFO_H
-#undef CODESET
+   /* The Android langinfo.h header is not used. */
+#  undef HAVE_LANGINFO_H
+#  undef CODESET
 #endif
 
 /* Maximum value of the Windows DWORD type */
@@ -810,7 +810,13 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
  * for compatibility.
  */
 #ifndef WITH_THREAD
-#define WITH_THREAD
+#  define WITH_THREAD
+#endif
+
+/* Check that ALT_SOABI is consistent with Py_TRACE_REFS:
+   ./configure --with-trace-refs should must be used to define Py_TRACE_REFS */
+#if defined(ALT_SOABI) && defined(Py_TRACE_REFS)
+#  error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
 #endif
 
 #endif /* Py_PYPORT_H */
index b2775cf04000fd0ab1eb6a74c34d2cdfa70d533d..7f26fab81fe5dd1bb0071bfd96d2d6fb46f881d0 100755 (executable)
--- a/configure
+++ b/configure
@@ -15128,7 +15128,8 @@ SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFO
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
 $as_echo "$SOABI" >&6; }
 
-if test "$Py_DEBUG" = 'true'; then
+# Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI
+if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then
   # Similar to SOABI but remove "d" flag from ABIFLAGS
 
   ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
index 312758788e4d7aaca3409a7df8989deb4e92ab85..157e9bf4067943ffdb7ea6c41b7c2a821199a71f 100644 (file)
@@ -4627,7 +4627,8 @@ AC_MSG_CHECKING(SOABI)
 SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
 AC_MSG_RESULT($SOABI)
 
-if test "$Py_DEBUG" = 'true'; then
+# Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI
+if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then
   # Similar to SOABI but remove "d" flag from ABIFLAGS
   AC_SUBST(ALT_SOABI)
   ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}