@@ -1717,22 +1717,6 @@ then
17171717 ABI_THREAD="t"
17181718fi
17191719
1720- # Check for --enable-tail-call-interp
1721- # --enable-tail-call-interp
1722- AC_MSG_CHECKING ( [ for --enable-tail-call-interp] )
1723- AC_ARG_ENABLE ( [ tail-call-interp] ,
1724- [ AS_HELP_STRING ( [ --enable-tail-call-interp] , [ enable tail calling interpreter] ) ] ,
1725- [
1726- if test "$enableval" != no
1727- then
1728- AC_MSG_RESULT ( [ yes] ) ;
1729- AC_DEFINE ( [ Py_TAIL_CALL_INTERP] , [ 1] ,
1730- [ Define if you want to enable tail calling interpreter] )
1731- else
1732- AC_MSG_RESULT ( [ no] ) ;
1733- fi] ,
1734- [ AC_MSG_RESULT ( [ no] ) ] )
1735-
17361720# Check for --with-pydebug
17371721AC_MSG_CHECKING ( [ for --with-pydebug] )
17381722AC_ARG_WITH ( [ pydebug] ,
@@ -7013,6 +6997,60 @@ case "$ac_cv_computed_gotos" in yes*)
70136997 [ Define if the C compiler supports computed gotos.] )
70146998esac
70156999
7000+ # Check for --with-tail-calling-interp
7001+ AC_MSG_CHECKING ( [ for --with-tail-calling-interp] )
7002+ AC_ARG_WITH (
7003+ [ tail-calling-interp] ,
7004+ [ AS_HELP_STRING (
7005+ [ --tail-calling-interp] ,
7006+ [ enable tail-calling interpreter in evaluation loop and rest of CPython (enabled by default on supported compilers)]
7007+ ) ] ,
7008+ [
7009+ if test "$withval" = yes
7010+ then
7011+ AC_DEFINE ( [ Py_TAIL_CALLING_INTERP] , [ 1] ,
7012+ [ Define if you want to use tail-calling interpreters in CPython.] )
7013+ AC_MSG_RESULT ( [ yes] )
7014+ fi
7015+ if test "$withval" = no
7016+ then
7017+ AC_DEFINE ( [ Py_TAIL_CALLING_INTERP] , [ 0] ,
7018+ [ Define if you want to use tail-calling interpreters in CPython.] )
7019+ AC_MSG_RESULT ( [ no] )
7020+ fi
7021+ ] ,
7022+ [ AC_MSG_RESULT ( [ no value specified] ) ] )
7023+
7024+
7025+ AC_CACHE_CHECK ( [ whether $CC supports efficient proper tail calls] , [ ac_cv_tail_call] ,
7026+ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [ [
7027+
7028+ #if __has_attribute(musttail)
7029+ # if __has_attribute(preserve_none)
7030+ // Only allowlist x86_64 and AArch64. Add more architectures as compilers gain support for them.
7031+ # if defined(__x86_64__) || defined(__aarch64__)
7032+ # define PROPER_TAIL_CALLS 1
7033+ # endif
7034+ # endif
7035+ #endif
7036+
7037+ #ifndef PROPER_TAIL_CALLS
7038+ # error "No proper tail calls"
7039+ #endif
7040+
7041+ ] ] ] ) ] ,
7042+ [ ac_cv_tail_call=yes] ,
7043+ [ ac_cv_tail_call=no] ,
7044+ [ if test "${with_tail_calling_interp+set}" = set; then
7045+ ac_cv_tail_call="$with_tail_calling_interp -- configured --with(out)-tail-calling-interp"
7046+ else
7047+ ac_cv_tail_call=no
7048+ fi] ) )
7049+ case "$ac_cv_tail_call" in yes*)
7050+ AC_DEFINE ( [ Py_TAIL_CALLING_INTERP] , [ 1] ,
7051+ [ Define if the C compiler supports efficient proper tail calls.] )
7052+ esac
7053+
70167054case $ac_sys_system in
70177055AIX*)
70187056 AC_DEFINE ( [ HAVE_BROKEN_PIPE_BUF] , [ 1] ,
0 commit comments