rts/Compact.cmm: fix UNREG build failure
authorSergei Trofimovich <siarheit@google.com>
Sat, 17 Dec 2016 13:39:18 +0000 (13:39 +0000)
committerSergei Trofimovich <siarheit@google.com>
Sat, 17 Dec 2016 16:48:19 +0000 (16:48 +0000)
commitc4808602124577217dbd39576c120a77f923ca6f
treedbbd9415dd1c73ff84bf25b4fe700325018c3137
parenta6657bd0d6b9949098021d89ed3cd8a943bdd3b6
rts/Compact.cmm: fix UNREG build failure

The change does the following:
- Add explicit declaration of exception closures
  from base. C backend needs those symbols to be
  visible.
- Reorder cmm functions in use order. Again C
  backend needs symbol declaration/definition
  before use. even for module-local cmm functions.

Fixes the following build failure:

  rts_dist_HC rts/dist/build/Compact.o
    In file included from /tmp/ghc3348_0/ghc_4.hc:3:0: error:
    /tmp/ghc3348_0/ghc_4.hc: In function 'stg_compactAddWithSharingzh':

    /tmp/ghc3348_0/ghc_4.hc:27:11: error:
     error: 'stg_compactAddWorkerzh' undeclared (first use in this function)
     JMP_((W_)&stg_compactAddWorkerzh);
               ^
    ...
    /tmp/ghc3348_0/ghc_4.hc:230:13: error:
     error: 'base_GHCziIOziException_cannotCompactMutable_closure'
     undeclared (first use in this function)
     R1.w = (W_)&base_GHCziIOziException_cannotCompactMutable_closure;
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
rts/Compact.cmm