There is no libdl on FreeBSD.
Yet there is libdl on Linux, and the existing command line is the correct way to build tests that use libdl API, isn't it?
Well, these are different things:
- What you refer to as Linux libdl API is available on FreeBSD as well.
- However, on FreeBSD the implementation of the API is part of libc and not libdl. There is no a library named libdl on FreeBSD.
So, given the test cases refer to libdl explicitly, they cannot be built on FreeBSD. The intention behind this patch is to remove explicit references to libdl from the test cases and apply '-ldl' to all test cases, where necessary.