无法使用llvm后端构建“text”包

时间:2017-06-20 23:23:52

标签: haskell llvm ghc

我有64位的ghc-8.0.1和llvm-3.7.0。我正在尝试像这样安装'text'包:

cabal install text-1.2.2.2 --ghc-options="-fllvm -pgmlo opt -pgmlc llc -optlc-O4 -v -keep-llvm-files -keep-tmp-files"

它失败并显示以下消息:

*** Assembler:
"C:\Program Files\Haskell Platform\8.0.1\lib/../mingw/bin/gcc.exe" "-fno-stack-protector" "-DTABLES_NEXT_TO_CODE" "-I.\Data\Text" "-Idist/dist-sandbox-a883bd5e\build" "-Idist/dist-sandbox-a883bd5e\build" "-Idist/dist-sandbox-a883bd5e\build\autogen" "-Idist/dist-sandbox-a883bd5e\build" "-Iinclude" "-IC:\Program Files\Haskell Platform\8.0.1\mingw\include" "-x" "assembler" "-c" "C:\Users\alex\AppData\Local\Temp\ghc7728_0\ghc_190.s" "-o" "dist/dist-sandbox-a883bd5e\build\Data\Text\Read.o"
C:\Users\alex\AppData\Local\Temp\ghc7728_0\ghc_190.s: Assembler messages:
C:\Users\alex\AppData\Local\Temp\ghc7728_0\ghc_190.s:29453: Error: junk at end of line, first unrecognized character is `,'
C:\Users\alex\AppData\Local\Temp\ghc7728_0\ghc_190.s:29490: Error: junk at end of line, first unrecognized character is `,'
C:\Users\alex\AppData\Local\Temp\ghc7728_0\ghc_190.s:29539: Error: junk at end of line, first unrecognized character is `,'
`gcc.exe' failed in phase `Assembler'. (Exit code: 1)
cabal: Leaving directory 'C:\Users\alex\AppData\Local\Temp\cabal-tmp-9212\text-1.2.2.2'
cabal: Error: some packages failed to install:
text-1.2.2.2 failed during the building phase. The exception was:
ExitFailure 1

C:\Users\alex\AppData\Local\Temp\ghc7728_0\ghc_190.s文件包含:

第29453行附近:

29442:  c4pto_info$def:
29443:  # BB#0:                                 # %c4pto
29444:      movsd   %xmm1, 32(%rbp)
29445:      addq    $8, %rbp
29446:      rex64 jmp   c4ppb_entry$def # TAILCALL
29447:  
29448:      .def     c4prM_info$def;
29449:      .scl    3;
29450:      .type   32;
29451:      .endef
29452:      .globl  __real@4024000000000000
29453:      .section    .rdata,"dr",discard,__real@4024000000000000
29454:      .align  8
29455:  __real@4024000000000000:
29456:      .quad   4621819117588971520     # double 10
29457:      .text
29458:      .align  16, 0x90
29459:      .quad   (S470B_srt$def-c4prM_info$def)+1024 # @"c4prM_info$def"
29460:      .quad   1925                    # 0x785
29461:      .quad   4294967328              # 0x100000020
29462:  c4prM_info$def:

第29490行附近:

29479:  .LBB697_4:                              # %u4pwu
29480:      addq    $48, %rbp
29481:      movq    textzm1zi2zi2zi2zm9RlRQEEESJb1LT1TjepTtH_DataziTextziRead_zdszc1_closure$def(%rip), %rax
29482:      movl    $textzm1zi2zi2zi2zm9RlRQEEESJb1LT1TjepTtH_DataziTextziRead_zdszc1_closure$def, %ebx
29483:      rex64 jmpq  *%rax           # TAILCALL
29484:  
29485:      .def     c4psR_info$def;
29486:      .scl    3;
29487:      .type   32;
29488:      .endef
29489:      .globl  __xmm@80000000000000008000000000000000
29490:      .section    .rdata,"dr",discard,__xmm@80000000000000008000000000000000
29491:      .align  16
29492:  __xmm@80000000000000008000000000000000:
29493:      .quad   -9223372036854775808    # 0x8000000000000000
29494:      .quad   -9223372036854775808    # 0x8000000000000000
29495:      .text
29496:      .align  16, 0x90
29497:      .quad   1925                    # @"c4psR_info$def"
29498:                                          # 0x785
29499:      .quad   32                      # 0x20
29500:  c4psR_info$def:

