Skip to content

gh-127604: ensure -ldl is passed to the linker when dladdr1 is found #133040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/faulthandler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ Dumping the C stack
C Stack Compatibility
*********************

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

Additionally, some compilers do not support :term:`CPython's <CPython>`
implementation of C stack dumps. As a result, a different error may be printed
Expand Down
26 changes: 13 additions & 13 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2986,8 +2986,12 @@ AC_HEADER_DIRENT
AC_HEADER_MAJOR

# for faulthandler
AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h],
[AC_CHECK_FUNCS(backtrace backtrace_symbols dladdr1)])
AC_CHECK_HEADERS([execinfo.h link.h dlfcn.h], [
AC_CHECK_FUNCS([backtrace dladdr1], [
# dladdr1 requires -ldl
AS_VAR_APPEND([LDFLAGS], [" -ldl"])
])
])

# bluetooth/bluetooth.h has been known to not compile with -std=c99.
# http://permalink.gmane.org/gmane.linux.bluez.kernel/22294
Expand Down
3 changes: 0 additions & 3 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@
/* Define to 1 if you have the 'backtrace' function. */
#undef HAVE_BACKTRACE

/* Define to 1 if you have the 'backtrace_symbols' function. */
#undef HAVE_BACKTRACE_SYMBOLS

/* Define if you have the 'bind' function. */
#undef HAVE_BIND

Expand Down
Loading