
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'
Hmm, Alpha should probably not be declaring that global register variable in TailCalls.h when compiling ordinary C files. Try surrounding the declaration with #ifdef IN_STG_CODE.
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
Looks like you need some mangler support now... Cheers, Simon

On Fri, Sep 12, 2003 at 10:59:05AM +0100, Simon Marlow wrote:
Looks like you need some mangler support now...
Unfortunately neither the mangler nor alpha are exactly strong points of mine. I'm also somewhat confused by how die "Prologue junk?: $p\n" if $p =~ /^\s+[^\s\.]/; [...] # On Alphas, the prologue mangling is done a little later (below) [...] if ( $TargetPlatform =~ /^alpha-/ && $c =~ /^\t\.ent\s+(\S+)/ ) { [prologue mangling] is supposed to play together. In other news, looks like porky.devel.redhat.com (linked to from the archive pages) has ceased to exist and list messages aren't getting through, although I can't see that host mentioned (under that name at least) in message headers. Thanks Ian

On Fri, Sep 12, 2003 at 10:59:05AM +0100, Simon Marlow wrote:
Looks like you need some mangler support now...
Am I right in thinking that by just putting GhcUnregisterised=YES SplitObjs=NO in mk/build.mk every time you build GHC it ought to not only work on arches with bit-rotted mangler support but also those with none attempted? Where work means compiles the same set of programs, but the result (as well as the compilation) will be slower? Starting with a reg compiler producing reg code and iterating a standard configure/make/make install with 6.0.1 gives these numbers on x86: 70m5.850s 86m27.550s 86m26.350s so it looks like this is about 25% slower, although I don't know how much it will vary by architecture. This isn't purely testing GHC of course, but I think it's probably pretty close. This seems better than no GHC at all for unsupported arch/OS combinations, and I unfortunately don't have the time to learn the details of what needs to be done and all the assembly languages and calling conventions that Debian supports. It would also mean that anyone who does want to try to get it working registerised on an arch could skip the cross-porting stage. Incidentally, it looks to me like the comment # NOTE: this is not the same as building the compiler itself # unregisterised. That's done by either (a) bootstrapping with a # compiler that was built with GhcUnregisterised=YES, or (b) # bootstrapping with a compiler that has way 'u' libraries, and the # flag '-unreg' is added to GhcHcOpts above. about GhcUnregisterised in mk/config.mk is outdated given the 2-stage building process that is now the default? Thanks Ian
participants (2)
-
Ian Lynagh
-
Simon Marlow