[clang] [llvm] [SystemZ] Global Stackprotector and associated location section (PR #169317)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 4 08:24:19 PST 2026


================
@@ -1194,6 +1194,14 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
     }
   }
 
+  if (CGM.getCodeGenOpts().StackProtectorGuardRecord) {
+    if (CGM.getCodeGenOpts().StackProtectorGuard != "global")
+      CGM.getDiags().Report(diag::err_opt_not_valid_without_opt)
+          << "-mstack-protector-guard-record"
+          << "-mstack-protector-guard=global";
+    Fn->addFnAttr("mstackprotector-guard-record");
----------------
uweigand wrote:

It needs to be available under `m` prefix for GCC compatibility.   Whether it should *also* be available under an `f` prefix is a separate discussion, that's more a question of whether other targets might likely also want it.  In any case, that could still be added later if needed.

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


More information about the llvm-commits mailing list