From faf627de0987edd38fde267af03b13e9f49123f5 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 (cherry picked from commit ebb30c15f2a3808a51c94bf7e0f382ba096ade2f) --- config/opal_setup_wrappers.m4 | 39 ++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/config/opal_setup_wrappers.m4 b/config/opal_setup_wrappers.m4 index 6a3be1fc80b..73c16fc36b8 100644 --- a/config/opal_setup_wrappers.m4 +++ b/config/opal_setup_wrappers.m4 @@ -227,12 +227,41 @@ AC_DEFUN([OPAL_SETUP_RUNPATH],[ AC_MSG_RESULT([yes (-Wl,--enable-new-dtags)])], [AC_MSG_RESULT([no])]) AC_LANG_POP([C])]) - m4_ifdef([project_ompi],[ - OPAL_LIBTOOL_CONFIG([wl],[wl_fc],[--tag=FC],[]) +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 + # environment. + rpath_script=conftest.$$.sh + rpath_outfile=conftest.$$.out + rm -f $rpath_script $rpath_outfile + cat > $rpath_script < $rpath_outfile + +chmod +x $rpath_outfile +. ./$rpath_outfile +rm -f $rpath_outfile + +wl="\`eval echo \$wl\`" +echo \$wl + +# Done +exit 0 +EOF + chmod +x $rpath_script + wl_fc=`./$rpath_script` + rm -f $rpath_script - LDFLAGS="$LDFLAGS_save ${wl_fc}--enable-new-dtags" - AC_LANG_PUSH([Fortran]) - AC_LINK_IFELSE([AC_LANG_SOURCE([[program test + LDFLAGS="$LDFLAGS_save ${wl_fc}--enable-new-dtags" + AC_LANG_PUSH([Fortran]) + AC_LINK_IFELSE([AC_LANG_SOURCE([[program test end program]])], [runpath_fc_args="${wl_fc}--enable-new-dtags"], [runpath_fc_args=""])