使用LLD时,Stack构建失败

4
我正在尝试使用stack(特别是haskell-ide-enginehlint)构建一些Haskell包,但它们都失败了,并出现许多与R_X86_64_32S重定位相关的ld.lld错误消息,例如:
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)

我尝试使用 ghc-options 标志来配置stack使用不同的链接器,但是无法使其工作,并且始终使用 lld

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

谢谢!


我认为关键点是 -fPIC 标志。 - Bob Dalgleish
1
谢谢!我应该在哪里设置那个标志? - Kasra Ferdowsi
1个回答

0

stack 的常见问题解答中查看 this 的回答!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接