Fixed support for building with glibc >= 2.34.

This resolves issue #3.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit b7e7bb99e1)
r14.0.x r14.0.13
Michele Calgaro 2 years ago
parent 9dfcf38a3e
commit 38d735962d
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -53,7 +53,9 @@ if( BUILD_KGTK_GTK2 )
check_library_exists( "${CMAKE_DL_LIBS}" _dl_sym "" HAVE_DL_SYM ) check_library_exists( "${CMAKE_DL_LIBS}" _dl_sym "" HAVE_DL_SYM )
if( NOT HAVE_DL_SYM ) if( NOT HAVE_DL_SYM )
tde_message_fatal( "The DL library seems no longer contains _dl_sym function" ) message( WARNING, "_dl_sym is requested but not found on your system.\n"
"Some functionality may not be available unless your\n"
"system has glibc 2.34 or greater." )
endif() endif()
endif() endif()

@ -13,3 +13,6 @@
#cmakedefine HAVE_STRUCT_UCRED 1 #cmakedefine HAVE_STRUCT_UCRED 1
#define VERSION "@KGTK_VERSION_FULL@" #define VERSION "@KGTK_VERSION_FULL@"
/* Define if you have the '_dl_sym' function */
#cmakedefine HAVE_DL_SYM 1

@ -76,7 +76,9 @@ TODO
/* /*
* For SWT apps (e.g. eclipse) we need to override dlsym. * For SWT apps (e.g. eclipse) we need to override dlsym.
*/ */
#ifdef HAVE_DL_SYM
extern void *_dl_sym(void *, const char *, void *); extern void *_dl_sym(void *, const char *, void *);
#endif
static void * real_dlsym (void *handle, const char *name); static void * real_dlsym (void *handle, const char *name);
typedef enum typedef enum
@ -2246,7 +2248,11 @@ static void * real_dlsym(void *handle, const char *name)
if (!realFunction) if (!realFunction)
{ {
// Get the real dlsym function // Get the real dlsym function
#ifdef HAVE_DL_SYM
realFunction = _dl_sym(RTLD_NEXT, "dlsym", dlsym); realFunction = _dl_sym(RTLD_NEXT, "dlsym", dlsym);
#else
realFunction = dlvsym(RTLD_NEXT, "dlsym", "GLIBC_2.2.5");
#endif
} }
if (realFunction) if (realFunction)

Loading…
Cancel
Save