Skip to content
  • Michael Snoyman's avatar
    Use a response file for linker command line arguments #10777 · 296bc70b
    Michael Snoyman authored and Ben Gamari's avatar Ben Gamari committed
    On Windows, we're constrained to 32k bytes total for command line
    arguments.  When building large projects, this limit can be exceeded.
    This patch changes GHC to always use response files for linker
    arguments, a feature first used by Microsoft compilers and added to GCC
    (over a decade ago).
    
    Alternatives here include:
    
    * Only use this method on Windows systems
    * Check the length of the command line arguments and use that to decide
      whether to use this method
    
    I did not pursue either of these, as I believe it would make the patch
    more likely to break in less tested situations.
    
    Test Plan:
    Confirm that linking still works in general. Ideally: compile a very
    large project on Windows with this patch. (I am attempting to do that
    myself now, but having trouble getting the Windows build tool chain up
    and running.)
    
    Reviewers: goldfire, hvr, rwbarton, austin, thomie, bgamari, Phyx
    
    Reviewed By: thomie, bgamari, Phyx
    
    Subscribers: erikd, awson, #ghc_windows_task_force, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1158
    
    GHC Trac Issues: #8596, #10777
    296bc70b