From ace7d7adce61bca18464b563e880152b9eaffc35 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Sat, 26 Mar 2016 11:41:05 -0600 Subject: [PATCH] opal: disable code patcher if --disable-dlopen Signed-off-by: Nathan Hjelm --- config/opal_configure_options.m4 | 3 ++- opal/util/opal_patcher.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/opal_configure_options.m4 b/config/opal_configure_options.m4 index ce06b9edd25..06619dcee6b 100644 --- a/config/opal_configure_options.m4 +++ b/config/opal_configure_options.m4 @@ -283,7 +283,8 @@ else OPAL_ENABLE_DLOPEN_SUPPORT=1 AC_MSG_RESULT([yes]) fi - +AC_DEFINE_UNQUOTED(OPAL_ENABLE_DLOPEN_SUPPORT, $OPAL_ENABLE_DLOPEN_SUPPORT, + [Whether we want to enable dlopen support]) # # Heterogeneous support diff --git a/opal/util/opal_patcher.c b/opal/util/opal_patcher.c index d40ceb065f3..fef15b70c42 100644 --- a/opal/util/opal_patcher.c +++ b/opal/util/opal_patcher.c @@ -25,7 +25,7 @@ #include #include -#if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) +#if OPAL_ENABLE_DLOPEN_SUPPORT && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__)) static void flush_and_invalidate_cache (unsigned long a) { @@ -202,7 +202,7 @@ bool opal_patch_supported (void) /* end of #if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) */ // ------------------------------------------------- PPC equivalent: -#elif defined(__PPC__) +#elif OPAL_ENABLE_DLOPEN_SUPPORT && defined(__PPC__) static inline uintptr_t addr_text (uintptr_t addr) { #if (defined(__PPC64__) || defined(__powerpc64__) || defined(__PPC__)) && _CALL_ELF != 2