
[Note: already shortly discussed with Wilhelm] On Fri, Nov 23, 2007 at 12:30:06PM +0000, Wilhelm B. Kloke wrote:
../../compiler/stage1/ghc-inplace -package-name unix-2.2.0.0 -hide-all-packages -i -idist/build/autogen -idist/build -i. -Idist/build -Iinclude -#include "HsUnix.h" -#include "execvpe.h" -odir dist/build -hidir dist/build -stubdir dist/build -package base-3.0.0.0 -package directory-1.0.0.0 -O -XCPP -XForeignFunctionInterface -idist/build -H32m -O0 -fasm -Rghc-timing -keep-hc-files -O -c dist/build/System/Posix/Process.hs -o dist/build/System/Posix/Process.o -ohi dist/build/System/Posix/Process.hi Prologue junk?: .type s32x_ret, @function s32x_ret: pushl %ebp movl %esp, %ebp
I see nearly the same problem with ghc-6.8.2 on OpenBSD, using the gcc-3.3.5 included in its base system. Regardless of wether there's something wrong with the generated code or wether it's just a bug in the mangler, it's possible to build Process.c with -fviaC *and* -O0.[1] For now, I'm able to build a HC file bundle with this settings in build.mk and running "gmake stage1 hc-file-bundle": SRC_HC_OPTS= -H64 -O -fvia-C -keep-hc-files GhcLibHcOpts= -O0 # Workaround the mangler problem GhcLibWays= GhcRTSWays= SplitObjs= NO I'd appreciate any reports wether people see the same problem on other systems (if so: what gcc version are you using?) and wether GhcLibHcOpts=-O0 fixes it. Ciao, Kili [1] BTW: what's the point of using -fasm with -keep-hc-files? IMHO, it should be -fviaC -keep-hc-files. Someone let me know if I should correct this in the wiki. ps: yes, I'm slowly trying to bring HC bootstrap back to work. It's a must-have for the OpenBSD port. Apart from the HC file bundle, this will require some more hacking especially on library/Makefile and the Cabal-generated GNUmakefiles (and/or Makefile.local). pps: I guess, cvs-ghc would be the more correct list for sending patches and discussing the bootstrapping stuff, right?