File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,28 @@ this to the OpenCoarrays developers by filing a new issue at:
204204https://github.com/sourceryinstitute/OpenCoarrays/issues/new" )
205205endif ()
206206
207+ #-----------------------------------------------
208+ # Work around bug #317 present on fedora systems
209+ #-----------------------------------------------
210+ if ( (MPI_C_LINK_FLAGS MATCHES "noexecstack" ) OR (MPI_Fortran_LINK_FLAGS MATCHES "noexecstack" ) )
211+ message ( WARNING
212+ "The `noexecstack` linker flag was found in the MPI_<lang>_LINK_FLAGS variable. This is
213+ known to cause segmentation faults for some Fortran codes. See, e.g.,
214+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729 or
215+ https://github.com/sourceryinstitute/OpenCoarrays/issues/317.
216+
217+ `noexecstack` is being replaced with `execstack`"
218+ )
219+ string (REPLACE "noexecstack"
220+ "execstack" MPI_C_LINK_FLAGS_FIXED ${MPI_C_LINK_FLAGS} )
221+ string (REPLACE "noexecstack"
222+ "execstack" MPI_Fortran_LINK_FLAGS_FIXED ${MPI_Fortran_LINK_FLAGS} )
223+ set (MPI_C_LINK_FLAGS "${MPI_C_LINK_FLAGS_FIXED} " CACHE STRING
224+ "MPI C linking flags" FORCE)
225+ set (MPI_Fortran_LINK_FLAGS "${MPI_Fortran_LINK_FLAGS_FIXED} " CACHE STRING
226+ "MPI Fortran linking flags" FORCE)
227+ endif ()
228+
207229#--------------------------------------------------------
208230# Make sure a simple "hello world" C mpi program compiles
209231#--------------------------------------------------------
You can’t perform that action at this time.
0 commit comments