Cannot build ghc HEAD with LLVM ARM due to globalRegMaybe

Jan Stolarek jan.stolarek at p.lodz.pl
Mon Sep 15 09:13:35 UTC 2014


I think it is best to fill in a bug report and attach a patch - I'm afraid this mail may have gone 
unnoticed :-)

Janek

Dnia piątek, 12 września 2014, Moritz Angermann napisał:
> Hi,
>
> when trying to compile a ghc HEAD on LLVM ARM, I end up getting an
> exception:
>
>     ghc-stage1: panic! (the 'impossible' happened)
>       (GHC version 7.9.20140911 for arm-apple-ios):
>         globalRegMaybe
>
> After some digging I found that a new call to globalRegMaybe was introduced
> here:
> http://git.haskell.org/ghc.git/blob/HEAD:/compiler/cmm/CmmSink.hs#l231 on
> 2014-04-29 in commit:
> http://git.haskell.org/ghc.git/commitdiff/83a003fcaec93dbfd5b46837f2bf33534
>12b9877
>
> In a similar timeframe (since 2014-05-02) /include/CodeGen.Platform.hs was
> changed:
> http://git.haskell.org/ghc.git/blobdiff/b0534f78a73f972e279eed4447a5687bd6a
>8308e..HEAD:/includes/CodeGen.Platform.hs
>
> introducing a set of new ifdef/elif/endif pairs. Especially for
> MACHREGS_NO_REGS, namely:
>
>     -#endif
>      globalRegMaybe _                        = Nothing
>     +#elif MACHREGS_NO_REGS
>     +globalRegMaybe _ = Nothing
>     +#else
>     +globalRegMaybe = panic "globalRegMaybe not defined for this platform"
>     +#endif
>
> ARM.hs
> (http://git.haskell.org/ghc.git/blob/23892440032fcab8a6a753916d506857674169
>ec:/compiler/codeGen/CodeGen/Platform/ARM.hs) however, has:
>
>     #define MACHREGS_NO_REGS 0
>     #define MACHREGS_arm 1
>
> where MACHREGS_arm 1 has no effect on the subsequently imported
> CodeGen.Platform.hs.
>
> Therefore I propose that a change to ARM.hs is made to set
> MACHREGS_NO_REGS to 1.
>
> Cheers,
>  Moritz
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs




More information about the ghc-devs mailing list