Add -ldl library if needed for dladdr()

It's possible for the dlopen() check to succeed without -ldl, but the dladdr()
check fails without it. This happens with GCC's -fsanitize=address.
This commit is contained in:
Paul Cornett
2020-09-18 09:52:30 -07:00
parent 52631b3368
commit a8fc92d020
2 changed files with 11 additions and 4 deletions

7
configure vendored
View File

@@ -33302,7 +33302,7 @@ if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
HAVE_DL_FUNCS=1
DL_LINK="-ldl $DL_LINK"
DL_LINK="-ldl"
fi
@@ -33360,7 +33360,10 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5
$as_echo "$ac_cv_lib_dl_dladdr" >&6; }
if test "x$ac_cv_lib_dl_dladdr" = xyes; then :
$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
DL_LINK="-ldl"
fi

View File

@@ -5565,7 +5565,7 @@ if test "$TOOLKIT" != "MSW"; then
[
AC_DEFINE(HAVE_DLOPEN)
HAVE_DL_FUNCS=1
DL_LINK="-ldl $DL_LINK"
DL_LINK="-ldl"
])
])
@@ -5574,7 +5574,11 @@ if test "$TOOLKIT" != "MSW"; then
AC_CHECK_FUNCS(dladdr,
AC_DEFINE(HAVE_DLADDR),
[
AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR))
AC_CHECK_LIB(dl, dladdr,
[
AC_DEFINE(HAVE_DLADDR)
DL_LINK="-ldl"
])
]
)
fi