[PATCH] D154911: Enabling fstack_clash_protection for arm32 bit, thumb and thumb2 mode
    Tamar Christina via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Jul 26 10:27:19 PDT 2023
    
    
  
tnfchris added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3460
+  } else if (EffectiveTriple.isArm() || EffectiveTriple.isThumb()) {
+    CmdArgs.push_back("-mstack-probe-size=1024");
+  }
----------------
efriedma wrote:
> Why 1024?
1024 was experimentally determined by Arm and is part of the ABI for stack clash (which has not yet been published).  It was determined by examining a large number of programs and looking at the function stack usages.  1024 covers 80-90% of programs such that we can minimize the number of probes required in the average cases. 
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154911/new/
https://reviews.llvm.org/D154911
    
    
More information about the cfe-commits
mailing list