From ebb30c15f2a3808a51c94bf7e0f382ba096ade2f Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Thu, 20 Apr 2017 11:45:47 -0500 Subject: [PATCH] configury: add option to disable enable-new-dtags The --enable-new-dtags option for the compiler wrappers is often great, but for some particular install/usage scenarios causes issues. This commit provides a new configury option to use of rpath in the compiler wrappers, but disables the use of --enable-new-dtags in the link line. The new configury option is --enable-wrappers-runpath To disable use of --enable-new-dtags in the wrappers, add --disable-wrappers-runpath to the Open MPI configury line. Fixes #1089 Signed-off-by: Howard Pritchard --- README | 4 ++++ config/opal_setup_wrappers.m4 | 27 +++++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README b/README index fb7405036a..7cd90c1117 100644 --- a/README +++ b/README @@ -796,6 +796,10 @@ INSTALLATION OPTIONS This rpath/runpath behavior can be disabled via --disable-wrapper-rpath. + If you would like to keep the rpath option, but not enable runpath + a different configure option is avalabile + --disable-wrapper-runpath. + --enable-dlopen Build all of Open MPI's components as standalone Dynamic Shared Objects (DSO's) that are loaded at run-time (this is the default). diff --git a/config/opal_setup_wrappers.m4 b/config/opal_setup_wrappers.m4 index 6c3300856f..16c4859145 100644 --- a/config/opal_setup_wrappers.m4 +++ b/config/opal_setup_wrappers.m4 @@ -130,6 +130,16 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_INIT],[ [enable rpath/runpath support in the wrapper compilers (default=yes)])]) AS_IF([test "$enable_wrapper_rpath" != "no"], [enable_wrapper_rpath=yes]) AC_MSG_RESULT([$enable_wrapper_rpath]) + + AC_MSG_CHECKING([if want wrapper compiler runpath support]) + AC_ARG_ENABLE([wrapper-runpath], + [AS_HELP_STRING([--enable--wrapper-runpath], + [enable runpath in the wrapper compilers if linker supports it (default: enabled, unless wrapper-rpath is disabled).])]) + AS_IF([test "$enable_wrapper_runpath" != "no"], [enable_wrapper_runpath=yes]) + AC_MSG_RESULT([$enable_wrapper_runpath]) + + AS_IF([test "$enable_wrapper_rpath" = "no" && test "$enable_wrapper_runpath" = "yes"], + [AC_MSG_ERROR([--enable-wrapper-runpath cannot be selected with --disable-wrapper-rpath])]) ]) # Check to see whether the linker supports DT_RPATH. We'll need to @@ -220,18 +230,19 @@ EOF AC_DEFUN([OPAL_SETUP_RUNPATH],[ OPAL_VAR_SCOPE_PUSH([LDFLAGS_save rpath_script rpath_outfile wl_fc]) - AC_MSG_CHECKING([if linker supports RUNPATH]) # Set the output in $runpath_args runpath_args= LDFLAGS_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags" - AC_LANG_PUSH([C]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 7;])], - [WRAPPER_RPATH_SUPPORT=runpath - runpath_args="-Wl,--enable-new-dtags" - AC_MSG_RESULT([yes (-Wl,--enable-new-dtags)])], - [AC_MSG_RESULT([no])]) - AC_LANG_POP([C]) + AS_IF([test x"$enable_wrapper_runpath" = x"yes"], + [AC_LANG_PUSH([C]) + AC_MSG_CHECKING([if linker supports RUNPATH]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 7;])], + [WRAPPER_RPATH_SUPPORT=runpath + runpath_args="-Wl,--enable-new-dtags" + AC_MSG_RESULT([yes (-Wl,--enable-new-dtags)])], + [AC_MSG_RESULT([no])]) + AC_LANG_POP([C])]) m4_ifdef([project_ompi],[ # Output goes into globally-visible $rpath_args. Run this in a # sub-process so that we don't pollute the current process