Errors generating compiler/parser/Parser.hs with Happy 1.16
under mingw
Peter Tanski
p.tanski at gmail.com
Sun Jul 22 10:46:08 EDT 2007
On Jul 22, 2007, at 7:59 AM, Ian Lynagh wrote:
> On Sun, Jul 22, 2007 at 02:35:14AM -0400, Peter Tanski wrote:
>>
>> I am using the file:
>> gcc-core-3.4.5-20060117-1.tar.gz
>> from the Mingw download page on SourceForge, at <http://
>> sourceforge.net/project/showfiles.php?group_id=2435>.
>
> I get the same behaviour with this gcc as I got with the other two
> gcc's (except the error with -u is different):
>
> $ ~/wibble/bin/gcc -E -undef -P -x c q.pp
> #include "HsVersions.h"
>
> $ ~/wibble/bin/gcc -E -traditional -undef -P -x c q.pp
> #include "HsVersions.h"
>
> $ ~/wibble/bin/gcc -E -u -P q.pp
> gcc.exe: q.pp: linker input file unused because linking not done
Right. (I cut and pasted the output, but munged the original command
line.)
> $ ~/wibble/bin/gcc --version
> gcc.exe (GCC) 3.4.5 (mingw special)
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
$ cat tst.pp
#define INCLUDE #include
INCLUDE "HsVersions.h"
$ gcc -E -u -traditional -P -x c tst.pp
#include "HsVersions.h"
-- an extra space here: '-traditional' is ignored if it comes after '-
u', probably because '-traditional' is treated as a symbol to
undefine. The flag is '-undef' not '-u'.
This is all my fault. In config.mk.in I defined RAWCPP_FLAGS for $
(TargetOS_CPP) == windows, as '-u' to be compatible with CL and added
-traditional later for $(HostOS_CPP) = mingw32. The original
RAWCPP_FLAGS are '-undef -traditional' which is correct. For a clean
Windows-native build the CL-style RAWCPP_FLAGS should only be used
when HOSTPLATFORM=i386-unknown-windows. Another idiot moment for
Pete. Sorry about that.
Cheers,
Pete
More information about the Cvs-ghc
mailing list