CPP usage in GHC.

Carter Schonwald carter.schonwald at gmail.com
Sun Aug 10 23:27:28 UTC 2014

I could be wrong, but I think assembler-with-cpp came up only as part of
certain clang work arounds,
it should suffice to use any GCC like  traditional mode CPP (like the CPPHS

note that the configure script tries to detect what the CPP program you
specify using --with-hs-cpp IS, and it only has logic for modern
GCC/Clang/CPPHS, so you should specify a suitable set of flags if you're
picking something different (theres a flag like --with-hs-cpp-flags you can
set explicitly)

On Sun, Aug 10, 2014 at 5:06 PM, Karel Gardas <karel.gardas at centrum.cz>

> Folks,
> in my attempt to lower number of failing tests on Solaris I've found
> several tests which fail on just difference in file name report. My ghc
> reports warning/error in /tmp/ghc<something>/<some different thing> while
> expected is clear T<something>.hs.
> See http://haskell.inf.elte.hu/builders/solaris-x86-head/125/21.html and
> search for T7145b as an example of this behavior.
> The reason why this happen is that Solaris GNU C 4.x does not emit line
> markers in preprocessed file when it's preprocessed with -x
> assembler-with-cpp. The reason behind this is documented in this thread[1]
> on GCC mailing list. Simply speaking Sun's assembler in the past chokes on
> some linemarkers generated. This was apparently case of as on older Solaris
> then 10 version and perhaps this will be fixed in future major GCC release
> as Solaris 9 is not supported anymore. Anyway, we still do have a case with
> GNU C compilers provided by Solaris 10 and Solaris 11. FYI: Solaris' 10 GNU
> C 3.4.x is OK, Solaris 11's GNU C 4.5.2 is broken and with this all more
> modern 4.x releases so probably also all 4.x release provided by Solaris
> 11.1/11.2.
> So far I've solved the issue of those failing tests by passing
> --with-hs-cpp=/usr/sfw/bin/gcc -- so configured this way GHC will use old
> not-buggy GNU C 3.4.x on my Solaris 11 builder as CPP and otherwise it'll
> use /usr/bin/gcc (GNU C 4.5.2) and everything will pass fine hopefully.
> Anyway, the thread[1] also contains a question which also rings in my head
> and that is: why we use -x assembler-with-cpp at all? Isn't simple -E
> enough. Or isn't simple usage of system provided CPP enough /usr/lib/cpp on
> Solaris)? Or what will happen if we for example change -x
> assembler-with-cpp to -x c or -x c-header or something like that? Please
> note that the testcase is OK with -x c/c-header even using this "buggy" GNU
> C 4.5.2 since the compiler/cpp is really buggy just for the case of -x
> assembler-with-cpp.
> Thanks!
> Karel
> [1]: https://gcc.gnu.org/ml/gcc/2014-08/msg00114.html
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140810/b6ff8437/attachment.html>

More information about the ghc-devs mailing list