https://github.com/angerman/macos-ghc-dylib-blowup
Example project demonstrating the mach-o load commandsize blowup with ghc constructed dylibs
https://github.com/angerman/macos-ghc-dylib-blowup
Last synced: 10 months ago
JSON representation
Example project demonstrating the mach-o load commandsize blowup with ghc constructed dylibs
- Host: GitHub
- URL: https://github.com/angerman/macos-ghc-dylib-blowup
- Owner: angerman
- Created: 2018-04-01T13:04:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-01T13:08:06.000Z (about 8 years ago)
- Last Synced: 2025-02-18T00:44:26.276Z (over 1 year ago)
- Language: Haskell
- Size: 132 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# malformed mach-o: load commands size (...) > 32768
The way GHC constructs dylibs, and the way cabal places dylibs with `cabal new-build`, can
result in load-command-size blowups.
This repository is a reproduction case to illustrate the issue.
# Build
```shell
$ cat cabal.project|grep -v "^packages"|xargs cabal unpack
$ cabal new-build
```
the first command will unpack all packages listed in the `cabal.project` file; the second will then build the project with `cabal new-build`. This should (while the issue persists) yield the following (or similar error):
```
ghc: panic! (the 'impossible' happened)
(GHC version 8.4.1 for x86_64-apple-darwin):
Loading temp shared object failed: dlopen(/var/folders/fv/xqjrpfj516n5xq_m_ljpsjx00000gn/T/ghc75192_0/libghc_19.dylib, 5): no suitable image found. Did find:
/var/folders/fv/xqjrpfj516n5xq_m_ljpsjx00000gn/T/ghc75192_0/libghc_19.dylib: malformed mach-o: load commands size (34104) > 32768
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
```