On 05/05/21 12:33 +0100, Jonathan Wakely wrote:
On 24/04/21 15:46 +0200, François Dumont via Libstdc++ wrote:
Hi
Here is the patch to add backtrace generation on _GLIBCXX_DEBUG
assertions thanks to libbacktrace.
Ville pointed out that we'll need to use libbacktrace for
std::stacktrace <https://wg21.link/P0881R7> anyway, and it would be
useful if/when we add support for C++ Contracts to the lirbary.
So let's integrate libbacktrace into libstdc++ properly. Jakub
suggested doing it how libsanitizer does it, which is to rebuild the
libbacktrace sources as part of the libsanitizer build, using the
preprocessor to rename the symbols so that they use reserved names.
e.g. rename backtrace_full to __glibcxx_backtrace_full or something
like that.
I'll work on getting it building as part of libstdc++ (or maybe as a
separate static library for now, as we do for libstdc++fs.a) and then
you can rework your Debug Mode patch to depend on the private version
of libbacktrace included with libstdc++ (instead of expecting users to
provide it themselves).