Errors building GHC on iOS with LLVM >= 3.4

Murray Campbell murray at sonology.net
Sat Oct 4 21:27:13 UTC 2014


Hi,

I am trying to help solve #9125 in which an ARM build creates binaries
that mangle Float values.

After a great deal of help from rwbarton (detailed in the comments) it
would appear that the problem is actually in LLVM 3.0. (v3.0 is
virtually insisted upon in the iOS build instructions)

Building GHC 7.8.3 for the iOS simulator with LLVM 3.4 produces a
compiler that creates well behaved binaries.

Unfortunately, building the device version fails with several warnings
along the lines of:

    /var/folders/02/0mv6cz6505x2xhzlr279k2340000gp/T/ghc5244_0/ghc5244_6-armv7s.s:2944:2:
         warning: deprecated since v7, use 'dmb'
                mcr     p15, #0, r7, c7, c10, #5

and:

    libraries/ghc-prim/cbits/popcnt.c:76:38:
         warning: shift count >= width of type [-Wshift-count-overflow]
              popcount_tab[(unsigned char)(x >> 32)] +
                                             ^  ~~
before bailing with

    /var/folders/02/0mv6cz6505x2xhzlr279k2340000gp/T/ghc6860_0/ghc6860_6-armv7.s:3916:2:
         error: out of range pc-relative fixup value
                vldr    d8, LCPI70_0
                ^

    /var/folders/02/0mv6cz6505x2xhzlr279k2340000gp/T/ghc6860_0/ghc6860_6-armv7s.s:3916:2:
         error: out of range pc-relative fixup value
                vldr    d8, LCPI70_0
                ^

Next I tried to build HEAD (plus phabricator D208) with LLVM 3.4 but
got the same error.

Various adventures with LLVM 3.5 ended with the same error.

I am trying to educate myself in ARM assembly but in the meantime does
this ring any bells for anyone?  I don't see anything on the trac.

Thanks,

Murray Campbell


More information about the ghc-devs mailing list