From 9b46724266a9e3bf2fb5f52b505883ac839e0d0c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 21 Sep 2018 15:35:41 +0200 Subject: [PATCH] RTLD_DEEPBIND is not supported by sanitizers. --- src/smpi/internals/smpi_global.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 6ad37cd56e..96f7ff51d3 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -53,12 +53,14 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke extern "C" void _gfortran_set_args(int, char **); #endif -#ifndef RTLD_DEEPBIND /* RTLD_DEEPBIND is a bad idea of GNU ld that obviously does not exist on other platforms * See https://www.akkadia.org/drepper/dsohowto.pdf * and https://lists.freebsd.org/pipermail/freebsd-current/2016-March/060284.html */ -#define RTLD_DEEPBIND 0 +#if !defined(RTLD_DEEPBIND) || HAVE_SANITIZER_ADDRESS || HAVE_SANITIZER_THREAD +#define WANT_RTLD_DEEPBIND 0 +#else +#define WANT_RTLD_DEEPBIND RTLD_DEEPBIND #endif #if HAVE_PAPI @@ -611,7 +613,7 @@ static void smpi_init_privatization_dlopen(std::string executable) rank++; // Load the copy and resolve the entry point: - void* handle = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND); + void* handle = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | WANT_RTLD_DEEPBIND); int saved_errno = errno; if (simgrid::config::get_value("smpi/keep-temps") == false) { unlink(target_executable.c_str()); -- 2.20.1