FS#74782 - [gcc/gcc-libs] enable stacktrace with --enable-libstdcxx-backtrace=yes flag

Attached to Project: Arch Linux
Opened by fco (fcolecumberri) - Wednesday, 18 May 2022, 02:34 GMT
Last edited by freswa (frederik) - Saturday, 16 July 2022, 02:33 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To freswa (frederik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

stacktrace is a C++23 feature GCC already supports, but needs --enable-libstdcxx-backtrace=yes to work.
This task depends upon

Closed by  freswa (frederik)
Saturday, 16 July 2022, 02:33 GMT
Reason for closing:  Implemented
Additional comments about closing:  Committed revision 451134 to trunk. Will be part of the next gcc package.
Comment by freswa (frederik) - Wednesday, 18 May 2022, 10:03 GMT
Question is: Why isn't it enabled by default?

I guess there is a good reason for upstream to not enable it (yet)?
Comment by fco (fcolecumberri) - Wednesday, 18 May 2022, 15:39 GMT
That's a very good question, I have just looked that up and I couldn't find an official reason.

However up to what I have been able to see (maybe I am wrong), GCC implementation of the stacktrace feature is based on boost's implementation (not surprise here), but boost's implementation generates (according to their documentation https://www.boost.org/doc/libs/1_79_0/doc/html/stacktrace/configuration_and_build.html ) a dependency to libbacktrace ( https://github.com/ianlancetaylor/libbacktrace https://aur.archlinux.org/packages/libbacktrace-git ) which is already inside the GCC's source code ( https://github.com/gcc-mirror/gcc/tree/releases/gcc-12.1.0/libbacktrace ).

Maybe the reason is among all of that. Maybe the incorporation of libbacktrace is/was supposed to be temporary. I have no idea.
Comment by Neven Sajko (Neven) - Sunday, 22 May 2022, 18:45 GMT
> Maybe the incorporation of libbacktrace is/was supposed to be temporary.

AFAIK libbacktrace is an integral part of GCC and GCC is the upstream of libbacktrace.
Comment by Neven Sajko (Neven) - Sunday, 22 May 2022, 19:15 GMT
Seems that the option --enable-libstdcxx-backtrace=yes simply causes the additional static library to be built and installed, which seems like it can't have any downsides except the (presumably insignificant) storage requirements increase? (Assuming the build succeeds, that is.) I might be wrong but enabling this seems like the obvious thing to do.

https://github.com/gcc-mirror/gcc/commit/3acb929cc0beb79e6f4005eb22ee88b45e1cbc1d#diff-304a8fc076ccc48dd33f53a740ca6860dac5fafedeaa2d51aa9a17f3947b74c8R4805

https://github.com/gcc-mirror/gcc/blob/a2a7da1a055c98d9b4578151f273e0e7572aa605/libstdc%2B%2B-v3/acinclude.m4#L4904
Comment by freswa (frederik) - Sunday, 22 May 2022, 22:37 GMT
I'll look at this next weekend - will be busy this week. Seems like a reasonable thing to enable.

Loading...