We've supported libbacktrace as an optional dependency on Windows for a
while now. At the same time, our backtrace implementation on Linux is
very inefficient.
Optionally use libbacktrace on Linux too, when requested at configure
time. This is much less code and much faster at runtime, but we retain
the old implementation as well for the time being so that we are not
adding an additional mandatory dependency.
Currently the LIBBACKTRACE option is off by default because installing
libbacktrace is surprisingly difficult to do; most distros do not
package it. It would be nice to enable it at least for the release
builds so that end users on Linux get faster backtraces. That should be
possible but I'm not attempting it yet.
Using libbacktrace without debug info is useless, so enabling
LIBBACKTRACE forces -g1 even on release builds in the Makefile.