id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
1569	error in compiling ghc-6.6.1 on 64-bit linux	guest	simonmar	"Following error occured while compiling ghc-6.6.1 on a 64-bit linux using Linux (x86_64) binary distribution of ghc-6.6.1:

make -C utils/mkdependC boot
make[1]: Entering directory `/home/wangling/soft/ghc-6.6.1/utils/mkdependC'
rm -f mkdependC
Creating mkdependC...
echo ""#! ""/usr/bin/perl > mkdependC
Done.
make[1]: Leaving directory `/home/wangling/soft/ghc-6.6.1/utils/mkdependC'
------------------------------------------------------------------------
== make boot -r;
 in /home/wangling/soft/ghc-6.6.1/includes
------------------------------------------------------------------------
Creating ghcautoconf.h...
Done.
Creating ghcplatform.h...
Done.
../utils/mkdependC/mkdependC -f .depend     -- -O -I. -I../rts    -- mkDerivedConstants.c
gcc -O -I. -I../rts    -c mkDerivedConstants.c -o mkDerivedConstants.o
gcc -o mkDerivedConstantsHdr -O -I. -I../rts       mkDerivedConstants.o
./mkDerivedConstantsHdr >DerivedConstants.h
gcc -o mkGHCConstants.o -O -I. -I../rts    -c mkDerivedConstants.c  -DGEN_HASKELL
gcc -o mkGHCConstants -O -I. -I../rts       mkGHCConstants.o
./mkGHCConstants > GHCConstants.h
------------------------------------------------------------------------
== make boot -r;
 in /home/wangling/soft/ghc-6.6.1/compat
------------------------------------------------------------------------
../utils/mkdependC/mkdependC -f .depend    -I. -Iinclude -I../includes  -- -O -I. -Iinclude -D__GHC_PATCHLEVEL__=1 -I../libraries/base/cbits -I../libraries/base/include    -- cbits/directory.c cbits/rawSystem.c cbits/unicode.c
/home/wangling/bin/ghc -M -optdep-f -optdep.depend  -osuf o -optdep--exclude-module=System.Directory.Internals   -H16m -O -I. -Iinclude -Rghc-timing -ignore-package Cabal -I../libraries -fglasgow-exts -no-recomp Compat/Directory.hs Compat/RawSystem.hs Compat/Unicode.hs Distribution/Compat/FilePath.hs Distribution/Compat/ReadP.hs Distribution/Compiler.hs Distribution/GetOpt.hs Distribution/InstalledPackageInfo.hs Distribution/License.hs Distribution/Package.hs Distribution/ParseUtils.hs Distribution/Version.hs Language/Haskell/Extension.hs
<<ghc: 50450640 bytes, 8 GCs, 911708/1657480 avg/max bytes residency (2 samples), 17M in use, 0.00 INIT (0.00 elapsed), 0.06 MUT (0.56 elapsed), 0.04 GC (0.05 elapsed) :ghc>>
make all
/home/wangling/bin/ghc -H16m -O -I. -Iinclude -Rghc-timing  -ignore-package Cabal -I../libraries -fglasgow-exts -no-recomp    -c Compat/Directory.hs -o Compat/Directory.o  -ohi Compat/Directory.hi
cc1: error: unrecognized option `-fwrapv'
<<ghc: 116360680 bytes, 19 GCs, 4563666/9867304 avg/max bytes residency (3 samples), 23M in use, 0.00 INIT (0.00 elapsed), 0.29 MUT (0.65 elapsed), 0.15 GC (0.17 elapsed) :ghc>>
make[2]: *** [Compat/Directory.o] Error 1
make[1]: *** [boot] Error 2
make: *** [stage1] Error 1

The same error ""cc1: error: unrecognized option `-fwrapv'"" also occured when I used the Linux (86_64) binary distribution of ghc-6.6.1 to compile a haskell programme with ffi foreign export (that is why I wanted to try to build a ghc by myself).

After some inspect, I found it is caused by the low version of gcc; however, since ghc-6.6.1 does  not claim version requirement on gcc, I think it should be attributed to ghc-6.6.1.

ps: my gcc info

gcc -v
Reading specs from /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.5/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib64 --enable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-__cxa_atexit x86_64-suse-linux
Thread model: posix
gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)"	bug	closed	high	6.8.1	Compiler	6.6.1	fixed	cc1: error: unrecognized option `-fwrapv'		Linux	x86_64 (amd64)		Unknown				
