[clang] [Clang][AArch64] Command-line options for A-profile's Sign Return Address Hardening (PR #176171)

Victor Campos via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 06:59:32 PDT 2026


vhscampos wrote:

@atrosinenko Thank you for the writeup. The "discussion upstream" I referred to is actually this PR right here, anticipating any doubts about the naming scheme.

I take all the points you raised, and I believe there is no perfect solution for a command-line option. We did have some internal discussions and the preference was slightly towards a new `-m` option because:
1. Some distros may have a preset `-mbranch-protection` flag for builds, and adding a new flag to CFLAGS is a lower obstacle than to modify an existing flag.
2. A new flag makes the naming easier.

Expanding on (2), if we flattened the option into `-mbranch-protection`, the modifier `+harden-pac-ret-load-return-address` is a mouthful. We were also dubious about copyright implications of using the name "pacman", therefore `+pacman-load` may be problematic. On the other hand, implementation-wise, a flattened option is quite a lot simpler and frankly preferable IMO.

I'd love to read your (everyone) thoughts.

https://github.com/llvm/llvm-project/pull/176171


More information about the cfe-commits mailing list