From f89ae72c60b30784e113df32b7d40058f62b2384 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 19 Sep 2018 22:13:27 +0200 Subject: [PATCH] Revert "Remove usage of RTLD_DEEPBIND." It's in fact needed for starpu and some of the smpi proxy apps. This reverts commit f257ec7c9ab6e14b11ea63378065db42105882b5. --- src/smpi/internals/smpi_global.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 2169f674a0..6ad37cd56e 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -53,6 +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 +#endif + #if HAVE_PAPI #include "papi.h" std::string papi_default_config_name = "default"; @@ -603,7 +611,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); + void* handle = dlopen(target_executable.c_str(), RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND); int saved_errno = errno; if (simgrid::config::get_value("smpi/keep-temps") == false) { unlink(target_executable.c_str()); -- 2.20.1