Seeing as GHC has been building registerised binaries for ARM for some
time now[1], I thought it might be about time that the GHC port was
finished (especially considering bug #4268[2] makes the lack of GHCi
quite painful). The one remaining task that I have found is the lack of GHCi
support. The porting documentation[2] claims that GHCi requires porting
of rts/Linker.c.

After a cursory look at this, it seems that only the following are
necessary (assuming Mach-O support can be neglected),

  * Add EM_ARM case to ELF machine type handling (quite trivial)
  * Add ARM support to do_Elf_Rela_relocations and do_Elf_Rel_relocations

Concerning the relocations, it appears that the x86 code only implements
two relocation types. Looking at my installed GHC-compiled libraries, it
seems these are the only two relocation types which GHC produces. The
non-Haskell libraries, however, tell a much different story. Am I correct
in assuming that rts/Linker.c works exclusively with GHC-compiled
objects?

Moreover, in reviewing my GHC-compiled ARM libraries, I have yet to see
a .rela. Is it safe to say these won't appear in the wild?

I have finished a first cut of a patch doing the above and it is
available at [4]. Be aware that this is entirely untested (hopefully
this will change tomorrow after some sleep). Does anyone see anything
missing or blatantly wrong? Given my limited knowledge of the
intricacies of the linking process and the ARM architecture, I'd
appreciate any advice folks could offer. Thanks!

Cheers,

- Ben


[1] http://hackage.haskell.org/trac/ghc/wiki/Building/ARMLinuxGnuEABI
[2] http://hackage.haskell.org/trac/ghc/ticket/4268
[3] http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
[4] 
https://github.com/bgamari/ghc/commit/045500ddb0fbc92807ec97523f5ba2412d671ec6

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to