Skip to content
Snippets Groups Projects
Unverified Commit b4a2a03c authored by Björn Esser's avatar Björn Esser
Browse files

testDynamicLoader: Use LIBDL_SO macro if defined.


Starting with glibc v2.34 there is no external version of libdl.so
anymore.  It has been merged into the glibc libc.so.

Assuming libdl.so will be present will break the test, thus the
LIBDL_SO macro should be used.  If the macro is not defined on
the system, we ensure it will be defined using the previously
hardcoded value.

Signed-off-by: default avatarBjörn Esser <besser82@fedoraproject.org>
parent ad35b3ba
No related branches found
No related tags found
1 merge request!221testDynamicLoader: Use LIBDL_SO macro if defined.
......@@ -8,6 +8,21 @@
# include <be/kernel/OS.h> /* disable_debugger() API. */
#endif
// Needed for __GLIBC__ test macro.
#ifdef __linux__
# include <features.h>
#endif
// Will define LIBDL_SO macro on systems with glibc.
#ifdef __GLIBC__
# include <gnu/lib-names.h>
#endif
// Define the LIBDL_SO macro, if not defined above.
#ifndef LIBDL_SO
# define LIBDL_SO "libdl.so"
#endif
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
......@@ -107,8 +122,8 @@ int testDynamicLoader(int argc, char* argv[])
// This one is actually fun to test, since dlopen is by default
// loaded...wonder why :)
res += TestDynamicLoader("foobar.lib", "dlopen", 0, 1, 0);
res += TestDynamicLoader("libdl.so", "dlopen", 1, 1, 1);
res += TestDynamicLoader("libdl.so", "TestDynamicLoader", 1, 0, 1);
res += TestDynamicLoader(LIBDL_SO, "dlopen", 1, 1, 1);
res += TestDynamicLoader(LIBDL_SO, "TestDynamicLoader", 1, 0, 1);
#endif
// Now try on the generated library
std::string libname = GetLibName(KWSYS_NAMESPACE_STRING "TestDynload");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment