Linker errors when using cmm-sources
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
~This seems to be an issue in `cabal-head` that isn't present in `3.10.2.1`.~
Trying to run a repl in the linked project leads to a linking error.
~But no such error is given in the previous version.~
The reproducer was extracted from ghc-debug, which is where the cmm file is taken from.
This issue is no longer triggered with ghc-debug HEAD as the cmm file has been removed since then.
**To Reproduce**
1. Checkout: https://github.com/TeofilC/cabal-repro-repl-cmm-sources
2. get cabal-head
3. run `cabal repl`
You will get the following output:
```
Configuring executable 'repro' for repro-0.1.0.0...
Preprocessing executable 'repro' for repro-0.1.0.0...
GHCi, version 9.4.7: https://www.haskell.org/ghc/ :? for help
/nix/store/zkjq96ik8cbv6ijh1lylnkk2bni9qvas-binutils-2.40/bin/ld.gold: error: /run/user/1000/tmp.z6oqCfS3t7/dist-newstyle/build/x86_64-linux/ghc-9.4.7/repro-0.1.0.0/x/repro/build/repro/repro-tmp/cbits/Repro.o: requires dynamic R_X86_64_PC32 reloc against 'stg_ARR_WORDS_info' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
Error: [Cabal-7125]
repl failed for exe:repro from repro-0.1.0.0.
```
**Expected behavior**
Should compile like before.
**System information**
- Operating system: NixOS
- cabal-head, ghc-9.4.7
Contributor guide
Assessment
This issue has not been assessed yet.