Errors generating compiler/parser/Parser.hs with Happy 1.16 under mingw

Peter Tanski p.tanski at gmail.com
Thu Jul 19 16:17:28 EDT 2007


With no changes to the build system affecting Happy, I am getting  
errors from compiler/parser/Parser.hs when using the Windows binary  
of Happy 1.16.  First, there is a parse error for the CPP #include  
statement on line 6 (ghc is given the option -cpp, of course).  After  
moving the statement out of Parser.hs and onto the command line with - 
#include there are parse errors such as a do statement without a  
terminating expression (indentation error) and a parse error before a  
where clause.

I am using:
ghc-6.6.1 (Windows binary, Neil's install)
happy-1.16
gcc-3.5

Note: oddly enough, gcc-3.5 seems to emit numbered lines with gcc -E - 
u -P still.  They are of the form:
# [number]
They are not the typical line pragmas.  Anyway, I had to change the  
preprocessing statements in mk/suffix.mk and mk/package.mk from:
...
	grep -v '^#pragma GCC' ...
to
...
	grep -v '^#' ...

This should not have affected the Happy-generated Parser.hs or ghc -cpp.

On a related note, I have run out of time to work on this for the  
moment.  What is done? Practically everything except a full test and  
proper warnings for deprecated options.  For TargetPlatform i386- 
unknown-windows GHC there are:
* options and command lines using cl, link and yasm (these should work)
* changes to the makefiles and libraries (conditional compilation,  
mostly--literally hundreds of #if (defined(mingw32_HOST_OS) || defined 
(windows_HOST_OS)) and the like)
* changes to the RTS (some inline assembler), except that rts/ 
StgCRun.c works off of USE_MINIINTERPRETER because I haven't gotten  
as far as examining the assembler output from CL to redo StgRun.
If anyone is interested in the Windows-native build thus far I will  
send a patch with directions or post the directions I have so far the  
wiki.  (I didn't before because they are subject to change as things  
evolve.)

Cheers,
Pete



More information about the Cvs-ghc mailing list