I am building a shared lib on Ubuntu 18.04.1 that has to be linked explicitly with libdl.so.
All is good when using a non-libtool makefile - "-ldl" is supplied to the linker and the produced binary imports libdl.so.
But when trying to build with a libtooled automake, the produced shared library does not import libdl.so despite fact that Makefile.am has la_LDFLAGS set to "-Wl,--no-as-needed -ldl"
I suspect that this is due to the fact that libtool comes with its own implementation of dl (libltdl) and it is linked in statically instead of libdl.so
Is there any way, a command line option perhaps, that will enforce libtool to use the native implementation instead of libltdl? - I have spent a lot of time finding it in vain.
The libtool version is 2.4.6 Thanks