https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128091
Bug ID: 128091
Summary: Enable -fasynchronous-unwind-tables by default on
sparc64 Linux
Product: gcc
Version: 16.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: stian at itx dot no
Target Milestone: ---
Target: sparc64-unknown-linux-gnu
Created attachment 65925
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65925&action=edit
backtrace-depth.c
On sparc64 Linux GCC doesn't emit unwind tables by default, so glibc's
backtrace() (which uses the libgcc unwinder) only gets one frame for
normally built code. Ran into it with Python 3.15's test_c_stack_unwind.
With the attached test on a SPARC T4-1 (GCC 16.2.1, glibc 2.44):
gcc -O2 backtrace-depth.c -> 1 frame
gcc -O2 -fasynchronous-unwind-tables backtrace-depth.c -> 8 frames
x86_64, aarch64, s390x, ppc64 and riscv Linux all default to
-fasynchronous-unwind-tables.
Could sparc64 Linux do the same, like riscv did in 3cd08f7168c1?
Happy to send and test a patch for it.