[GHC] #13495: ghc-stage1: panic! (the 'impossible' happened) creating cross compiler for PPC

GHC ghc-devs at haskell.org
Wed Mar 29 16:09:13 UTC 2017


#13495: ghc-stage1: panic! (the 'impossible' happened) creating cross compiler for
PPC
----------------------------------------+-------------------------------
        Reporter:  jms                  |                Owner:  (none)
            Type:  bug                  |               Status:  new
        Priority:  normal               |            Milestone:  8.2.1
       Component:  Compiler             |              Version:  8.0.2
      Resolution:                       |             Keywords:
Operating System:  Linux                |         Architecture:  powerpc
 Type of failure:  Building GHC failed  |            Test Case:
      Blocked By:                       |             Blocking:
 Related Tickets:                       |  Differential Rev(s):
       Wiki Page:                       |
----------------------------------------+-------------------------------

Old description:

> We have a product based on a Freescale MPC8544E.
>
> I have previously built powerpc-unknown-linux-gnuspe-ghc-7.8.3 and that
> produces viable code though annoyingly rather large binaries but this is
> covered elsewhere.
>
> I looked at both 7.8.4 and 7.10 a while ago but they proved to be non-
> starters for reasons I no longer remember.
>
> Now for reasons tooling reasons (Stack and friends) it would be nice to
> use 8.0.2
>
> My procedure is as follows
>
> In the (ghc-7.83 or) ghc-8.0.2 source directory
>
> base=powerpc-unknown-linux-gnuspe; ./configure --prefix=/tmp/prefix
> --target=$base --with-gcc=$base-gcc --with-ld=$base-ld --with-nm=$base-nm
> --with-ar=$base-ar --with-ranlib=$base-ranlib --enable-unregisterised
>
> I edit mk/build.mk to make flavour "quick-cross"
>
> I edit ghc.mk and comment out anything with haskeline or terminfo
>
> The bottom of settings says ("Unregisterised", "YES"), ("LLVM llc
> command", "/usr/bin/llc-3.7"), ("LLVM opt command", "/usr/bin/opt-3.7")
>
> But the make itself (on Ubuntu 16 amd64) fails.
>
> "inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -O0 -H64m
> -Wall      -this-unit-id ghc-prim-0.5.0.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-id rts -this-unit-id ghc-
> prim -XHaskell2010 -O -fllvm  -no-user-package-db -rtsopts -Wno-
> trustworthy-safe -Wno-deprecated-flags     -Wnoncanonical-monad-instances
> -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
> ghc-stage1: panic! (the 'impossible' happened)
>   (GHC version 8.0.2 for powerpc-unknown-linux):
>         LlvmCodeGen.Ppr: Cross compiling without valid target info.

New description:

 We have a product based on a Freescale MPC8544E.

 I have previously built powerpc-unknown-linux-gnuspe-ghc-7.8.3 and that
 produces viable code though annoyingly rather large binaries but this is
 covered elsewhere.

 I looked at both 7.8.4 and 7.10 a while ago but they proved to be non-
 starters for reasons I no longer remember.

 Now for reasons tooling reasons (Stack and friends) it would be nice to
 use 8.0.2

 My procedure is as follows

 In the (ghc-7.83 or) ghc-8.0.2 source directory

 {{{
 base=powerpc-unknown-linux-gnuspe; ./configure --prefix=/tmp/prefix
 --target=$base --with-gcc=$base-gcc --with-ld=$base-ld --with-nm=$base-nm
 --with-ar=$base-ar --with-ranlib=$base-ranlib --enable-unregisterised
 }}}

 I edit mk/build.mk to make flavour "quick-cross"

 I edit ghc.mk and comment out anything with haskeline or terminfo

 The bottom of settings says ("Unregisterised", "YES"), ("LLVM llc
 command", "/usr/bin/llc-3.7"), ("LLVM opt command", "/usr/bin/opt-3.7")

 But the make itself (on Ubuntu 16 amd64) fails.

 {{{
 "inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -O0 -H64m
 -Wall      -this-unit-id ghc-prim-0.5.0.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-id rts -this-unit-id ghc-
 prim -XHaskell2010 -O -fllvm  -no-user-package-db -rtsopts -Wno-
 trustworthy-safe -Wno-deprecated-flags     -Wnoncanonical-monad-instances
 -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
 ghc-stage1: panic! (the 'impossible' happened)
   (GHC version 8.0.2 for powerpc-unknown-linux):
         LlvmCodeGen.Ppr: Cross compiling without valid target info.
 }}}

--

Comment (by bgamari):

 Given that you are trying to build an unregisterised compiler, it's quite
 unclear to me how this `-fllvm` is sneaking into the command line.

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


More information about the ghc-tickets mailing list