From: Ylimaki Rami (EXT-Vincit/Tampere) <[email protected]> There are two noreturn functions in the X server: FatalError and AbortServer. Having any of those two functions in the middle of a call stack will prevent unwinding the program properly and stops the backtrace at those functions in gdb.
The file containing FatalError and AbortServer, os/log.c, has to be compiled with the -mapcs-frame option on ARM to get proper backtraces. Automake imposes its own restrictions on compiling individual source files with different options. The recommended way to do this is to put os/log.c into a convenience library and add this library inside os/libos.la. See the documentation of GNU Automake manual, version 1.11.1, section 27.8 Per-Object Flags Emulation, for details. Signed-off-by: Rami Ylimaki <[email protected]> --- configure.ac | 3 +++ os/Makefile.am | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index b9c7574..acedf74 100644 --- a/configure.ac +++ b/configure.ac @@ -315,6 +315,9 @@ AC_CHECK_HEADER([execinfo.h],[ ])] ) +dnl arm needs additional compiler flags for proper backtraces +AM_CONDITIONAL(ARM_BACKTRACE, [test "x$build_cpu" = xarm]) + dnl --------------------------------------------------------------------------- dnl Bus options and CPU capabilities. Replaces logic in dnl hw/xfree86/os-support/bus/Makefile.am, among others. diff --git a/os/Makefile.am b/os/Makefile.am index 66a4a0f..61d2179 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -5,7 +5,22 @@ AM_CFLAGS = $(DIX_CFLAGS) $(SHA1_CFLAGS) SECURERPC_SRCS = rpcauth.c XDMCP_SRCS = xdmcp.c STRLCAT_SRCS = strlcat.c strlcpy.c + +if ARM_BACKTRACE +XORG_SRCS = +# Build a convenience library liblog.la that will be added into +# libos.la. The split is done so that log.c can be built with +# different compiler options. +noinst_LTLIBRARIES += liblog.la +libos_la_LIBADD = liblog.la +liblog_la_SOURCES = log.c +# Add flags needed for proper backtraces of functions marked with GCC +# __attribute__((noreturn)). Currently those flags are needed for +# FatalError and AbortServer in log.c. +liblog_la_CFLAGS = $(AM_CFLAGS) -mapcs-frame +else XORG_SRCS = log.c +endif libos_la_SOURCES = \ WaitFor.c \ -- 1.6.1 _______________________________________________ xorg-devel mailing list [email protected] http://lists.x.org/mailman/listinfo/xorg-devel
