Haskell堆栈安装ghc-mod在旧时和时钟失败

时间:2018-01-02 18:55:59

标签: haskell haskell-stack ghc-mod

通过堆栈安装ghc-mod失败。我已经尝试了所有我发现google的解决方案无济于事。我安装了快乐和亚历克斯。我发现的所有其他解决方案都是1-2岁,与升级到GHC 8有关。

  

ERROR OUTPUT

     

stack install ghc-mod

     

clock-0.7.2:configure

     

clock-0.7.2:build

     

old-time-1.1.0.3:configure

     

OLDTIME LOG

--  While building custom Setup.hs for package old-time-1.1.0.3 using:   

/tmp/stack23769/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 configure --with-ghc=/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc --with-ghc-pkg=/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/pkgdb --libdir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/lib --bindir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/bin --datadir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/share --libexecdir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/libexec --sysconfdir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/etc --docdir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/doc/old-time-1.1.0.3 --htmldir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/doc/old-time-1.1.0.3 --haddockdir=/home/ian/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.18/8.0.2/doc/old-time-1.1.0.3 --dependency=base=base-4.9.1.0 --dependency=old-locale=old-locale-1.0.0.7-KGBP1BSKxH5GCm0LnZP04j
Process exited with code: ExitFailure 1
Logs have been written to: /home/ian/.stack/global-project/.stack-work/logs/old-time-1.1.0.3.log


[1 of 2] Compiling Main             ( /tmp/stack23769/old-time-1.1.0.3/Setup.hs, /tmp/stack23769/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/Main.o )
[2 of 2] Compiling StackSetupShim   ( /home/ian/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack23769/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/StackSetupShim.o )
Linking /tmp/stack23769/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup ...
Configuring old-time-1.1.0.3...
configure: WARNING: unrecognized options: --with-compiler     checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/stack23769/old-time-1.1.0.3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
     

时钟记录

--  While building custom Setup.hs for package clock-0.7.2 using:
  /home/ian/.stack/setup-exe-cache/x86_64-linux-tinfo6-nopie/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"

Process exited with code: ExitFailure 1

Logs have been written to: /home/ian/.stack/global-project/.stack-work/logs/clock-0.7.2.log

Configuring clock-0.7.2...
Building clock-0.7.2...
Preprocessing library clock-0.7.2...
/tmp/stack23769/clock-0.7.2/Clock.hsc:44:0: warning: "hsc_alignment" redefined
/tmp/stack23769/clock-0.7.2/In file included from .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_make.c:1:0:
/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/template-hsc.h:88:0: note: this is the location of the previous definition
 #define hsc_alignment(t...) \

/usr/bin/ld: .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_make.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
linking .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_make.o failed (exit code 1)
command was: /usr/bin/gcc .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_make.o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_utils.o -o .stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/build/System/Clock_hsc_make -fno-PIE -fno-stack-protector -L/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -Wl,-R,/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/base-4.9.1.0 -L/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -Wl,-R,/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/integer-gmp-1.0.0.1 -lgmp -L/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -Wl,-R,/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/ghc-prim-0.5.0.0 -L/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -Wl,-R,/home/ian/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/lib/ghc-8.0.2/rts -lm -lrt -ldl -lpthread

1 个答案:

答案 0 :(得分:1)

你使用的是arch linux吗?以下是解决此问题的新方法:https://github.com/commercialhaskell/stack/blob/2a715639fe20b5dccb84f6a37ed54d650fdcf119/doc/faq.md#i-get-strange-ld-errors-about-recompiling-with--fpic

解决此问题的旧方法是将ghc-build: tinfo6添加到~/.stack/config.yaml,但这需要再次下载和安装ghc。