configure.ac: Adjust dlopen/dlsym checks
In modern gcc/clang, libasan (the address sanitizer runtime) exports a weak definition of `dlopen` so that it can intercept certain flags. If one tried to `./configure` with address sanitizer enabled, this would cause AC_SEARCH_LIBS to conclude that dlopen doesn't require any link flags to use. However libasan does not export `dlsym` and this caused AC_CHECK_FUNC to fail because it didn't try linking with `-ldl`.
This commit is contained in:
parent
e1d4ebda4d
commit
5ce1252007
1 changed files with 27 additions and 20 deletions
47
configure.ac
47
configure.ac
|
@ -1020,26 +1020,33 @@ if test "$shared_modules" = yes; then
|
|||
],
|
||||
dnl !shl_load:
|
||||
[
|
||||
dnl standard dlopen
|
||||
AC_SEARCH_LIBS(dlopen, [dl c_r],
|
||||
[
|
||||
AC_DEFINE(HAVE_DLOPEN, 1, [Define if the dlopen function is available.])
|
||||
SUFFIX=".so"
|
||||
MOD_TARGET=shared_modules
|
||||
SEDOBJ="s/\.o/.so/g"
|
||||
if test "$AppleGCC" = yes; then
|
||||
AC_CHECK_HEADERS([mach-o/dyld.h])
|
||||
fi
|
||||
AC_CHECK_FUNC(dlsym, ,
|
||||
[
|
||||
AC_MSG_WARN([dlsym is not available, shared modules disabled])
|
||||
shared_modules=no
|
||||
])
|
||||
AC_CHECK_FUNCS(dlfunc)
|
||||
],
|
||||
[
|
||||
shared_modules=no
|
||||
])
|
||||
dnl standard dlopen
|
||||
AC_SEARCH_LIBS(dlopen, [dl c_r],
|
||||
[
|
||||
AC_SEARCH_LIBS(dlsym, [dl c_r],
|
||||
[
|
||||
if
|
||||
test "$ac_cv_search_dlopen" != "none required" &&
|
||||
test "$ac_cv_search_dlsym" != "none required" &&
|
||||
test "$ac_cv_search_dlopen" != "$ac_cv_search_dlsym"; then
|
||||
AC_MSG_WARN([dlopen and dlsym from different sources])
|
||||
fi
|
||||
AC_DEFINE(HAVE_DLOPEN, 1, [Define if the dlopen function is available.])
|
||||
SUFFIX=".so"
|
||||
MOD_TARGET=shared_modules
|
||||
SEDOBJ="s/\.o/.so/g"
|
||||
if test "$AppleGCC" = yes; then
|
||||
AC_CHECK_HEADERS([mach-o/dyld.h])
|
||||
fi
|
||||
AC_CHECK_FUNCS(dlfunc)
|
||||
],
|
||||
[
|
||||
shared_modules=no
|
||||
])
|
||||
],
|
||||
[
|
||||
shared_modules=no
|
||||
])
|
||||
])
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue