================
@@ -899,6 +899,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, 
QualType RetTy,
   if (CodeGenOpts.PointerAuth.IndirectGotos)
     Fn->addFnAttr("ptrauth-indirect-gotos");
 
+  // Add return control flow integrity attributes.
+  if (CodeGenOpts.CFProtectionReturn)
+    Fn->addFnAttr("hw-shadow-stack");
+
----------------
mylai-mtk wrote:

This feel a bit weird: I thought using `-fcf-protection=return` to select 
hardware-based shadow stack is a RISC-V specific thing. Perhaps for now this 
should look more tailored for RISC-V to avoid misleading?

https://github.com/llvm/llvm-project/pull/112477
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to