Compiling ghc with -fPIC support

前端 未结 2 737
情话喂你
情话喂你 2021-01-03 22:29

I\'m trying to install GHC with -fPIC support in Fedora. I\'ve grabbed a source tarball since it seems no binary one has this.

In Build.mk i\'ve changed the quick bu

相关标签:
2条回答
  • 2021-01-03 23:04

    There's an FAQ entry on this topic on the Haskell Stack page.

    It basically says the problem is environment related and sometimes non-deterministic.

    The issue may be related to the use of hardening flags in some cases, specifically those related to producing position independent executables (PIE).

    There's also a work around suggestion for Arch Linux:

    On Arch Linux, installing the ncurses5-compat-libs package from AUR resolves this issue.

    0 讨论(0)
  • 2021-01-03 23:15

    After you see this error, do the following:

    cd /tmp/Hs2lib924498/
    ghc -fglasgow-exts --make -shared -oHs2lib.a /tmp/Hs2lib924498/Hs2lib.hs dllmain.o -static -fno-warn-deprecated-flags -fPIC -O2 -package ghc -package Hs2lib -i/home/phyx/Documents/Haskell/Hs2lib -optl-Wl,-s -funfolding-use-threshold=16 -optc-O3 -optc-ffast-math
    

    Note I added -fPIC to the failed ghc command.

    Once the command succeeds, continue the compilation from within the tmp directory without cleaning already compiled files. It should skip them and continue where it ended.

    0 讨论(0)
提交回复
热议问题