Skip to content

Prevent -optc arguments from being duplicated in reverse order (#17471)

Ryan Scott requested to merge wip/T17471 into master

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 (closed).

Merge request reports