Skip to content

Commit 6d13e5b

Browse files
authored
bpo-36722: Don't define ALT_SOABI for Py_TRACE_REFS build (GH-12973)
Py_TRACE_REFS ABI is incompatible with release and debug (Py_DEBUG) ABI.
1 parent 4046069 commit 6d13e5b

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

Include/pyport.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,9 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
797797
#endif /* Py_BUILD_CORE */
798798

799799
#ifdef __ANDROID__
800-
/* The Android langinfo.h header is not used. */
801-
#undef HAVE_LANGINFO_H
802-
#undef CODESET
800+
/* The Android langinfo.h header is not used. */
801+
# undef HAVE_LANGINFO_H
802+
# undef CODESET
803803
#endif
804804

805805
/* Maximum value of the Windows DWORD type */
@@ -810,7 +810,13 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
810810
* for compatibility.
811811
*/
812812
#ifndef WITH_THREAD
813-
#define WITH_THREAD
813+
# define WITH_THREAD
814+
#endif
815+
816+
/* Check that ALT_SOABI is consistent with Py_TRACE_REFS:
817+
./configure --with-trace-refs should must be used to define Py_TRACE_REFS */
818+
#if defined(ALT_SOABI) && defined(Py_TRACE_REFS)
819+
# error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
814820
#endif
815821

816822
#endif /* Py_PYPORT_H */

configure

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15128,7 +15128,8 @@ SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFO
1512815128
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
1512915129
$as_echo "$SOABI" >&6; }
1513015130

15131-
if test "$Py_DEBUG" = 'true'; then
15131+
# Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI
15132+
if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then
1513215133
# Similar to SOABI but remove "d" flag from ABIFLAGS
1513315134

1513415135
ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4627,7 +4627,8 @@ AC_MSG_CHECKING(SOABI)
46274627
SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
46284628
AC_MSG_RESULT($SOABI)
46294629

4630-
if test "$Py_DEBUG" = 'true'; then
4630+
# Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI
4631+
if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then
46314632
# Similar to SOABI but remove "d" flag from ABIFLAGS
46324633
AC_SUBST(ALT_SOABI)
46334634
ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}

0 commit comments

Comments
 (0)