
#8974: 64 bit windows executable built with ghc-7.9.20140405+LLVM segfaults ------------------------------------+-------------------------------------- Reporter: awson | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler (LLVM) | Version: 7.9 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ------------------------------------+-------------------------------------- Comment (by GordonBGood): Replying to [comment:53 awson]:
Well, I've downloaded 8.0.1 release, tried it and all your examples immediately started to segfault, but after I replaced distributed binutils with the correct one all started to work flawlessly, no segfaults altogether for all your examples.
So, Yes, I was unable to compile anything to run at all without segfaults using -fllvm on Windows 64-bit until I updated MSYS2 with pacman update so as to update to binutils 2.27-2, then downgraded LLVM from 3.8 back to 3.7.0-6, which is where I am sitting now with this problem. I think that one difference between our setups is that my path finds the MSYS2 bindir first before the mingw that comes with GHC 8.0.1, and perhaps some of those GHC mingw files have been patched or are versions that work with GHC 8.0.1 whereas the up-to-date MSYS2 ones aren't quite compatible. This would explain why 'Integer' has problems as I notice that MSYS2 has updated GMP files. I can move the LLVM 3.7 and binutils files into the GHC mingw folder and temporarily remove MSYS2 bindir from the path, but I need to know what binutil files were patched for binutils 2.27-2 or if I should just replace all of them. Another possible difference is that I am using the MSYS2 LLVM version 3.7.0 where you might be using the LLVM version 3.7.1 which may have some differences. I don't have a copy of LLVM 3.7.1 and don't know how to get the crucial two files 'llc.exe' and 'opt.exe' without compiling it as most binary distros have been replaced with newer versions. However, I did find a copy of a binary distro for MSYS2 mingw x86_64 LLVM 3.7.0-9 which I will try. It seems that this is just another case of incompatibilities between GHC and the versions of programs it requires such as specific versions of LLVM but perhaps others, which hopefully will be fixed with GHC 8.2.1 distributing versions that are known to work and automatically setting the path to use those versions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8974#comment:54 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler