Skip to content
Permalink
Browse files

check for RTLD_DEEPBIND, rename

  • Loading branch information...
trws committed Oct 14, 2018
1 parent 15d95ff commit 7a444683b2b0171799c1cbab17d5913f459de803
Showing with 12 additions and 6 deletions.
  1. +9 −3 configure.ac
  2. +1 −1 src/broker/module.c
  3. +1 −1 src/common/libflux/handle.c
  4. +1 −1 src/common/libflux/module.c
@@ -59,11 +59,17 @@ AS_CASE($ax_cv_cxx_compiler_vendor,
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])

X_AC_ENABLE_SANITIZER
if test "x$san_enabled" != "xno" ; then
AC_DEFINE([DEEPBIND], [0],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
#include <dlfcn.h>
#if !(defined(RTLD_DEEPBIND))
#error nope
#endif
])], [has_deepbind=yes], [has_deepbind=no])
if test "x$san_enabled" != "xno" || test "x$has_deepbind" = "xno" ; then
AC_DEFINE([FLUX_DEEPBIND], [0],
[deepbind is unsupported with asan, musl and so-forth])
else
AC_DEFINE([DEEPBIND], [RTLD_DEEPBIND],
AC_DEFINE([FLUX_DEEPBIND], [RTLD_DEEPBIND],
[deepbind is unsupported with asan, musl and so-forth])
fi

@@ -531,7 +531,7 @@ module_t *module_add (modhash_t *mh, const char *path)
int rc;

dlerror ();
if (!(dso = dlopen (path, RTLD_NOW | RTLD_LOCAL | DEEPBIND))) {
if (!(dso = dlopen (path, RTLD_NOW | RTLD_LOCAL | FLUX_DEEPBIND))) {
log_msg ("%s", dlerror ());
errno = ENOENT;
return NULL;
@@ -230,7 +230,7 @@ static connector_init_f *find_connector (const char *scheme, void **dsop)
}
if (!(path = find_file (name, searchpath)))
goto done;
if (!(dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | DEEPBIND))) {
if (!(dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | FLUX_DEEPBIND))) {
errno = EINVAL;
goto done;
}
@@ -263,7 +263,7 @@ char *flux_modname(const char *path)
char *name = NULL;

dlerror ();
if ((dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | DEEPBIND))) {
if ((dso = dlopen (path, RTLD_LAZY | RTLD_LOCAL | FLUX_DEEPBIND))) {
int errnum = EINVAL;
if ((np = dlsym (dso, "mod_name")) && *np)
if (!(name = strdup (*np)))

0 comments on commit 7a44468

Please sign in to comment.
You can’t perform that action at this time.