Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,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).
Expand Down
27 changes: 19 additions & 8 deletions config/opal_setup_wrappers.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. Can you please double check this in the context of the rest of the configure script?

Specifically: $runpath_args is used later down in the code, but you've now only assigned it if --disable-wrapper-runpath was not specified.

Are the wrappers the only place that runpath is used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm looks like we may need some other commits from master, I'm surprised the cherry-pick worked without a problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually runpath_args is initialized empty at line 234. the variable is used at line 315. The admin wanting the patch on 3.0.x noticed an issue with the fortran wrappers not obeying the --enable/disable-runpath, but I'll fix that in a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wrong. the patch looks correct. see comments on the file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I see it's initialized in 234. But it's used down below. My question is: are there any other places we use runpath besides the wrappers? Because if so, this patch is disabling runpath everywhere, not just for the wrappers.

If we're only using runpath for the wrappers, then this patch is likely fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like it. buildrpm.sh does add --enable-new-dtags to LDFLAGS passed into configure for the spec file. Looks like this change has been in master for almost 2 years now.

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