堆栈构建因LLD错误而失败

时间:2019-12-19 23:15:39

标签: haskell haskell-stack lld

我正在尝试使用stack(特别是haskell-ide-enginehlint)构建一些Haskell软件包,但是它们都失败,并显示许多ld.lld错误消息,所有错误消息都与R_X86_64_32S重定位,例如:

ld.lld: error: can't create dynamic relocation R_X86_64_32S against symbol: stg_bh_upd_frame_info in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in /home/kas/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/rts/libHSrts_thr.a(Updates.thr_o)
>>> referenced by /home/kas/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o:(s6WS_info)

我尝试将stack配置为使用其他链接器(使用ghc-options标志),但是我无法使其正常工作,并且始终使用lld

有人知道我如何更改stack的链接程序,或以其他方式解决该错误吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

请参阅 stack 自己的常见问题解答中的 this 答案!