From 176cecfb3b1e3c0457bfc3707c35e78628a33dc1 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 5 Mar 2007 17:21:42 +0000 Subject: [PATCH] Fix for LT 2.1 libltdl lt_dlopen behavior of putting loaded DSO's in a private scope. Solves the problem of Red Hat-provided OFED not working properly because the libibverbs plugins are not linked against libibverbs. This commit was SVN r13926. --- autogen.sh | 9 +++++++++ config/libltdl_dlopen_global.diff | 29 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 config/libltdl_dlopen_global.diff diff --git a/autogen.sh b/autogen.sh index bab0cc7eb5..124955ea7b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -440,6 +440,15 @@ EOF else echo " ==> your libtool doesn't need this! yay!" fi + + echo " -- RTLD_GLOBAL in libltdl" + if test -r opal/libltdl/loaders/dlopen.c && \ + test ! -z "`grep 'filename, LT_LAZY_OR_NOW' opal/libltdl/loaders/dlopen.c`"; then + patch -N -p0 < config/libltdl_dlopen_global.diff + else + echo " ==> your libltdl doesn't need this! yay!" + fi + echo " -- patching configure for broken -c/-o compiler test" sed -e 's/chmod -w \./#OMPI\/MPI FIX: chmod -w ./' \ configure > configure.new diff --git a/config/libltdl_dlopen_global.diff b/config/libltdl_dlopen_global.diff new file mode 100644 index 0000000000..16d72ae23c --- /dev/null +++ b/config/libltdl_dlopen_global.diff @@ -0,0 +1,29 @@ +--- opal/libltdl/loaders/dlopen.c 2007-03-05 08:56:11.000000000 -0800 ++++ opal/libltdl/loaders/dlopen_global.c 2007-03-05 08:54:46.000000000 -0800 +@@ -121,6 +121,17 @@ + # define LT_LAZY_OR_NOW 0 + #endif /* !LT_LAZY_OR_NOW */ + ++/* Open MPI */ ++#if !defined(LT_GLOBAL) ++# if defined(RTLD_GLOBAL) ++# define LT_GLOBAL RTLD_GLOBAL ++# else ++# if defined(DL_GLOBAL) ++# define LT_GLOBAL DL_GLOBAL ++# endif ++# endif /* !RTLD_GLOBAL */ ++#endif ++ + #if defined(HAVE_DLERROR) + # define DLERROR(arg) dlerror () + #else +@@ -136,7 +147,7 @@ + static lt_module + vm_open (lt_user_data LT__UNUSED loader_data, const char *filename) + { +- lt_module module = dlopen (filename, LT_LAZY_OR_NOW); ++ lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW); + + if (!module) + {