Skip to content

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Oct 9, 2025

It's kind of remarkable how many terrible things we have to live with today can be traced back to GCC.

This fixes leaf function unwinding, presumably among other things.

@mlugg
Copy link
Member

mlugg commented Oct 10, 2025

This seems wrong: the has_return_address check is important! An explicit DW_CFA_undefined on the return address register tells us to end the trace. I'm... honestly not sure how CI is even passing here?

…ll columns

This fixes leaf function unwinding, presumably among other things.
@alexrp
Copy link
Member Author

alexrp commented Oct 10, 2025

This seems wrong: the has_return_address check is important! An explicit DW_CFA_undefined on the return address register tells us to end the trace.

Oops, good point.

I'm... honestly not sure how CI is even passing here?

Most libc startup code and thread entry points explicitly zero the link register; some ABIs even require them to do so. We do this for all targets in Zig code and in our bundled musl. glibc startup code mostly does it too, although it's pretty inconsistent from arch to arch. Can't speak for macOS libc though.

@alexrp alexrp enabled auto-merge (rebase) October 10, 2025 11:05
@alexrp alexrp merged commit 9aeabad into ziglang:master Oct 10, 2025
9 checks passed
@alexrp alexrp deleted the gcc-kinda-sucks branch October 10, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants