GHC 8.6 for macOS depends on homebrew
I guess the ghc-8.6.1-x86_64-apple-darwin.tar.xz is build with homebrew. So, it depends on homebrew's "libgmp".
Since I'm using MacPorts, the following error occurs on installation:
```
% sudo make install
"utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" copy libraries/ghc-prim dist-install "strip" '' '/usr/local/ghc-8.6.1' '/usr/local/ghc-8.6.1/lib/ghc-8.6.1' '/usr/local/ghc-8.6.1/share/doc/ghc-8.6.1/html/libraries' 'v p dyn'
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
Referenced from: /Users/kazu/Downloads/ghc-8.6.1/libraries/base/dist-install/build/libHSbase-4.12.0.0-ghc8.6.1.dylib
Reason: image not found
make[1]: *** [install_packages] Abort trap: 6
make: *** [install] Error 2
```
After make a link from "/usr/local/opt/gmp/lib/libgmp.10.dylib" to "/opt/local/lib/libgmp.10.dylib" installed by MacPorts, the installation succeeds.
But when using GHC 8.6.1, the following error occurs:
```
[15 of 15] Compiling Network.DNS ( Network/DNS.hs, dist/build/Network/DNS.o )
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
cab: callCommand: cabal build (exit 1): failed
```
To fix this, the following is necessary:
```
% export LIBRARY_PATH=/usr/lib:/opt/local/lib
```
- "/usr/lib" is for "libiconv" and should come first to hide "/opt/local/lib/libiconv"
- "/opt/local/lib" is for "libgmp"
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 8.6.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | highest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"GHC 8.6 for macOS depends on homebrew","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"8.6.2","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"8.6.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"I guess the ghc-8.6.1-x86_64-apple-darwin.tar.xz is build with homebrew. So, it depends on homebrew's \"libgmp\". \r\n\r\nSince I'm using MacPorts, the following error occurs on installation:\r\n\r\n{{{\r\n% sudo make install\r\n\r\n\"utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist\" copy libraries/ghc-prim dist-install \"strip\" '' '/usr/local/ghc-8.6.1' '/usr/local/ghc-8.6.1/lib/ghc-8.6.1' '/usr/local/ghc-8.6.1/share/doc/ghc-8.6.1/html/libraries' 'v p dyn' \r\ndyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib\r\n Referenced from: /Users/kazu/Downloads/ghc-8.6.1/libraries/base/dist-install/build/libHSbase-4.12.0.0-ghc8.6.1.dylib\r\n Reason: image not found\r\nmake[1]: *** [install_packages] Abort trap: 6\r\nmake: *** [install] Error 2\r\n}}}\r\n\r\nAfter make a link from \"/usr/local/opt/gmp/lib/libgmp.10.dylib\" to \"/opt/local/lib/libgmp.10.dylib\" installed by MacPorts, the installation succeeds.\r\n\r\nBut when using GHC 8.6.1, the following error occurs:\r\n\r\n{{{\r\n[15 of 15] Compiling Network.DNS ( Network/DNS.hs, dist/build/Network/DNS.o )\r\nld: library not found for -lgmp\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\n`gcc' failed in phase `Linker'. (Exit code: 1)\r\ncab: callCommand: cabal build (exit 1): failed\r\n}}}\r\n\r\nTo fix this, the following is necessary:\r\n\r\n{{{\r\n% export LIBRARY_PATH=/usr/lib:/opt/local/lib\r\n}}}\r\n\r\n- \"/usr/lib\" is for \"libiconv\" and should come first to hide \"/opt/local/lib/libiconv\"\r\n- \"/opt/local/lib\" is for \"libgmp\"\r\n","type_of_failure":"OtherFailure","blocking":[]} -->
issue