Skip to content

Commit ef9ea52

Browse files
committed
Link probe HAVE_LIBGCC_EH_FRAME_REGISTRATION
1 parent e8de85d commit ef9ea52

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

Include/internal/pycore_jit_unwind.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
#if defined(_Py_JIT) && defined(__linux__) && defined(__ELF__)
1212
# define PY_HAVE_JIT_GDB_UNWIND
13-
# if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE)
13+
# if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \
14+
defined(HAVE_LIBGCC_EH_FRAME_REGISTRATION)
1415
# define PY_HAVE_JIT_GNU_BACKTRACE_UNWIND
1516
# endif
1617
#endif

configure

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3828,6 +3828,24 @@ AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h], [
38283828
])
38293829
])
38303830

3831+
dnl for JIT GNU backtrace unwind registration
3832+
AC_CACHE_CHECK([for libgcc frame registration functions],
3833+
[ac_cv_have_libgcc_eh_frame_registration],
3834+
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
3835+
void __register_frame(const void *);
3836+
void __deregister_frame(const void *);
3837+
]], [[
3838+
__register_frame(0);
3839+
__deregister_frame(0);
3840+
]])],
3841+
[ac_cv_have_libgcc_eh_frame_registration=yes],
3842+
[ac_cv_have_libgcc_eh_frame_registration=no])
3843+
])
3844+
AS_VAR_IF([ac_cv_have_libgcc_eh_frame_registration], [yes], [
3845+
AC_DEFINE([HAVE_LIBGCC_EH_FRAME_REGISTRATION], [1],
3846+
[Define to 1 if libgcc __register_frame and __deregister_frame are linkable.])
3847+
])
3848+
38313849
dnl only add -ldl to LDFLAGS if it isn't already part of LIBS (GH-133081)
38323850
AS_VAR_IF([ac_cv_require_ldl], [yes], [
38333851
AS_VAR_IF([ac_cv_lib_dl_dlopen], [yes], [], [

pyconfig.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,10 @@
701701
/* Define to 1 if you have the 'dld' library (-ldld). */
702702
#undef HAVE_LIBDLD
703703

704+
/* Define to 1 if libgcc __register_frame and __deregister_frame are linkable.
705+
*/
706+
#undef HAVE_LIBGCC_EH_FRAME_REGISTRATION
707+
704708
/* Define to 1 if you have the 'ieee' library (-lieee). */
705709
#undef HAVE_LIBIEEE
706710

0 commit comments

Comments
 (0)