summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-07-11 17:12:39 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-07-11 22:06:00 +0900
commit38d735962dc18ce299f1cc47b2d02314ef623f24 (patch)
tree37f38b2e478a9d6f1c46bab97eff45ff536d6d32
parent9dfcf38a3e4fbd14f15a6bb687fc85fd5ca34fd4 (diff)
downloadkgtk-qt3-r14.0.13.tar.gz
kgtk-qt3-r14.0.13.zip
Fixed support for building with glibc >= 2.34.r14.0.13r14.0.x
This resolves issue #3. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit b7e7bb99e1c85325ff55866434f797dfb5c91187)
-rw-r--r--ConfigureChecks.cmake4
-rw-r--r--config.h.cmake3
-rw-r--r--gtk2/kgtk2.c6
3 files changed, 12 insertions, 1 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index cfd9cd0..2a90541 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -53,7 +53,9 @@ if( BUILD_KGTK_GTK2 )
check_library_exists( "${CMAKE_DL_LIBS}" _dl_sym "" 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()
diff --git a/config.h.cmake b/config.h.cmake
index 2f33f6d..395ba2e 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -13,3 +13,6 @@
#cmakedefine HAVE_STRUCT_UCRED 1
#define VERSION "@KGTK_VERSION_FULL@"
+
+/* Define if you have the '_dl_sym' function */
+#cmakedefine HAVE_DL_SYM 1
diff --git a/gtk2/kgtk2.c b/gtk2/kgtk2.c
index e8e939b..4e83191 100644
--- a/gtk2/kgtk2.c
+++ b/gtk2/kgtk2.c
@@ -76,7 +76,9 @@ TODO
/*
* For SWT apps (e.g. eclipse) we need to override dlsym.
*/
+#ifdef HAVE_DL_SYM
extern void *_dl_sym(void *, const char *, void *);
+#endif
static void * real_dlsym (void *handle, const char *name);
typedef enum
@@ -2246,7 +2248,11 @@ static void * real_dlsym(void *handle, const char *name)
if (!realFunction)
{
// Get the real dlsym function
+#ifdef HAVE_DL_SYM
realFunction = _dl_sym(RTLD_NEXT, "dlsym", dlsym);
+#else
+ realFunction = dlvsym(RTLD_NEXT, "dlsym", "GLIBC_2.2.5");
+#endif
}
if (realFunction)