[getdns-users] why do we link libgetdns.so to dlopen?

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Nov 4 22:23:30 UTC 2015


i noticed that libgetdns.so is being linked against libdl, but i don't
think we're using dlopen or any of the other functions exported from
ldl.

fwict, ./configure is adding -ldl because of m4/acx_openssl.m4, which
claims:

	# openssl engine functionality needs dlopen().
	BAKLIBS="$LIBS"
	AC_SEARCH_LIBS([dlopen], [dl])
	if test "$LIBS" != "$BAKLIBS"; then
		LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
	fi

However, we're not using OpenSSL Engine support directly.  If some
library user wants to initialize openssl's engine support, they should
be able to do that with OpenSSL itself, and then they should be able to
get libcrypto and/or libssl to use libdl directly.

On some minimal systems, libcrypto and libssl might be built without
engine support at all; in that case, libgetdns is adding a superfluous
dependency to the linker.

I don't know the what the getdns policy is about tweaking the files in
m4/, but maybe the following patch can be safely applied?

diff --git a/m4/acx_openssl.m4 b/m4/acx_openssl.m4
index 87507dc..059a670 100644
--- a/m4/acx_openssl.m4
+++ b/m4/acx_openssl.m4
@@ -95,12 +95,6 @@ AC_DEFUN([ACX_SSL_CHECKS], [
         fi
         AC_SUBST(HAVE_SSL)
         AC_SUBST(RUNTIME_PATH)
-	# openssl engine functionality needs dlopen().
-	BAKLIBS="$LIBS"
-	AC_SEARCH_LIBS([dlopen], [dl])
-	if test "$LIBS" != "$BAKLIBS"; then
-		LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
-	fi
     fi
 AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT])
 AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT])


wdyt?

        --dkg



More information about the Users mailing list