Skip to content

[BOLT][PAC] PAuth DWARF rewriting does not work with synchronous unwind tables #165215

@bgergely0

Description

@bgergely0

With clang the -fno-asynchronous-unwind-tables flag select synchronous mode for unwinding.

In this mode, the unwind information is not "complete" for all instructions, only for calls.

The sign-return-address-cfi-negate-ra-state.ll unittests in LLVM has a function with async unwind tables, and one with synchronous unwind tables. In the synchronous case, the autiasp (hint 29) does not have the .cfi_negate_ra_state CFI.

In BOLT, we expect all pac* and aut* variants that operate on the LR to have the appropriate unwind information (the negate-ra-state CFI), otherwise the function is ignored (not optimized).

Example: when applying BOLT to llama.cpp, this is seen in the logs: Ignored 1633 functions (99.03%) because of CFI inconsistencies. The huge % of ignored functions makes BOLT useless in such cases.


Expected behaviour:

  • at minimum, the requirement of asynchronous unwind tables should be documented, and reported to users if we encounter a given % of such issues during optimization
  • ideally, we should also enable optimizing such functions.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions