Compiling ghc with -fPIC support

心不动则不痛 提交于 2019-11-30 17:19:22

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!