Stack gives 'dyld: malformed mach-o'

佐手、 提交于 2019-12-23 13:07:19

问题


When I attempt to run stack, for example even just stack --version, I get

dyld: malformed mach-o: load commands size (38712) > 32768

What can I do to fix this. This started appearing after some recent updates to Homebrew.


回答1:


I'm guessing you've upgraded to macOS Sierra, because that message looks like you're hitting a new limit in its dynamic linker. Might be that your stack executable is dynamically linked with all the Haskell libraries it uses, which is known to exceed the new limit. You might try downloading the osx binary from the Stack releases page, which I've heard reports of working on Sierra (it's only dynamically linked to system libraries, but statically linked with Haskell libraries, so shouldn't hit the limit just to run). Note that you may still have trouble building projects with a large number of dependencies, and so far we do not have a workaround for that yet.

Related: Stack issue #2577, and GHC issue #12479.




回答2:


I also experienced the same issue when I upgraded to macOS Sierra, I was able to run Stack commands again by installing the Haskell Platform. The Stack tools included in the package seem to work.



来源:https://stackoverflow.com/questions/39646221/stack-gives-dyld-malformed-mach-o

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