Has anyone successfully built a Cygwin version of GHC?

独自空忆成欢 提交于 2019-11-29 12:35:16

问题


Has anyone successfully built a Cygwin version of GHC (since Haskell switched from using Cygwin to MinGW)?

From the haskell website:

"GHC targets MinGW, not Cygwin. It is in principle possible to build a version of GHC, GHC-cygwin, that targets Cygwin instead. The up-side of GHC-cygwin is that Haskell programs compiled by GHC-cygwin can import the (Haskell) Posix library. We do not support GHC-cygwin, however; it is beyond our resources." https://ghc.haskell.org/trac/ghc/wiki/Building/Platforms/Windows

I tried, unsuccessfully, building with Cygwin's configure/gcc. This fails because I couldn't get the Windows version of GHC to use Cygwin's gcc. This seems to be due to the fact that Windows' version of GHC is "registerised" and can't output c code. Further, this "unregisterising-and-porting" method is no longer supported.

If anyone has accomplished this (since Haskell switched from using Cygwin to MinGW), I'd really like to know. Instructions on how to do this would be great but if anyone has accomplished this a simple "yes" would be invaluable.

My latest attempt was with MinGW/MSys with the cross-compilation flag --target=i386-unknown-cygwin32. This is the resulting error:

HSC2HS libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Win32.hs
libraries\haskeline\System\Console\Haskeline\Backend\Win32.hsc:169 
directive let cannot be handled in cross-compilation mode
make[1]: *** [libraries/haskeline/dist-install/build/System/Console/Haskeline/Backend/Win32.hs] Error 1 make: *** 
[all] Error 2

Since programs need to be linked against cygwin1.dll I don't think setting the target to a Linux architecture would be useful.

来源:https://stackoverflow.com/questions/20367937/has-anyone-successfully-built-a-cygwin-version-of-ghc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!