http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54572

             Bug #: 54572
           Summary: Use libbacktrace library
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
                CC: j...@gcc.gnu.org


Ian has created a shiny libbacktrace libray which should be used to replace the
current implementation in libgfortran/runtime/backtrace.c, which uses 
unwinder and, if available, addr2line.

libbacktrace is installed both as host library (i.e. for backtraces of the
compiler when an ICE occurs) and as target library, to be used by "go" and
possibly other users (e.g. libgfortran).


TODO:


a) Enable the building of the target library:

--- ./gcc/fortran/config-lang.in.orig   2011-05-10 23:12:01.000000000 +0200
+++ ./gcc/fortran/config-lang.in        2012-09-13 22:06:38.000000000 +0200
@@ -30 +30 @@ compilers="f951\$(exeext)"
-target_libs=target-libgfortran
+target_libs="target-libgfortran target-libbacktrace"


b) Add --disable-target-libbacktrace to the toplevel configure to disable
libbacktrace; e.g. for our embedded users. (toplevel implies a sync with
sourceware; watch out for "go" which also uses the target library, check that
"go" is still be working without target libbacktrace.)


c) Configure check: Check whether the library is available. (See
libgfortran/acinclude.m4's LIBGFOR_CHECK_FLOAT128 for some ideas how one can
test this.)

d) Configure check 2: Check whether BACKTRACE_SUPPORTED is set to 0 (->
backtrace-supported.h), in that case, it is also pointless to build the
support.



e) Replace the current version by calls to libbacktrace.

Almost latest version of the patch:
  http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00806.html
Or wait a while and browse libbacktrace/ directly.

  * backtrace-supported.h contains BACKTRACE_USES_MALLOC
    and BACKTRACE_SUPPORTED

  * Available functions are listed in backtrace.h


[The current version of libbacktrace only handles ELF+DWARF; one could consider
keeping the other version for a while. On the other hand, I assume that other
formats will soon be supported.]

Reply via email to