[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

Ming-Yi Lai via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 20:57:04 PDT 2024


mylai-mtk wrote:

> It is useful to protect a binary with an -mcpu that doesn't support Zicfilp. 

Generally I would agree that it's a good idea to protect a binary with an `-mcpu` that doesn't support Zicfilp, but to lift the check of Zicfilp would be misleading to naive compiler/RISC-V users who don't know that only with a system fully aware of Zicfilp, the protection of `-fcf-protection=branch` can be expected. I think from this perspective, compilers should at least warn the user if he asks for a feature that is known to be broken with his environment.

@kito-cheng I need your input on this, since this would require a few updates on various PRs to the RISC-V specs.

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


More information about the cfe-commits mailing list