GHC 8.6.5 failed to lookup the datalayout
ghc: panic! (the 'impossible' happened)
I'm not running in a production environment and was just testing some code.
Is it indicated to add a warning when coders with access to ghc inadvertently compile with the flags (-fllvm, -pgmlo, -pgmlc, -optlo, -optlc, -ddump-llvm, -keep-llvm-files), on a ghc not built with LLVM support?
As in the ghc (8.6.5) configure script with LlvmVersion=6.0 - which was recognised in the output - what is the purpose for not exiting the compile directly and continuing with We will try though...
?
Is there more to the output than compiling with the flag -fllvm on a ghc not built with LLVM support, pertaining to either of the ghc code base itself or the 3rd Party ghc package build script?
I installed Frames version 0.6.4 and then would compile files in the benchmarks directory.
Slackware-14.2's /extra directory presently has an optional upgrade to llvm-8.0.1 which I hadn't pursued.
bash-4.3$ ghc -O2 -fllvm benchmarks/BenchDemo.hs
Loaded package environment from /tmp/bench
Loaded package environment from /tmp/bench
[1 of 1] Compiling Main ( benchmarks/BenchDemo.hs, benchmarks/BenchDemo.o )
You are using an unsupported version of LLVM!
Currently only 6.0 is supported.
We will try though...
ghc: panic! (the 'impossible' happened)
(GHC version 8.6.5 for i386-unknown-linux):
Failed to lookup the datalayout for i686-unknown-linux; available targets: ["i386-unknown-windows","i686-unknown-windows","x86_64-unknown-windows","arm-unknown-linux-gnueabihf","armv6-unknown-linux-gnueabihf","armv6l-unknown-linux-gnueabihf","armv7-unknown-linux-gnueabihf","armv7a-unknown-linux-gnueabi","armv7l-unknown-linux-gnueabihf","aarch64-unknown-linux-gnu","aarch64-unknown-linux","i386-unknown-linux-gnu","i386-unknown-linux","x86_64-unknown-linux-gnu","x86_64-unknown-linux","armv7-unknown-linux-androideabi","aarch64-unknown-linux-android","powerpc64le-unknown-linux","amd64-portbld-freebsd","arm-unknown-nto-qnx-eabi","i386-apple-darwin","x86_64-apple-darwin","armv7-apple-ios","aarch64-apple-ios","i386-apple-ios","x86_64-apple-ios","aarch64-unknown-freebsd","armv6-unknown-freebsd-gnueabihf","armv7-unknown-freebsd-gnueabihf"]
CallStack (from HasCallStack):
error, called at compiler/llvmGen/LlvmCodeGen.hs:96:24 in ghc:LlvmCodeGen
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
bash-4.3$
Slackware-current presently includes llvm-10.0.0.
bash-4.3$ cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library
bash-4.3 bash-4.3$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5
bash-4.3$ llvm-config --version
3.8.0
bash-4.3$
System: Slackware Linux (version 14.2)
CPUs: Intel(R) Atom(TM) CPU N270 @1.60GHz
D. Spencer's ghc (8.4.3) script was upgraded and the patch line commented out.
bash-4.3$ diff ghc.SlackBuild /usr/doc/ghc-8.6.5/ghc.SlackBuild | tail -n 11
< tar xvf $CWD/$PRGNAM-$VERSION-$TARARCH-deb8-linux.tar.xz
---
> tar xvf $CWD/$PRGNAM-$VERSION-$TARARCH-deb9-linux.tar.xz
121c121
< patch -p1 < $CWD/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch
---
> # patch -p1 < $CWD/4eebc8016f68719e1ccdf460754a97d1f4d6ef05.patch
141c141
< # (taken from ghc-8.4.3-x86_64-deb8-linux.tar.xz)
---
> # (taken from ghc-8.6.5-i386-deb9-linux.tar.xz)
bash-4.3$
From the ghc (8.6.5) configure script.
# Here is where we re-target which specific version of the LLVM
# tools we are looking for. In the past, GHC supported a number of
# versions of LLVM simultaneously, but that stopped working around
# 3.5/3.6 release of LLVM.
LlvmVersion=6.0