Building GHC 7.6 with 7.8

Hi, I'm trying to bootstrap GHC on a new architecture (Linux arm64/aarch64). I've been working with Karel Gardas from https://ghc.haskell.org/trac/ghc/ticket/7942, and with a few of my own naïve modifications on top of his patch set I've been able to bootstrap my way to a complete working build of the ghc-7.8 git branch (that is, I was able to cross-build on amd64 and then do a complete native build on arm64). arm64 hardware is still pretty rare and emulation is slow, but I have access to some via work, so given help from somebody who knows GHC rather better than I do I'm in a good position to get this done. What I actually want is to see if I can get this support into Ubuntu 14.04 LTS, which is going to be released in about two weeks. I still just about have enough time to do this if I'm quick. However, we currently ship GHC 7.6.3, it's working pretty well, and I don't want to destabilise things by trying to introduce a new version of GHC even just for some architectures. Thus, I've been trying to build 7.6 using 7.8. I know this is not a supported path - it's pretty obvious from the ways it breaks that nobody has spent much time trying to make it work. It seems as though it ought to be possible in theory, though, and cross-building has improved so much in 7.8 that I really don't want to go back and try to cross-build 7.6 - I tried that before and never managed to get anywhere. I've therefore been trying to apply the obvious tweaks like adding imports and adjusting versions in .cabal files. However, I've run into a roadblock, and I hope somebody here might be able to figure out what's going on. I've attached my current work-in-progress patch set; there's some noise from autoreconf, and it also requires putting an updated libffi tarball in place. I've also attached a script(1) log of a failed build attempt. The patch is actually slightly newer than the typescript, in that I realised that the GHC_CONVERT_CPU output needed to be "aarch64" not "arm64" in order for configuring libffi to work properly; this has no material effect on the build failure, though, and I hope it doesn't cause too much confusion. This typescript is from a build of 7.6 with the cross-compiled ghc-stage2. However, I also tried the same build with the native ghc-stage2 build that I'd bootstrapped off that, and the failure looks basically the same to my eye. If anyone thinks the difference might be important then I'd be happy to prepare an updated typescript, but it takes a while. I'd appreciate any suggestions people might have. Thanks, -- Colin Watson [cjwatson@ubuntu.com]

On Wed, Apr 02, 2014 at 08:41:46PM +0100, Colin Watson wrote:
"/home/cjwatson/ghc-aarch64/inplace/bin/ghc-stage2" -H32m -O -lffi -optl-pthread -package-db libraries/bootstrapping.conf -hide-all-packages -i -ighc/. -ighc/stage1/build -ighc/stage1/build/autogen -Ighc/stage1/build -Ighc/stage1/build/autogen -optP-include -optPghc/stage1/build/autogen/cabal_macros.h -package array-0.5.0.0 -package base-4.7.0.0 -package bytestring-0.10.4.0 -package directory-1.2.0.2 -package filepath-1.3.0.2 -package ghc-7.8.0.20140331 -package process-1.2.0.0 -package unix-2.7.0.0 -Wall -XHaskell98 -XNondecreasingIndentation -XCPP -XPatternGuards -no-user-package-db -rtsopts -odir ghc/stage1/build -hidir ghc/stage1/build -stubdir ghc/stage1/build -hisuf hi -osuf o -hcsuf hc -c ghc/./Main.hs -o ghc/stage1/build/Main.o Failed to load interface for `Distribution.InstalledPackageInfo.Binary' There are files missing in the `bin-package-db-0.0.0.0' package, try running 'ghc-pkg check'. Use -v to see a list of the files searched for.
Never mind - I got past this. The key was realising that this should be building against the just-built compiler/ tree, and hence "-package ghc-7.8.0.20140331" needs to be "-package ghc-7.6.3" instead. I fixed up a few too-new dependencies like this and things are working much better now. -- Colin Watson [cjwatson@ubuntu.com]
participants (1)
-
Colin Watson