Regression starting GHC 8.8: `-optP` preprocessor options passed to C compiler
Lifted from https://github.com/haskell/cabal/issues/8058:
In the wild (macOS, with cpp-11
installed):
cabal install -w ghc-8.6.5 fudgets-0.18.3.1
(Works.)
cabal-3.7 install -w ghc-8.8.4 fudgets-0.18.3.1
(Fails, with cabal-install-3.7
from master
.)
Starting with GHC 8.8, option -optP -traditional
is passed to the C compiler, not just the preprocessor:
On macOS (test by @phadej):
touch foo.c
ghc -optP -traditional -v3 -c -o foo.o foo.c
This works up to GHC 8.6, e.g.
*** C Compiler:
gcc ... -x c foo.c ...
But it breaks from GHC 8.8 upward, e.g.:
** C Compiler:
gcc -x c foo.c ... -Xpreprocessor -traditional
error: unknown argument: '-traditional'
Related: #17185 (closed)