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

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 12:03:08 PDT 2024


topperc wrote:

I think maybe we should separate -fcf-protection=branch from the Zicfilp extension being in -march/-mcpu both in the frontend and backend. The encoding for lpad does not require Zicfilp. Only the assembly processing of the "lpad" mnemonic does. Even that we could change.

It is useful to protect a binary with an -mcpu that doesn't support Zicfilp. That would make the binary future proof to a CPU that does support it. This is what is done on X86, the CET extension is not a requirement for ENDBR32/ENDBR64 to be inserted, only that the CPU supports multibyte NOPs.

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


More information about the cfe-commits mailing list