Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stack gives 'dyld: malformed mach-o'

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.

like image 610
orome Avatar asked Mar 11 '23 01:03

orome


1 Answers

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.

like image 114
Emanuel Borsboom Avatar answered May 01 '23 08:05

Emanuel Borsboom