Skip to content
  • Ryan Scott's avatar
    Prevent -optc arguments from being duplicated in reverse order (#17471) · 4156b877
    Ryan Scott authored
    This reverts a part of commit
    7bc5d6c6 that causes all arguments
    to `-optc` (and `-optcxx`) to be passed twice to the C/C++ compiler,
    once in reverse order and then again in the correct order. While
    passing duplicate arguments is usually harmless it can cause breakage
    in this pattern, which is employed by Hackage libraries in the wild:
    
    ```
    ghc Foo.hs foo.c -optc-D -optcFOO
    ```
    
    As `FOO -D -D FOO` will cause compilers to error.
    
    Fixes #17471.
    
    (cherry picked from commit 9a896a55)
    4156b877