我在某些Haskell项目中使用堆栈。到目前为止,我还没有遇到任何麻烦。但是从lts-13.1开始,我得到了一个奇怪的内置错误。
当我使用stack new foo && cd foo
设置一个新项目,然后运行stack setup --ghc-build standard
时,我得到了这个巨大的重复错误消息:
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Interpreter.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(CheckUnload.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(CheckUnload.thr_o): requires dynamic R_X86_64_32 reloc against 'linker_unloaded_mutex' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Scav.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Scav.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Scav.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Scav.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Scav.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Scav.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Compact.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Compact.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Compact.thr_o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Evac_thr.thr_o): requires dynamic R_X86_64_32 reloc against 'stg_WHITEHOLE_info' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Evac_thr.thr_o): requires dynamic R_X86_64_32 reloc against 'stg_WHITEHOLE_info' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(MarkWeak.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(MarkWeak.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(MarkWeak.thr_o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Evac.thr_o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libHSrts_thr.a(Evac.thr_o): requires dynamic R_X86_64_32 reloc against 'stg_WHITEHOLE_info' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libCffi.a(ffi64.o): requires unsupported dynamic reloc 11; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libCffi.a(unix64.o): requires dynamic R_X86_64_PC32 reloc against 'abort' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libCffi.a(ffiw64.o): requires dynamic R_X86_64_32 reloc against 'ffi_closure_win64' which may overflow at runtime; recompile with -fPIC
...更多相同的东西...
/usr/bin/ld.gold: error: /home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/rts/libCffi.a(win64.o): requires dynamic R_X86_64_PC32 reloc against 'abort' which may overflow at runtime; recompile with -fPIC
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
`clang' failed in phase `Linker'. (Exit code: 1)
-- While building simple Setup.hs using:
/home/georg/.stack/programs/x86_64-linux/ghc-8.6.3/bin/ghc -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.4.0.1 /home/georg/.stack/setup-exe-src/setup-mPHDZzAJ.hs /home/georg/.stack/setup-
exe-src/setup-shim-mPHDZzAJ.hs -o /home/georg/.stack/setup-exe-cache/x86_64-
linux/tmp-Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.3
Process exited with code: ExitFailure 1
我认为这与lts-13.1 / 2或我的Arch Linux / gcc安装有关,因为当我在resolver: lts-13.2
中将resolver: lts-12.4
更改为stack.yaml
时,它可以正常运行。
我为--ghc-build
尝试了不同的选择,但均无济于事;在clang和gcc之间切换;我所有的堆栈和其他本地Haskell软件包都是最新的(我在Arch Linux上)。
我想使用Megaparsec 7.0.4的最新版本,该版本不属于lt-12.4(6.5版)。我可以使用堆栈/ cabal中的依赖项选项来解决此问题,但是我想知道为什么在我的计算机上连lts-13.2都不能建立一个空/新项目(lts-13.1也不起作用)。 This problem与我非常相似,但是那里提供的解决方案都不适合我。
我想念什么?
答案 0 :(得分:2)
显然,这是一个旧问题的重现:https://github.com/commercialhaskell/stack/issues/4497
似乎("C compiler supports -no-pie", "NO")
中的某些配置工具错误地设置了~/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.3/lib/ghc-8.6.3/settings
;手动将其更改为YES
可以使我构建项目。
因此,此问题显然是生成器工具堆栈使用的一个错误。注意这是一个“修补程序”;请通过我提供的链接关注Github上的问题,以保持最新状态。