GHC haskell support for arm64 and ppc64el
cjwatson at ubuntu.com
Thu Mar 6 11:47:41 UTC 2014
On Wed, Mar 05, 2014 at 05:18:16PM +0000, Colin Watson wrote:
> The best information I can find is in
> which does suggest that there might be some hope, but it's not at all
> clear whether GHC will get beyond stage1 - it'll still have to go round
> some more to rebuild itself and we'd have to confirm that it can build
> other Haskell packages as well before uploading it. To get started,
> I've uploaded an llvm-toolchain-3.4 change with the patch from LLVM HEAD
> referred to in that post, and then I suppose I can see if I can get our
> current package to bootstrap.
OK, I tried this. The author of that post is evidently using something
newer than GHC 7.6, as the --enable-unregisterised configure option
doesn't exist in 7.6. When I adjust for that, I quickly get:
Unknown CPU aarch64
Looking at git master, even the GHC_CONVERT_CPU macro there doesn't
support aarch64 (== arm64). So the author of that post is evidently
working with at least some patches that aren't in master yet. After I
adjust for all that, I do get a ghc-stage1, but the build stops right
after that with:
CROSS_COMPILE="aarch64-unknown-linux-gnu-" "inplace/bin/ghc-cabal" configure --with-ghc="/home/cjwatson/ghc-arm64/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/cjwatson/ghc-arm64/inplace/bin/ghc-pkg" --flag=include-ghc-prim --disable-library-for-ghci --with-hscolour="/usr/bin/HsColour" --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" -Wl,--hash-size=31 -Wl,--reduce-memory-overheads " --configure-option=CPPFLAGS=" " --with-gcc="/home/cjwatson/aarch64-linux-gnu-gccsysroot" --configure-option=--with-cc="/home/cjwatson/aarch64-linux-gnu-gccsysroot" --with-ar="/usr/bin/ar" --with-ranlib="true" --with-alex="/usr/bin/alex" --with-happy="/usr/bin/happy" -- dist-install libraries/ghc-prim
ghc-cabal: /tmp/28824.o: does not exist
And the suggested "hello world" test fails with:
$ ../inplace/bin/ghc-stage1 --make HelloWorld.lhs
Could not find module `Prelude'
Use -v to see a list of the files searched for.
I've left a comment on the ghcarm blog asking for more information on
the patch set they used.
I suspect this is doomed until upstream has better support, and in any
case the bootstrap is likely to be very painful until we're on 7.8
(which won't be until trusty+1) - I found with my abortive ppc64el
attempt that even getting the initial cross-build working was quite a
laborious exercise because of various errors in 7.6's build system.
This sort of thing is a real time-sink; it's a great way to heat my
study, but realistically I don't think it's really achieving a whole
lot. I understand that you're enthusiastic about this, and thank you
for that, but please don't ask for GHC bootstrapping again unless you
can supply a tested recipe for getting to at least somewhat working
cross-compiled binaries, or can point to ghc binaries that other
distributions have got working on these architectures. It's unlikely
that simply asking us to try again is going to help at this point.
Colin Watson [cjwatson at ubuntu.com]
More information about the Ubuntu-devel-discuss