Differences From Artifact [c6b89e288b]:
- File
configure.ac
— part of check-in
[a889f21180]
at
2013-05-22 20:36:31
on branch trunk
— Don't depened on execinfo.h for backtraces.
Instead, __builtin_return_address() is used now. This makes backtraces
available on many platforms, it even works if dladdr is missing (it does
not show symbol names then, though). (user: js, size: 22738) [annotate] [blame] [check-ins using]
To Artifact [fe25322d35]:
- File
configure.ac
— part of check-in
[f2a8bdf254]
at
2013-05-25 11:40:28
on branch trunk
— Switch back to backtrace().
The reason is that __builtin_frame_address(n) for n > 0 seems to just
crash on most platforms when -fomit-stack-pointer is specified, which
seems to be the default for many platforms on -O2. The documentation
says that __builtin_frame_address() should return NULL in case it can't
get the frame, but it seems to crash instead.Therefore, this commit reverts to using backtrace() from execinfo.h, if
available. However, as __builtin_frame_address() seems to always work on
PPC (even with -fomit-frame-pointer) and seems to be the only way to get
a backtrace on the Wii, this is still used if backtrace() is unavailable
and __ppc__ defined. (user: js, size: 23054) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
747 748 749 750 751 752 753 | ;; esac AS_IF([test x"$have_processes" = x"yes"], [ AC_SUBST(OFPROCESS_M, "OFProcess.m") AC_DEFINE(OF_HAVE_PROCESSES, 1, [Whether we have processes]) ]) | > | | | | | | | | | > > > > > > > > > > > | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 | ;; esac AS_IF([test x"$have_processes" = x"yes"], [ AC_SUBST(OFPROCESS_M, "OFProcess.m") AC_DEFINE(OF_HAVE_PROCESSES, 1, [Whether we have processes]) ]) AC_DEFUN([CHECK_BUILTIN_RETURN_ADDRESS], [ AC_MSG_CHECKING(for __builtin_return_address) AC_TRY_LINK([], [ __builtin_return_address(1); ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_BUILTIN_RETURN_ADDRESS, 1, [Whether we have __builtin_return_address]) ], [ AC_MSG_RESULT(no) ]) ]) AC_CHECK_HEADER(execinfo.h, [ AC_DEFINE(HAVE_EXECINFO_H, 1, [Whether we have execinfo.h]) AC_CHECK_FUNC(backtrace, [ AC_DEFINE(HAVE_BACKTRACE, 1, [Whether we have backtrace()]) ], [ CHECK_BUILTIN_RETURN_ADDRESS ]) ], [ CHECK_BUILTIN_RETURN_ADDRESS ]) AS_IF([test x"$objc_runtime" = x"Apple runtime"], [ AC_CHECK_HEADER(Foundation/NSObject.h, [ AC_SUBST(FOUNDATION_COMPAT_M, "foundation-compat.m") AC_SUBST(BRIDGE, "bridge") |
︙ | ︙ |