diff options
author | Eric Blossom <eb@comsec.com> | 2010-12-22 16:49:05 -0800 |
---|---|---|
committer | Eric Blossom <eb@comsec.com> | 2010-12-22 16:49:05 -0800 |
commit | 272971a25cbd777634331a8777d2fbab2bb10ab7 (patch) | |
tree | d94b7d53aa833c49c19de20763dc2bcc1ecfc0c5 | |
parent | 75b650ef2506fe5c607517a3d5188b0705f60fde (diff) |
Check for lt_dladvise_global and fall back to using lt_dlopenext if not found.
-rw-r--r-- | config/gr_guile.m4 | 6 | ||||
-rw-r--r-- | gnuradio-core/src/guile/dynl-global.c | 31 |
2 files changed, 37 insertions, 0 deletions
diff --git a/config/gr_guile.m4 b/config/gr_guile.m4 index 15ed9adb32..c5268169f8 100644 --- a/config/gr_guile.m4 +++ b/config/gr_guile.m4 @@ -44,6 +44,12 @@ AC_DEFUN([GUILE_DEVEL],[ AC_SUBST(GUILE_PKLIBDIR) AC_SUBST(GUILE_PKDATADIR) AC_SUBST(GUILE_LIBS) + + dnl see if we've got lt_dladvise_global (libtool-2.*) + AC_SEARCH_LIBS([lt_dladvise_global],[ltdl], + [AC_DEFINE([HAVE_LT_DLADVISE_GLOBAL], [1], + [Define if lt_dladvise_global exists.])], + [],[]) ]) # GUILE_CHECK_MODULE diff --git a/gnuradio-core/src/guile/dynl-global.c b/gnuradio-core/src/guile/dynl-global.c index 1fc3a97a5a..3bf2741b13 100644 --- a/gnuradio-core/src/guile/dynl-global.c +++ b/gnuradio-core/src/guile/dynl-global.c @@ -18,6 +18,21 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* + * This file is an attempt to work around a problem that appears on + * certain Ubuntu (and perhaps other) systems. On those systems + * (10.04 is known to have the problem, while 10.10 and later work OK + * without this kludge), we end up with a situation where exceptions + * are not caught by the swig code, even though the swig generated + * code "looks right" and "is right". Details of the issue can be + * found in swig bug 1863647, + * http://sourceforge.net/tracker/index.php?func=detail&aid=1863647&group_id=1645&atid=101645 + * + * We work around the problem by loading swig generated guile modules + * using the equivalent of the dlopen's RTLD_GLOBAL flag. This is + * only possible on systems using libtool-2.*. Those systems contain + * the lt_dlavise_global function. + */ #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -27,6 +42,10 @@ extern scm_t_bits scm_tc16_dynamic_obj; +#ifdef HAVE_LT_DLADVISE_GLOBAL +/* + * Load shared module using the equivalent of the RTLD_GLOBAL flag + */ static lt_dlhandle dlopenext_global (const char *filename) { @@ -42,6 +61,18 @@ dlopenext_global (const char *filename) return handle; } +#else + +/* + * We don't have lt_dladvise_global. Fall back to lt_dlopenext. + */ +static lt_dlhandle +dlopenext_global (const char *filename) +{ + return lt_dlopenext (filename); +} +#endif + static void * sysdep_dynl_link_global (const char *fname, const char *subr) |