[GHC] #11958: Improved testing of cross-compiler

GHC ghc-devs at haskell.org
Wed Apr 20 03:54:57 UTC 2016


#11958: Improved testing of cross-compiler
-------------------------------------+-------------------------------------
           Reporter:  erikd          |             Owner:
               Type:  task           |            Status:  new
           Priority:  low            |         Milestone:  8.2.1
          Component:  Test Suite     |           Version:  7.10.3
           Keywords:  cross-compile  |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 It is already possible to build cross compiler eg from x86_64/linux to
 armhf/linux or arm64/linux, but there is currently no way to run the test
 suite.

 However, at least for the host and targets above, it should be possible to
 run the test executables under the Qemu user space emulation. I know this
 works, because in my own personal jenkins build instance, I test exactly
 this by doing (for x86_64/linux to amr64/linux cross):

 {{{
 echo -e 'main :: IO ()\nmain = putStrLn "Hello World"\n' > hello-world.hs
 inplace/bin/ghc-stage1 hello-world.hs -o hello-world
 test $(file hello-world | grep -c 'ARM aarch64, version 1') -eq 1
 ./hello-world
 }}}

 The linux machine I run the above test on is x86_64/linux but has Qemu and
 `binfmt` stuff set up so that it can run some foreign binaries. For
 instance, if GHC worked as a Linux to Windows cross-compiler the resulting
 windows binaries should work under Wine.

 To get this working, I suspect that just about all the required work is in
 the build system. Not sure if it might not be better to wait until the
 Shake based build system is in better shape.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11958>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list