commercialhaskell / commercialhaskell/stack
GHC 8.0.1 from lts-7.0 should link binaries against system libffi.so or ship pkgconfig for bundled libffi.so.6
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### Steps to reproduce
1. Unpack `libffi` sources with `stack unpack libffi-0.1; cd libffi-0.1`
2. Build it with stack and GHC 8:
```
$ stack init --resolver lts-7.0
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- libffi.cabal
Selected resolver: lts-7.0
Initialising configuration using resolver: lts-7.0
Total number of user packages considered: 1
Writing configuration to file: stack.yaml
All done.
$ stack build
libffi-0.1: configure
Configuring libffi-0.1...
libffi-0.1: build
Preprocessing library libffi-0.1...
[1 of 5] Compiling Foreign.LibFFI.Internal ( .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Foreign/LibFFI/Internal.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Foreign/LibFFI/Internal.o )
[2 of 5] Compiling Foreign.LibFFI.FFITypes ( Foreign/LibFFI/FFITypes.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Foreign/LibFFI/FFITypes.o )
[3 of 5] Compiling Foreign.LibFFI.Base ( Foreign/LibFFI/Base.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Foreign/LibFFI/Base.o )
[4 of 5] Compiling Foreign.LibFFI.Types ( Foreign/LibFFI/Types.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Foreign/LibFFI/Types.o )
[5 of 5] Compiling Foreign.LibFFI ( Foreign/LibFFI.hs, .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Foreign/LibFFI.o )
libffi-0.1: copy/register
Installing library in
/home/develop7/src/libffi-0.1/.stack-work/install/x86_64-linux/lts-7.0/8.0.1/lib/x86_64-linux-ghc-8.0.1/libffi-0.1-DfCwpmlcCM5IjHI8z7yXcV
Registering libffi-0.1...
```
3. See what `libffi` is it linked against with `ldd ~/.stack-work/install/x86_64-linux/lts-7.0/8.0.1/lib/x86_64-linux-ghc-8.0.1/libffi-0.1-DfCwpmlcCM5IjHI8z7yXcV/libHSlibffi-0.1-DfCwpmlcCM5IjHI8z7yXcV-ghc8.0.1.so | grep ffi`
### Expected output
```
libffi.so.4 => /usr/lib64/libffi.so.4 (0x00007f2e67a85000)
```
### Actual
```
libffi.so.6 => /home/develop7/.stack/programs/x86_64-linux/ghc-8.0.1/lib64/ghc-8.0.1/rts/libffi.so.6 (0x00007fccd3b3d000)
```
### Stack version
```
$ stack --version
Version 1.2.0 x86_64 hpack-0.14.0
```
### Method of installation
- [x] Official binary, downloaded from stackage.org or fpcomplete's package repository
### NB
I've ran into this issue while digging through idris-lang/Idris-dev#3450
Contributor guide
Assessment
This issue has not been assessed yet.