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

W.C.A. Wijngaards wouter at nlnetlabs.nl
Wed Nov 4 22:53:41 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Daniel,

On 11/04/2015 11:23 PM, Daniel Kahn Gillmor wrote:
> 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.

But that is not how the linker works, I understand you would like it to.

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

Regardless of what calls getdns uses, the dependency of openssl on
libdl has to be satisfied for the linker to succeed.

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

No, you cannot safely apply that patch.  The library will not link
properly (at compile time or at run time, not sure) for some
setups/platforms.  Leaving out -ldl when possible would be a nice
patch (that I would also like for unbound and NSD).

Best regards, Wouter

> 
> 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 _______________________________________________ Users mailing
> list Users at getdnsapi.net 
> http://getdnsapi.net/mailman/listinfo/users
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJWOox0AAoJEJ9vHC1+BF+NlkcP/ixzETnGIvxvaRQpZfqHdLux
Q6QfR2zbq8qXjIpqmGjaK2VAuDTqpk5OSoPIVCNZON394OPEtjVbKhBkZFrcxkud
evU/P2NxfYYQVN7QBg6L07NkmCzihbumWOkPvhB2ZmLhnV7sJBHcYnVGNsXbnqWa
o6D3HFy3nuzVgq7YZVka5bs4aCfgHrE0KlsEELg2aoVn/AQ+zEyk+qcey6Q/CI9k
0iEZ+f3N1X5pcoSnuT4XTfx85WWmOrVYO8dUeM/0vlEsj4t2QQN1DozEPBg7WFPy
7TtdrGNIOnf1WWWAtoI+XdYF6jkWyav+E+i5y6rL94xolmRaOSTZNKKvd3Xr1zZi
3WrvfAnibwhRqJrq7/a2rlmfRwUyGZ3Mrvdk/E1qQOvetN2L/b6rPEn3zpSqXm47
IEyQUPyrgFBI4NYg5sSH+64yRJuT52SmXL1aN6Hazudp/HWUy8a9s4x0baJ6YBKm
2OE9ZkjRgCJbRu+vnD9F7zcC740CW9W1t0PzBqrNXcxPxMb0HLA4WqpQjUDCJ/Db
PIVJ+wJ1Un6BysxVzL+m+SevwCQkA/F+qBBNX/iPKdu9EzYo51MBuTGpRXU6/oV1
vGi/PFkIwj23Z9FVBXGDlshbd85yqyawKSayyA30WnCuI5EXvCbWxjpcswVZ1VmK
cNMy7isp5u7cJI1x21bC
=ttFd
-----END PGP SIGNATURE-----



More information about the Users mailing list