Cabal 安装在链接器阶段失败

Cabal install fails in Linker phase

我正在尝试安装 this 图形库,但 cabal-install 给我这个错误列表(只显示列表的底部,因为上面的所有内容都很长且相似):

/usr/bin/ld:
/usr/local/haskell/ghc-8.0.2-x86_64/lib/ghc-8.0.2/rts/libHSrts_thr.a(MarkWeak.thr_o):
relocation R_X86_64_32S against symbol `stg_END_TSO_QUEUE_closure' can not be
used when making a PIE object; recompile with -fPIC
/usr/bin/ld:
/usr/local/haskell/ghc-8.0.2-x86_64/lib/ghc-8.0.2/rts/libHSrts_thr.a(Evac.thr_o):
relocation R_X86_64_32 against symbol `stg_WHITEHOLE_info' can not be used
when making a PIE object; recompile with -fPIC
/usr/bin/ld:
/usr/local/haskell/ghc-8.0.2-x86_64/lib/ghc-8.0.2/rts/libCffi.a(closures.o):
relocation R_X86_64_32 against `.rodata' can not be used when making a PIE
object; recompile with -fPIC
/usr/bin/ld:
/usr/local/haskell/ghc-8.0.2-x86_64/lib/ghc-8.0.2/rts/libCffi.a(ffi64.o):
relocation R_X86_64_32S against `.rodata' can not be used when making a PIE
object; recompile with -fPIC
/usr/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
)

到目前为止,我已经确定问题是由安装程序试图制作 Position Independent Executable (PIE) 引起的。我试图通过将 DEB_BUILD_HARDENING_PIE 环境变量设置为 0 export DEB_BUILD_HARDENING_PIE=0 来解决这个问题,但它给出了同样的错误。

我是 运行 Debian,ghc-8.0.2 和 cabal 1.24.2.0。

我没有编辑 DEB_BUILD_HARDENING_PIE 环境变量,而是找到了另一种让 cabal-install 不生成 PIE 的方法,这似乎解决了这个问题。

cabal --ghc-option="-optl-no-pie" install chart-diagrams