haskell / haskell/cabal

cabal repl can fail with C sources not linked -fPIC

Open
#2,590 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Seen running `cabal repl` in git-annex:

relocation R_X86_64_PC32 against undefined symbol `statvfs@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

I suppose this is because the relevant C source file is included in an Executable stanza in my cabal file. Since it's not built as a library, cabal doesn't build it -fPIC.

Workaround: cabal configure --enable-executable-dynamic

```
cabal-install version 1.22.0.1
using version 1.22.1.1 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 7.8.4
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.