Skip to content

Commit 2443662

Browse files
authored
gh-127604: ensure -ldl is passed to the linker when dladdr1 is found (#133040)
1 parent 3695ba9 commit 2443662

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

Doc/library/faulthandler.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ Dumping the C stack
8484
C Stack Compatibility
8585
*********************
8686

87-
If the system does not support the C-level :manpage:`backtrace(3)`,
88-
:manpage:`backtrace_symbols(3)`, or :manpage:`dladdr(3)`, then C stack dumps
89-
will not work. An error will be printed instead of the stack.
87+
If the system does not support the C-level :manpage:`backtrace(3)`
88+
or :manpage:`dladdr1(3)`, then C stack dumps will not work.
89+
An error will be printed instead of the stack.
9090

9191
Additionally, some compilers do not support :term:`CPython's <CPython>`
9292
implementation of C stack dumps. As a result, a different error may be printed

configure

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+6-2
Original file line numberDiff line numberDiff line change
@@ -2986,8 +2986,12 @@ AC_HEADER_DIRENT
29862986
AC_HEADER_MAJOR
29872987

29882988
# for faulthandler
2989-
AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h],
2990-
[AC_CHECK_FUNCS(backtrace backtrace_symbols dladdr1)])
2989+
AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h], [
2990+
AC_CHECK_FUNCS([backtrace dladdr1], [
2991+
# dladdr1 requires -ldl
2992+
AS_VAR_APPEND([LDFLAGS], [" -ldl"])
2993+
])
2994+
])
29912995

29922996
# bluetooth/bluetooth.h has been known to not compile with -std=c99.
29932997
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294

pyconfig.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@
9292
/* Define to 1 if you have the 'backtrace' function. */
9393
#undef HAVE_BACKTRACE
9494

95-
/* Define to 1 if you have the 'backtrace_symbols' function. */
96-
#undef HAVE_BACKTRACE_SYMBOLS
97-
9895
/* Define if you have the 'bind' function. */
9996
#undef HAVE_BIND
10097

0 commit comments

Comments
 (0)