Skip to content

Commit

Permalink
configury: add option to disable enable-new-dtags
Browse files Browse the repository at this point in the history
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 all for
use of rpath in the compiler wrappers, but disables the
use of --enable-new-dtags in the link line.

Fixes open-mpi#1089

Signed-off-by: Howard Pritchard <[email protected]>
  • Loading branch information
hppritcha committed Apr 20, 2017
1 parent 3f5a1dc commit 415d352
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions config/opal_setup_wrappers.m4
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ 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_ARG_ENABLE([new-dtags],
[AS_HELP_STRING([--enable-new-dtags],
[enable new-dtags in the wrapper compilers if linker supports it (default=yes)])])
AS_IF([test "$enable_new_dtags" != "no"], [enable_new_dtags=yes])
AC_MSG_RESULT([$enable_new_dtags])
])

# Check to see whether the linker supports DT_RPATH. We'll need to
Expand Down Expand Up @@ -205,9 +211,9 @@ EOF

OPAL_VAR_SCOPE_POP

# If we found RPATH support, check for RUNPATH support, too
AS_IF([test "$WRAPPER_RPATH_SUPPORT" = "rpath"],
[OPAL_SETUP_RUNPATH])
# If we found RPATH support, check for RUNPATH support, too
AS_IF([test "$WRAPPER_RPATH_SUPPORT" = "rpath"],
[OPAL_SETUP_RUNPATH])
])

# Check to see if the linker supports the DT_RUNPATH flags via
Expand All @@ -220,18 +226,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_new_dtags" = 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
Expand Down

0 comments on commit 415d352

Please sign in to comment.