FS#63224 - [ghc-static] Cannot link to static profiling libraries without dynamic reloc errors

Attached to Project: Community Packages
Opened by Joel Lathrop (joellathrop) - Thursday, 18 July 2019, 17:39 GMT
Last edited by Toolybird (Toolybird) - Thursday, 27 April 2023, 22:04 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When attempting to build a Cabal project using static linking and with profiling information, I get pages and pages of linker errors. A sampling follows below:

/usr/bin/ld.gold: error: /usr/lib/ghc-8.6.5/base-4.12.0.0/libHSbase-4.12.0.0_p.a(Maybe.p_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /usr/lib/ghc-8.6.5/base-4.12.0.0/libHSbase-4.12.0.0_p.a(Maybe.p_o): requires dynamic R_X86_64_32 reloc against 'base_DataziMaybe_mapMaybe_closure' which may overflow at runtime; recompile with -fPIC

Either I'm missing something I haven't found on the Arch Haskell wiki page, or perhaps the `ghc-static` libraries have some dynamic-linking taints to them?

Steps to reproduce:

* `sudo pacman -S ghc ghc-static cabal-install.`
* `cabal sandbox init`
* `cabal install --ghc-options='-static -prof' StateVar`

(And if it matters, installing `ghc-pristine` from the AUR and adding `--with-compiler=/usr/share/ghc-pristine/bin/ghc`, as suggested in the Arch Wiki Haskell page, makes no difference.)

Package version(s):
* ghc 8.6.5-1
* ghc-static 8.6.5-1
* cabal-install 2.4.0.0-109
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 27 April 2023, 22:04 GMT
Reason for closing:  None
Additional comments about closing:  See comments
Comment by Toolybird (Toolybird) - Thursday, 27 April 2023, 07:02 GMT
This looks pretty old and stale. Is it still an issue with latest pkgs?
Comment by Joel Lathrop (joellathrop) - Thursday, 27 April 2023, 13:42 GMT
I stopped using Arch GHC packages for development a long time ago, as I simply ran into too many issues. These days I simply use ghcup. So I'm ok with closing this issue, as it no longer affects me, and general consensus online seems to be toward using ghcup for dev on Arch.
Comment by Toolybird (Toolybird) - Thursday, 27 April 2023, 22:03 GMT
Thanks for getting back in touch and providing feedback :) The Wiki entry [1] appears to cover ghcup usage pretty well so that seems like the way to go.

[1] https://wiki.archlinux.org/title/haskell#ghcup

Loading...