Skip to content
  • Herbert Valerio Riedel's avatar
    Add NCG support for AIX/ppc32 · df26b955
    Herbert Valerio Riedel authored
    This extends the previous work to revive the unregisterised GHC build
    for AIX/ppc32. Strictly speaking, AIX runs on POWER4 (and later)
    hardware, but the PPC32 instructions implemented in the PPC NCG
    represent a compatible subset of the POWER4 ISA.
    
    IBM AIX follows the PowerOpen ABI (and shares many similiarites with the
    Linux PPC64 ELF V1 NCG backend) but uses the rather limited XCOFF
    format (compared to ELF).
    
    This doesn't support dynamic libraries yet.
    
    A major limiting factor is that the AIX assembler does not support the
    `@ha`/`@l` relocation types nor the ha16()/lo16() functions Darwin's
    assembler supports. Therefore we need to avoid emitting those. In case
    of numeric literals we simply compute the functions ourselves, while for
    labels we have to use local TOCs and hope everything fits into a 16bit
    offset (for ppc32 this gives us at most 16384 entries per TOC section,
    which is enough to compile GHC).
    
    Another issue is that XCOFF doesn't seem to have a relocation type for...
    df26b955