Skip to content

Preprocessor issues building GHC HEAD on Mavericks

I can't build GHC HEAD on Mavericks with Xcode 5 and GCC 4.2.

My system:

  • Mavericks, Xcode 5.
  • Building with GHC 7.6.3 x64 installed from .
  • Apple GCC 4.2 installed via homebrew.

In /Library/Frameworks/GHC.framework/Versions/7.6.3-x86_64/usr/lib/ghc-7.6.3/settings, I've changed the compiled to this:

("C compiler command", "/Users/nkpart/bin/gcc"),

~/bin/gcc is

{{{ #!/bin/sh echo $* >> ~/bin/gcc_log gcc-4.2 $@ }}}

I have run:

$ git clone ..
$ perl boot
$ ./configure
$ make

The error I get is:

"/usr/bin/ghc" -M -static  -H64m -O0 -fasm  -package-db libraries/bootstrapping.conf   -i -iutils/genprimopcode/. -iutils/genprimopcode/dist/build -iutils/genprimopcode/dist/build/autogen -Iutils/genprimopcode/dist/build -Iutils/genprimopcode/dist/build/autogen       -package array  -no-user-package-db -rtsopts      -odir utils/genprimopcode/dist/build -hidir utils/genprimopcode/dist/build -stubdir utils/genprimopcode/dist/build -dep-makefile utils/genprimopcode/dist/build/.depend.haskell.tmp -dep-suffix "" -include-pkg-deps  utils/genprimopcode/dist/build/Lexer.hs  utils/genprimopcode/./Main.hs  utils/genprimopcode/./ParserM.hs  utils/genprimopcode/dist/build/Parser.hs  utils/genprimopcode/./Syntax.hs
line-map.c: file "templates/GenericTemplate.hs" left but not entered

utils/genprimopcode/dist/build/Lexer.hs:143:0:
     error: #else without #if

utils/genprimopcode/dist/build/Lexer.hs:144:0:
     warning: "GTE" redefined

utils/genprimopcode/dist/build/Lexer.hs:141:0:
     warning: this is the location of the previous definition

utils/genprimopcode/dist/build/Lexer.hs:145:0:
     warning: "EQ" redefined

utils/genprimopcode/dist/build/Lexer.hs:142:0:
     warning: this is the location of the previous definition

utils/genprimopcode/dist/build/Lexer.hs:146:0:
     error: #endif without #if

utils/genprimopcode/dist/build/Lexer.hs:197:0:
     error: #else without #if

utils/genprimopcode/dist/build/Lexer.hs:200:0:
     error: #endif without #if
make[1]: *** [utils/genprimopcode/dist/build/.depend.haskell] Error 1
make: *** [all] Error 2
Edited by Herbert Valerio Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information