File tree Expand file tree Collapse file tree 5 files changed +45
-4
lines changed Expand file tree Collapse file tree 5 files changed +45
-4
lines changed Original file line number Diff line number Diff line change @@ -53,4 +53,26 @@ AC_DEFUN([ORTE_SETUP_DEBUGGER_FLAGS],[
5353
5454 AC_SUBST(CFLAGS_WITHOUT_OPTFLAGS)
5555 AC_SUBST(DEBUGGER_CFLAGS)
56+
57+ # Check for compiler specific flag to add in unwind information.
58+ # This is needed when attaching using MPIR to unwind back to the
59+ # user's main function. Certain optimisations can prevent GDB from
60+ # producing a stack when explicit unwind information is unavailable.
61+ # This is implied by -g, but we want to save space and don't need
62+ # full debug symbols.
63+ if test " x$opal_cv_c_compiler_vendor " = " xibm" ; then
64+ MPIR_UNWIND_CFLAGS=" -g"
65+ elif test " x$opal_cv_c_compiler_vendor " = " xgnu" ; then
66+ MPIR_UNWIND_CFLAGS=" -fasynchronous-unwind-tables"
67+ elif test " x$opal_cv_c_compiler_vendor " = " xintel" ; then
68+ MPIR_UNWIND_CFLAGS=" -fasynchronous-unwind-tables"
69+ elif test " x$opal_cv_c_compiler_vendor " = " xportland group" ; then
70+ MPIR_UNWIND_CFLAGS=" -Meh_frame -Mframe"
71+ else
72+ MPIR_UNWIND_CFLAGS=
73+ fi
74+
75+ AC_MSG_CHECKING([for MPIR unwind info flags])
76+ AC_MSG_RESULT([$MPIR_UNWIND_CFLAGS ])
77+ AC_SUBST(MPIR_UNWIND_CFLAGS)
5678])
Original file line number Diff line number Diff line change @@ -32,9 +32,18 @@ headers += \
3232lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
3333 runtime/ompi_mpi_abort.c \
3434 runtime/ompi_mpi_dynamics.c \
35- runtime/ompi_mpi_init.c \
3635 runtime/ompi_mpi_finalize.c \
3736 runtime/ompi_mpi_params.c \
3837 runtime/ompi_mpi_preconnect.c \
3938 runtime/ompi_cr.c \
4039 runtime/ompi_info_support.c
40+
41+ # The MPIR portion of the library must be built with flags to
42+ # enable stepping out of MPI_INIT into main.
43+ # Use an intermediate library to isolate the debug object.
44+ noinst_LTLIBRARIES += libompi_mpir.la
45+ libompi_mpir_la_SOURCES = \
46+ runtime/ompi_mpi_init.c
47+ libompi_mpir_la_CFLAGS = $(MPIR_UNWIND_CFLAGS )
48+
49+ lib@OMPI_LIBMPI_NAME@_la_LIBADD += libompi_mpir.la
Original file line number Diff line number Diff line change 1717# $HEADER$
1818#
1919
20- AM_CPPFLAGS = $(LTDLINCL )
20+ # Add unwind flags because all of the files in this tree are
21+ # involved in startup.
22+ AM_CPPFLAGS = $(LTDLINCL ) $(MPIR_UNWIND_CFLAGS )
2123
2224# main library setup
2325noinst_LTLIBRARIES = libmca_ess.la
Original file line number Diff line number Diff line change 1111# $HEADER$
1212#
1313
14- AM_CPPFLAGS = $(ess_pmi_CPPFLAGS )
14+ AM_CPPFLAGS = $(ess_pmi_CPPFLAGS ) $( MPIR_UNWIND_CFLAGS )
1515
1616sources = \
1717 ess_pmi.h \
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ headers += \
3838
3939lib@ORTE_LIB_PREFIX@open_rte_la_SOURCES += \
4040 runtime/orte_finalize.c \
41- runtime/orte_init.c \
4241 runtime/orte_locks.c \
4342 runtime/orte_globals.c \
4443 runtime/orte_quit.c \
@@ -52,3 +51,12 @@ lib@ORTE_LIB_PREFIX@open_rte_la_SOURCES += \
5251 runtime/orte_cr.c \
5352 runtime/orte_data_server.c \
5453 runtime/orte_info_support.c
54+
55+ # The MPIR portion of the library must be built with flags to
56+ # enable stepping out of MPI_INIT into main.
57+ # Use an intermediate library to isolate the debug object.
58+ noinst_LTLIBRARIES += libruntime_mpir.la
59+ libruntime_mpir_la_SOURCES = \
60+ runtime/orte_init.c
61+ libruntime_mpir_la_CFLAGS = $(MPIR_UNWIND_CFLAGS )
62+ lib@ORTE_LIB_PREFIX@open_rte_la_LIBADD += libruntime_mpir.la
You can’t perform that action at this time.
0 commit comments