diff --git a/ChangeLog b/ChangeLog index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index d36fa0ccc..5b2bb85bc 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Sat Feb 17 07:26:33 2001 Tim Janik + + * configure.in (G_MODULE_HAVE_DLERROR): add check for broken RTLD_GLOBAL + (on OSF1 V5.0). + 2001-02-15 Sebastian Wilhelmi * acconfig.h, configure.in: Reverted the changes necessary to diff --git a/configure.in b/configure.in index 334132abc..137422125 100644 --- a/configure.in +++ b/configure.in @@ -676,6 +676,36 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then LDFLAGS_orig="$LDFLAGS" LIBS="$LIBS $G_MODULE_LIBS" LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS" +dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness + AC_CACHE_CHECK([for RTLD_GLOBAL brokenness], + glib_cv_rtldglobal_broken,[ + AC_TRY_RUN([ + #include + #ifndef RTLD_GLOBAL + #define RTLD_GLOBAL 0 + #endif + #ifndef RTLD_LAZY + #define RTLD_LAZY 0 + #endif + int pthread_create; + int main () { + void *handle, *global, *local; + global = &pthread_create; + handle = dlopen ("libpthread.so", RTLD_GLOBAL | RTLD_LAZY); + if (!handle) return 0; + local = dlsym (handle, "pthread_create"); + return global == local; + }], + [glib_cv_rtldglobal_broken=no], + [glib_cv_rtldglobal_broken=yes], + []) + rm -f plugin.c plugin.o plugin.lo + ]) + if test "x$glib_cv_rtldglobal_broken" = "xyes"; then + G_MODULE_BROKEN_RTLD_GLOBAL=1 + else + G_MODULE_BROKEN_RTLD_GLOBAL=0 + fi dnl *** check whether we need preceeding underscores AC_CACHE_CHECK([for preceeding underscore in symbols], glib_cv_uscore,[ @@ -708,7 +738,7 @@ dnl *** check for having dlerror() [G_MODULE_HAVE_DLERROR=0]) LIBS="$LIBS_orig" fi -dnl *** done, have e got an implementation? +dnl *** done, have we got an implementation? if test -z "$G_MODULE_IMPL"; then G_MODULE_IMPL=0 fi @@ -733,6 +763,7 @@ AC_SUBST(G_MODULE_LIBS_EXTRA) AC_SUBST(G_MODULE_PLUGIN_LIBS) AC_SUBST(G_MODULE_LDFLAGS) AC_SUBST(G_MODULE_HAVE_DLERROR) +AC_SUBST(G_MODULE_BROKEN_RTLD_GLOBAL) AC_SUBST(G_MODULE_NEED_USCORE) AC_SUBST(GLIB_DEBUG_FLAGS) diff --git a/gmodule/ChangeLog b/gmodule/ChangeLog index 4a5a95391..ff1e640fb 100644 --- a/gmodule/ChangeLog +++ b/gmodule/ChangeLog @@ -1,3 +1,7 @@ +Sat Feb 17 07:27:15 2001 Tim Janik + + * gmodule.c: work around platforms that have broken RTLD_GLOBAL. + 2001-01-27 Tor Lillqvist * gmodule.c: (Win32) Need for open() and close(). diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c index 9df56d4ab..3ea449338 100644 --- a/gmodule/gmodule-dl.c +++ b/gmodule/gmodule-dl.c @@ -58,15 +58,19 @@ * RTLD_GLOBAL - the external symbols defined in the library will be made * available to subsequently loaded libraries. */ -#ifndef RTLD_GLOBAL -#define RTLD_GLOBAL 0 -#endif /* RTLD_GLOBAL */ #ifndef RTLD_LAZY #define RTLD_LAZY 1 #endif /* RTLD_LAZY */ #ifndef RTLD_NOW #define RTLD_NOW 0 #endif /* RTLD_NOW */ +/* some systems (OSF1 V5.0) have broken RTLD_GLOBAL linkage */ +#ifdef G_MODULE_BROKEN_RTLD_GLOBAL +#undef RTLD_GLOBAL +#endif /* G_MODULE_BROKEN_RTLD_GLOBAL */ +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 0 +#endif /* RTLD_GLOBAL */ /* --- functions --- */ diff --git a/gmodule/gmoduleconf.h.in b/gmodule/gmoduleconf.h.in index 48b52bb4c..9aa6500e2 100644 --- a/gmodule/gmoduleconf.h.in +++ b/gmodule/gmoduleconf.h.in @@ -40,7 +40,9 @@ extern "C" { #if (@G_MODULE_NEED_USCORE@) || defined (hp9000s300) || defined (__hp9000s300) || defined (__hp9000s300__) #define G_MODULE_NEED_USCORE #endif - +#if (@G_MODULE_BROKEN_RTLD_GLOBAL@) +#define G_MODULE_BROKEN_RTLD_GLOBAL +#endif #ifdef __cplusplus }