[compiler-rt] [llvm] [RISC-V][Zicfiss] Move shadow stack ops to save/restore builtins (PR #222850)

Jesse Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 05:12:15 PDT 2026


jaidTw wrote:

> ...
> 
> > Looks like its defined when -fcf-protection=return and Zicfiss is enabled which is wrong. We need to check Zimop
> > ```
> >   if (Opts.CFProtectionReturn && ISAInfo->hasExtension("zicfiss"))               
> >     Builder.defineMacro("__riscv_shadow_stack");                                 
> > ```
> 
> Just out of curiosity, why do we need to check for `Zimop` if `Zicfiss` already depends on it? Can a user somehow successfully specify `+zicfiss -zimop`?

We need to check `Zimop` instead of `Zicfiss`, Zimop is the minimal requirement for `-fcf-protection=return`, It used to rely on Zicfiss but we don't force that anymore.

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


More information about the llvm-commits mailing list