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

This commit is contained in:
Bénédikt Tran 2025-04-28 00:28:42 +02:00 committed by GitHub
parent 3695ba93d5
commit 24436629ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 22 deletions

View file

@ -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