Skip to content

LLVM backend fails to build on big endian arm64

Summary

If attempting to build ghc on big endian arm64 using the LLVM backend (unregisterised build works fine), then the following error appears:

ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 9.0.2:
        Failed to lookup LLVM data layout
  Target: aarch64_be-unknown-linux
  Available targets:
     [...]

This is because the data layout for aarch64_be is missing. That layout is identical to that of aarch64 though, except that it has E (big endian) instead of e (little endian) of course.

I have a patch to add the missing data layout.

Steps to reproduce

Try to build ghc on big endian arm64, without specifying --enable-unregisterised

Expected behavior

ghc can be built

Environment

  • GHC version used: 9.0.2

Optional:

  • Operating System: Gentoo Linux
  • System Architecture: aarch64_be
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information