Skip to content
  • Tamar Christina's avatar
    Use check stacking on Windows. · 1e795a00
    Tamar Christina authored
    Summary:
    #8870 added as a temporary work around a much higher initial reserve
    and committed stack space of 2mb. This is causing problems with other windows applications.
    
    The hack was supposed to be temporary untill we could emit `__chkstk` instructions.
    But GCC can emit stack checks automatically for us if `-fstack-check` is passed.
    
    This will then emit calls to `___chkstk_ms` before stack allocations.
    
    ```
      633de0:       48 83 e0 f0             and    $0xfffffffffffffff0,%rax
      633de4:       e8 07 0c 0d 00          callq  7049f0 <___chkstk_ms>
      633de9:       48 29 c4                sub    %rax,%rsp
    ```
    
    The hack is now no longer needed.
    
    Test Plan: ./validate
    
    Reviewers: austin, erikd, awson, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D2535
    
    GHC Trac Issues: #12186
    1e795a00