[Haskell-cafe] Cross ghc-7.8.3 for PowerPC build fails

Jon Schneider haskell at jschneider.net
Tue Nov 4 12:34:14 UTC 2014


I got my ARM (v5) ghc cross compiler built the other day by making sure I
had only the latest LLVM and Haskell Platform host packages, tweaking
settings and commenting out haskeline and terminfo in the top level ghc.mk
. There's something broken about terminfo but life's too short to worry
about since it's not needed. The ARM cross ghc seems to product viable
executables for simple code.

Now a sister product is a PowerPC (MPC854E) and the ABI is gnuspe.

In my PATH are (only) clangs and llcs from

http://llvm.org/releases/3.4.2/clang+llvm-3.4.2-x86_64-unknown-ubuntu12.04.xz

and ghc from
https://www.haskell.org/platform/download/2014.2.0.0/haskell-platform-2014.2.0.0-unknown-linux-x86_64.tar.gz

Because of the none vendor I didn't seem able to put in the target I
configured like this.

./configure --target=powerpc-linux-gnuspe
--with-gcc=powerpc-none-linux-gnuspe-gcc
--with-nm=powerpc-none-linux-gnuspe-nm
--with-ld=powerpc-none-linux-gnuspe-ld
--with-ar=powerpc-none-linux-gnuspe-ar
--with-ranlib=powerpc-none-linux-gnuspe-ranlib

This fails as follows. It seems to have generated x86 opcodes including
movq unless it's something to do with GNU assembly trying to make
everything have the same apparent instruction set then again %rcx and %esi
are mentioned.

======
cp libffi/build/inst/lib/libffi.a rts/dist/build/libCffi_thr_l.a
"inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -H64m -O0  
 -package-name ghc-prim-0.3.1.0 -hide-all-packages -i
-ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build
-ilibraries/ghc-prim/dist-install/build/autogen
-Ilibraries/ghc-prim/dist-install/build
-Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.   
-optP-include
-optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h -package
rts-1.0 -package-name ghc-prim -XHaskell2010 -O -fllvm 
-no-user-package-db -rtsopts      -odir
libraries/ghc-prim/dist-install/build -hidir
libraries/ghc-prim/dist-install/build -stubdir
libraries/ghc-prim/dist-install/build   -c
libraries/ghc-prim/./GHC/Types.hs -o
libraries/ghc-prim/dist-install/build/GHC/Types.o
/tmp/ghc30000_0/ghc30000_5.s: Assembler messages:

/tmp/ghc30000_0/ghc30000_5.s:8:0:
     Error: Unrecognized opcode: `movl'
and so on with opcodes such as jbe, leal, jmpq and also "junk at end of
line: `rcx),%esi'"
======

in libffi/build/powerpc-unknown-linux-gnuspe there's a sensible config.log
with x86_64 in the build variables and powerpc in the host and target
ones.

How do I go about making this work ?

Thanks,

Jon



More information about the Haskell-Cafe mailing list