This is an archive of the discontinued LLVM Phabricator instance.

[clang][RISCV] Enable -fasynchronous-unwind-tables by default on Linux
ClosedPublic

Authored by kito-cheng on Mar 2 2023, 7:33 AM.

Details

Summary

This could improve user experience for stack unwinding, and also this is
enabled by default by X86 and AArch64 and RISC-V GCC.

Diff Detail

Event Timeline

kito-cheng created this revision.Mar 2 2023, 7:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2023, 7:33 AM
kito-cheng requested review of this revision.Mar 2 2023, 7:33 AM
MaskRay accepted this revision.Mar 2 2023, 11:18 AM

LG since GCC made a similar change and this matches several major architectures on Linux/other ELF based operating systems.

(At heart I think -fasynchronous-unwind-tables is not a good default. I agree with https://blogs.gnome.org/chergert/2022/12/31/frame-pointers-and-other-practical-near-term-solutions/ which has said:
"Again, I don’t think any of us like frame pointers, just that they are generally lower effort today while also being reasonably reliable.")

This revision is now accepted and ready to land.Mar 2 2023, 11:18 AM
luismarques accepted this revision.Mar 2 2023, 2:26 PM
asb added a subscriber: jobnoorman.Mar 6 2023, 6:11 AM

Funnily enough, @jobnoorman and I were just discussion something related to this, how -fexceptions doesn't seem to enable unwind tables as you'd expect. This change hides that issue in the common case you're targeting Linux, but I've filed https://github.com/llvm/llvm-project/issues/61216 to track it. Just thought I'd advertise here because reviewers of this patch have likely looked through these code paths recently and might have a view on this bug.