Opened 6 years ago

Closed 5 years ago

#8115 closed bug (fixed)

GHC 64-bit Windows build failures with LLVM

Reported by: schyler Owned by:
Priority: highest Milestone:
Component: Compiler (LLVM) Version: 7.6.3
Keywords: Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

When using LLVM 2.9, 3.1 or 3.4svn on Windows with the 64-bit GHC from the downloads page (http://www.haskell.org/ghc/download_ghc_7_6_3) to compile this simple program;

main = print "Hello!"

I get these errors;

Kyle@kyle-laptop /c/Users/Kyle/Desktop$ ghc -fllvm -fforce-recomp test.hs
[1 of 1] Compiling Main             ( test.hs, test.o )
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s: Assembler messages:
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:2: Error: junk at end of line, first unrecognized character is `,'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:3: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:3: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:7: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:7: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:10: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:10: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:17: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:17: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:19: Error: junk at end of line, first unrecognized character is `,'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:20: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:20: Error: junk at end of line, first unrecognized character is `c'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:24: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:24: Error: junk at end of line, first unrecognized character is `c'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:26: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:26: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:31: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:31: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:34: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:34: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:41: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:41: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:43: Error: junk at end of line, first unrecognized character is `,'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:44: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:44: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:50: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:50: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:53: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:53: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:61: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:61: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:63: Error: junk at end of line, first unrecognized character is `,'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:64: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:64: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:69: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:69: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:72: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:72: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:80: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:80: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:82: Error: junk at end of line, first unrecognized character is `"'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:85: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:85: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:91: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:91: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:95: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:95: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:137: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:137: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:140: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:140: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:146: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:146: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:150: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:150: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:192: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:192: Error: junk at end of line, first unrecognized character is `s'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:195: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:195: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:202: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:202: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:207: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:207: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:250: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:250: Error: junk at end of line, first unrecognized character is `M'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:253: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:253: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:260: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:260: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:266: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:266: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:308: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:308: Error: junk at end of line, first unrecognized character is `Z'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:310: Warning: .type pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:310: Error: junk at end of line, first unrecognized character is `_'
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:315: Warning: .size pseudo-op used outside of .def/.endef ignored.
C:\Users\Kyle\AppData\Local\Temp\ghc6708_0\ghc6708_0.s:315: Error: junk at end of line, first unrecognized character is `_'

Invocation is ghc -fllvm test.hs.

ghc --info:

Kyle@kyle-laptop /c/Users/Kyle/Desktop$ ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("GCC extra via C opts"," -fwrapv")
 ,("C compiler command","$topdir/../mingw/bin/gcc.exe")
 ,("C compiler flags"," -fno-stack-protector  -Wl,--hash-size=31 -Wl,--reduce-memory-overheads")
 ,("ar command","$topdir/../mingw/bin/ar.exe")
 ,("ar flags","q")
 ,("ar supports at file","YES")
 ,("touch command","$topdir/touchy.exe")
 ,("dllwrap command","$topdir/../mingw/bin/dllwrap.exe")
 ,("windres command","$topdir/../mingw/bin/windres.exe")
 ,("perl command","$topdir/../perl/perl.exe")
 ,("target os","OSMinGW32")
 ,("target arch","ArchX86_64")
 ,("target word size","8")
 ,("target has GNU nonexec stack","False")
 ,("target has .ident directive","True")
 ,("target has subsections via symbols","False")
 ,("LLVM llc command","llc")
 ,("LLVM opt command","opt")
 ,("Project version","7.6.3")
 ,("Booter version","7.6.1")
 ,("Stage","2")
 ,("Build platform","x86_64-unknown-mingw32")
 ,("Host platform","x86_64-unknown-mingw32")
 ,("Target platform","x86_64-unknown-mingw32")
 ,("Have interpreter","YES")
 ,("Object splitting supported","YES")
 ,("Have native code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
 ,("Tables next to code","YES")
 ,("RTS ways","l debug  thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn")
 ,("Leading underscore","NO")
 ,("Debug on","False")
 ,("LibDir","C:\\Program Files\\Haskell Platform\\2013.2.0.0\\lib")
 ,("Global Package DB","C:\\Program Files\\Haskell Platform\\2013.2.0.0\\lib\\package.conf.d")
 ,("Gcc Linker flags","[\"-Wl,--hash-size=31\",\"-Wl,--reduce-memory-overheads\"]")
 ,("Ld Linker flags","[\"--hash-size=31\",\"--reduce-memory-overheads\"]")
 ]

No output binary is produced.

Same llvm used with 32-bit ghc works smoothly to compile the same program.

Change History (9)

comment:1 Changed 6 years ago by dterei

Thanks for the report. Yes sadly at this time 64bit windows isn't supported.

comment:2 Changed 6 years ago by ezyang

Summary: GHC 64-bit build failures with LLVMGHC 64-bit Windows build failures with LLVM

comment:3 Changed 6 years ago by schyler

Priority: normalhigh

Given -fllvm is a pretty important feature of GHC, I'm promoting this to high.

comment:4 Changed 6 years ago by schyler

Priority: highhighest

Fail to compile at all is probably just as important as some of the linker errors which have Highest priority. Maybe it's OK if I promote this.

comment:5 Changed 6 years ago by hvr

can somebody retry with GHC 7.8.1(RC)?

comment:6 Changed 5 years ago by awson

7.8.1 suffers from #7143.

Workaround -pgmlo opt -pgmlc llc works, but executable produced by 64-bit 7.8.1 from the following code:

import System.Mem (performMajorGC)

main = performMajorGC >> putStrLn "Done"

segfaults.

Switching off optimization does not help. Switching between LLVM 3.4 and 3.5svn does not help either.

Executable produced by 32-bit 7.8.1 works.

comment:7 Changed 5 years ago by awson

I think this ticket can be closed, because we have no this bug in 7.8+ (we have #7143 and #8974 though).

Last edited 5 years ago by awson (previous) (diff)

comment:8 Changed 5 years ago by thoughtpolice

Milestone: 7.10.1

Moving to 7.10.1.

comment:9 Changed 5 years ago by thomie

Component: CompilerCompiler (LLVM)
Milestone: 7.10.1
Resolution: fixed
Status: newclosed

Closing at awson's suggestion. Should be fixed in 7.8.3, please reopen if it is not. A fix for #7143 will be available in the next release, #8974 is still unsolved.

Note: See TracTickets for help on using tickets.