GHC panic when compiling vimus: failed to map segment from shared object
When trying to build https://github.com/vimus/vimus I get a GHC panic on a specific module:
λ cabal build
Building vimus-0.2.1...
Preprocessing library vimus-0.2.1...
[38 of 39] Compiling Vimus.Command ( src/Vimus/Command.hs, dist/build/Vimus/Command.o )
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.2 for x86_64-unknown-linux):
Loading temp shared object failed: /tmp/ghc17990_0/libghc_39.so: failed to map segment from shared object
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I don't know why it's only this particular module of this particular library that fails.
I'm running a kernel with GrSecurity and PaX enabled, and am using a hardened GCC toolchain (although Gentoo seems to automatically disable PIE for Haskell packages). That said, I checked ‘dmesg’ and there's no occurrence of a grsec exception.