LLVM backend produces code that segfaults on X86
Summary
I am trying to build GHC 9.4.7 on X86, using GHC 9.4.6 from Debian (note: the stage0 compiler is unregisterised, but I believe this should be reproducible with a registerised stage0 compiler as well), using the LLVM backend (llvm flavour transofmer).
The resulting stage2 binaries are broken. As an example:
$ _build/stage1/bin/ghc
Segmentation fault
$ _build/stage1/bin/ghc-pkg
ghc-pkg: internal error: TSO object (0x80b6128) entered!
(GHC version 9.4.7 for i386_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
Aborted
Interestingly enough, this doesn't happen when I use the quickest
flavour (the resulting binaries work as expected), but happens both with the default
and the quick
flavour. Let me know if I can try anything else to provide more information.
Steps to reproduce
$ ./boot
$ ./configure --with-system-libffi
$ ./hadrian/build -V -j --docs=none --flavour=default+llvm
$ _build/stage1/bin/ghc
Segmentation fault