第29539行附近:

29521:    .LBB698_4:                              # %c4ptk
29522:      movq    $ghczmprim_GHCziTuple_Z2T_con_info, 24(%rax)
29523:      leaq    -47(%r12), %rdx
29524:      movq    %rdx, 32(%rax)
29525:      movq    %rcx, 40(%rax)
29526:      movq    $base_DataziEither_Right_con_info, 48(%rax)
29527:      leaq    -31(%r12), %rcx
29528:      movq    %rcx, 56(%rax)
29529:      movq    48(%rbp), %rax
29530:      addq    $48, %rbp
29531:      leaq    -6(%r12), %rbx
29532:      rex64 jmpq  *%rax           # TAILCALL
29533:    
29534:      .def     c4ps8_info$def;
29535:      .scl    3;
29536:      .type   32;
29537:      .endef
29538:      .globl  __real@3ff0000000000000
29539:      .section    .rdata,"dr",discard,__real@3ff0000000000000
29540:      .align  8
29541:    __real@3ff0000000000000:
29542:      .quad   4607182418800017408     # double 1
29543:      .text
29544:      .align  16, 0x90
29545:      .quad   1925                    # @"c4ps8_info$def"
29546:                                            # 0x785
29547:      .quad   32                      # 0x20
29548:    c4ps8_info$def:

我使用llvm后端安装了其他软件包,到目前为止只有'text'失败。

1 个答案:

答案 0 :(得分:0)

在使用llvm 3.7和GHC 8.0.2的OS-X系统上,我能够(在临时目录中):

cabal sandbox init
cabal install text-1.2.2.2 --ghc-options="-fllvm -pgmlo opt -pgmlc llc -optlc-O4 -v -keep-llvm-files -keep-tmp-files"

产生的重要文字以:

结尾
...
Created temporary directory: /var/folders/0x/hlxcgy9n5714ryp0gkn5hkmm0000gp/T/ghc6374_0
*** C Compiler:
/usr/bin/gcc -m64 -fno-stack-protector -DTABLES_NEXT_TO_CODE -x c /var/folders/0x/hlxcgy9n5714ryp0gkn5hkmm0000gp/T/16807282475249.c -o /var/f
olders/0x/hlxcgy9n5714ryp0gkn5hkmm0000gp/T/ghc6374_0/ghc_1.s -fno-common -U__PIC__ -D__PIC__ -Wimplicit -S '-D__GLASGOW_HASKELL__=800' -inclu
de /usr/local/lib/ghc-8.0.2/include/ghcversion.h -I/usr/local/lib/ghc-8.0.2/base-4.9.1.0/include -I/usr/local/lib/ghc-8.0.2/integer-gmp-1.0.0
.1/include -I/usr/local/lib/ghc-8.0.2/include
*** Clang (Assembler):
clang -m64 -fno-stack-protector -DTABLES_NEXT_TO_CODE -fno-common -U__PIC__ -D__PIC__ -Qunused-arguments -x assembler -c /var/folders/0x/hlxc
gy9n5714ryp0gkn5hkmm0000gp/T/ghc6374_0/ghc_1.s -o /var/folders/0x/hlxcgy9n5714ryp0gkn5hkmm0000gp/T/1622650073984943658.o
Resolving dependencies...
Notice: installing into a sandbox located at /private/tmp/x/.cabal-sandbox
Configuring text-1.2.2.2...
Building text-1.2.2.2...
Installed text-1.2.2.2
cabal install text-1.2.2.2   218.77s user 8.27s system 98% cpu 3:49.67 total

因此,简而言之,这是一个不可复制的(由我)平台/工具问题。我建议你尝试GHC 8.0.2,因为8.0.1是,更好。也许值得一看GHC trac上特定于Windows的错误。