RE: stg_ap_v_ret porting crash: solved?

Things aren't so easy with alpha as gcc rejects the -mieee flag when GHC calls gcc for -cpp'ing. I fear a nasty hacky wrapper may be in order.
Is this when running gcc on the Alpha, or on the bootstrapping host? Cheers, Simon

simonmar:
Things aren't so easy with alpha as gcc rejects the -mieee flag when GHC calls gcc for -cpp'ing. I fear a nasty hacky wrapper may be in order.
Is this when running gcc on the Alpha, or on the bootstrapping host?
alpha-dec-osf3 bootstrapped quite cleanly today. Using the right config.h makes a big difference ;) It isn't working yet though. I had to comment out/hack various decls in the rts on the alpha, which let the compile go through. The GHC that got built seems to loop when invoked. Probably an MBlock thing, I haven't looked into it yet. Anyway, I assume Ian was talking about the bootstrapped GHC on the target rejecting -mieee when being used to compile a full GHC. I didn't get that far, but I had no problems with -mieee on the host, or with .hc file-booting gcc. -- Don

On Thu, Sep 11, 2003 at 07:53:02PM +1000, Donald Bruce Stewart wrote:
simonmar:
Things aren't so easy with alpha as gcc rejects the -mieee flag when GHC calls gcc for -cpp'ing. I fear a nasty hacky wrapper may be in order.
Is this when running gcc on the Alpha, or on the bootstrapping host?
alpha-dec-osf3 bootstrapped quite cleanly today. Using the right config.h makes a big difference ;) It isn't working yet though.
I had to comment out/hack various decls in the rts on the alpha, which let the compile go through. The GHC that got built seems to loop when invoked. Probably an MBlock thing, I haven't looked into it yet.
With the wrapper everything was fine here on the host side. I then had to do the I_ -> int stg_exit thing as committed to CVS for IA64, and also change machine/{pal,fpu}.h to asm/{pal,fpu}.h in ghc/rts/Adjuster.c and ghc/rts/Signals.c. (I'd already applied the MBLOCK hack from x86-64). The compile then failed with gcc -O -Wall -DCOMPILING_STDLIB -I../../../ghc/includes -I../../../ghc/rts -I../include -c writeError.c -o writeError.o In file included from ../../../ghc/includes/Stg.h:189, from ../../../ghc/includes/Rts.h:20, from writeError.c:19: ../../../ghc/includes/TailCalls.h:86: warning: call-clobbered register used for global register variable writeError.c: In function `writeErrString__': writeError.c:47: error: unable to find a register to spill in class `R27_REG' writeError.c:47: error: this is the insn: (call_insn 31 30 34 1 0x2000079b970 (parallel [ (call (mem:DI (reg/v/f:DI 9 $9 [69]) [0 S8 A64]) (const_int 0 [0x0])) (use (reg:DI 29 $29)) (clobber (reg:DI 26 $26)) ]) 197 {*call_osf_1_er} (insn_list 30 (nil)) (expr_list:REG_DEAD (reg:DI 27 $27) (expr_list:REG_DEAD (reg:DI 16 $16) (expr_list:REG_DEAD (reg/v/f:DI 9 $9 [69]) (expr_list:REG_UNUSED (reg:DI 26 $26) (nil))))) (expr_list (use (reg:DI 16 $16)) (nil))) writeError.c:47: confused by earlier errors, bailing out make[2]: *** [writeError.o] Error 1 make[1]: *** [all] Error 1 make: *** [all] Error 1 make: Leaving directory `/home/igloo/ghc6-doc/ghc-6.0.1/libraries' (gcc is 3.3). Same thing with different optimisation levels but 2.95 compiled it fine. Is this the same as the problem you had on sparc, Simon? I gcc -E'd and then removed unused stuff to try to get something to send off as a bug report, but then found the result compiled under 3.3 so kept going. This resulted in a working compiler, so I tried to build ghc using it with gcc-2.95. I had to move the #include "TailCalls.h" up in ghc/includes/Stg.h to get the register void *_procedure __asm__("$27"); above all the function definitions. Now I have ../../ghc/compiler/ghc-inplace -H16m -O -O2 -static -c Apply.hc -o Apply.o ghc-asm: unknown prologue mangling? alpha-unknown-linux Prologue junk?: .globl stg_ap_0_ret .ent stg_ap_0_ret stg_ap_0_ret: .eflag 48 .frame $30,16,$26,0 .mask 0x4000000,-16 ldgp $29,0($27) $stg_ap_0_ret..ng: lda $30,-16($30) stq $26,0($30) .prologue 1 and I'm going to bed. Ian

igloo:
With the wrapper everything was fine here on the host side.
I then had to do the I_ -> int stg_exit thing as committed to CVS for IA64, and also change machine/{pal,fpu}.h to asm/{pal,fpu}.h in ghc/rts/Adjuster.c and ghc/rts/Signals.c. (I'd already applied the MBLOCK hack from x86-64). The compile then failed with
I got another (loopy) compile on alpha-dec-osf3 that went through cleanly, with the following fixes: On the x86-*-openbsd host: * ------------------------------------------------------------------------ ==fptools== gmake all - --no-print-directory -r; in /home/dons/unreg/ghc-6.0.1/libraries/base/cbits ------------------------------------------------------------------------ [..] gcc -O -Wall -DCOMPILING_STDLIB -I../../../ghc/includes -I../../../ghc/rts -I../include -c longlong.c -o longlong.o In file included from ../../../ghc/includes/Stg.h:189, from ../../../ghc/includes/Rts.h:20, from longlong.c:29: ../../../ghc/includes/TailCalls.h:86: invalid register name for `_procedure' # Fixed by adding to libraries/mk/boilerplate.mk: SRC_CC_OPTS+= -DUSE_MINIINTERPRETER On the alpha target: * gcc -O -DNO_REGS -DUSE_MINIINTERPRETER -I/import/pill0/1/dons/ghc/alpha-osf3/ghc-6.0.1/ghc/includes -I/import/pill0/1/dons/ghc/alpha-osf3/ghc-6.0.1/libraries/base/include -I/import/pill0/1/dons/ghc/alpha-osf3/ghc-6.0.1/libraries/unix/include -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Winline -Waggregate-return -Wbad-function-cast -I../includes -I. -Iparallel -DCOMPILING_RTS -fomit-frame-pointer -c BlockAlloc.c -o BlockAlloc.o In file included from BlockAlloc.c:24: MBlock.h:79: #error HEAP_ALLOCED not defined # fix: Applied MBlock.h x86_64 fix/hack * conflicting types for `stg_exit' # fix: I_ -> int in ghc/rts/RtsUtils.h ghc/includes/PrimOps.h * Can't locate file for: -lreadline collect2: ld returned 1 exit status # fix: comment out readline in mk/bootstrap.mk And then everything went though, to the re-configure part of hc-build, but the ghc-inplace seems to go into an infinite loop on invocation. It won't produce output even with invalid command line flags. It just sits and spins for a few minutes, and then I have to kill it. The only interesting thing is that it ignores the first ^C, and requires a second ^C to die. I'll try a debug build of some kind. Unless someone has some better idea. -- Don

dons:
I got another (loopy) compile on alpha-dec-osf3 that went through cleanly, with the following fixes:
[..]
And then everything went though, to the re-configure part of hc-build, but the ghc-inplace seems to go into an infinite loop on invocation. It won't produce output even with invalid command line flags. It just sits and spins for a few minutes, and then I have to kill it.
A quick gdb session on stage1/ghc-6.0.1 on the alpha-dec-osf3: (gdb) run # ^C it after a little while: Program received signal SIGINT, Interrupt. 0x1212c62c4 in StgRun () at StgCRun.c:6 6 * STG-to-C glue. (gdb) break StgRun Breakpoint 1 at 0x1212c6298: file StgCRun.c, line 6. # run it: Breakpoint 1, 0x1212c6298 in StgRun () at StgCRun.c:6 6 * STG-to-C glue. (gdb) step 0x1212c6728 in stg_init () at StgStartup.hc:6 (gdb) step # I ^C it after a little while: Program received signal SIGINT, Interrupt. 0x1212c62b0 in StgRun () at StgCRun.c:6 6 * STG-to-C glue. So it stalls or loops (it sits at 98% of cpu) on entry to stg_init(). More info will have to wait until I try a debug build. -- Don

On Thu, Sep 11, 2003 at 09:52:07AM +0100, Simon Marlow wrote:
Things aren't so easy with alpha as gcc rejects the -mieee flag when GHC calls gcc for -cpp'ing. I fear a nasty hacky wrapper may be in order.
Is this when running gcc on the Alpha, or on the bootstrapping host?
The bootstrapping host. Oh, and while I think about it, on the building docs: Minor niggle - missing "cd T" on the first line "$ ./configure --enable-hc-boot --enable-hc-boot-unregisterised" When you say "change TARGETPLATFORM appropriately." I've been assuming you mean the name of the foo_TARGET_ARCH etc variables too. Presumably this is the same as passing configure --target=what-remote-one-says ? Thanks Ian
participants (3)
-
dons@cse.unsw.edu.au
-
Ian Lynagh
-
Simon Marlow