Skip to content

Windows Cross broken.

The changes from the ghc-toolchain; appear to have resulted in broken configure for cross compilers. My GHC now reports:

x86_64-w64-mingw32-ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("C compiler command","x86_64-w64-mingw32-cc")
 ,("C compiler flags",".")
 ,("C++ compiler command","x86_64-w64-mingw32-c++")
 ,("C++ compiler flags",".")

which then causes Hadrian to invoke:

x86_64-w64-mingw32-ghc -hide-all-packages -c /run/user/1000/1226304-0.c -o /run/user/1000/1226304-1.o -no-global-package-db '-package-db=_build/stage1/inplace/package.conf.d' '-ghcversion-file=rts/include/ghcversion.h' '-ghcversion-file=rts/include/ghcversion.h'

(not sure why it feels like it needs to pass ghcversion.h twice).

This subsequently ends up invoking the following amazing command:

x86_64-w64-mingw32-cc -x c -c /run/user/1000/1226304-0.c -o /run/user/1000/1226304-1.o.tmp -Wa,-mbig-obj -Wimplicit -include rts/include/ghcversion.h .

Note the . at the end.

This ultimately complains about

x86_64-w64-mingw32-gcc: fatal error: cannot specify '-o' with '-c', '-S' or '-E' with multiple files

/cc @alt-romes


the configure phase printed the following:

configure: WARNING:
There are some differences between the toolchain configured by "configure" (hadrian/cfg/default.target) and the toolchain configured by the "ghc-toolchain" program (hadrian/cfg/default.target.ghc-toolchain).

3c3
< , tgtVendor = Just "unknown"
---
> , tgtVendor = Just "w64"
18c18
< , tgtHsCPreprocessor = HsCpp {hsCppProgram = Program {prgPath = "x86_64-w64-mingw32-cc", prgFlags = ["-E","-undef","-traditional"]}}
---
> , tgtHsCPreprocessor = HsCpp {hsCppProgram = Program {prgPath = "x86_64-w64-mingw32-cc", prgFlags = ["-E","-undef","-traditional","-Wno-invalid-pp-token","-Wno-unicode","-Wno-trigraphs"]}}
20c20
< { ccLinkProgram = Program {prgPath = "x86_64-w64-mingw32-cc", prgFlags = ["-fstack-check"]}
---
> { ccLinkProgram = Program {prgPath = "x86_64-w64-mingw32-cc", prgFlags = ["-fuse-ld=gold","-fstack-check"]}
35c35
< , tgtRanlib = Just (Ranlib {ranlibProgram = Program {prgPath = "x86_64-w64-mingw32-ranlib", prgFlags = []}})
---
> , tgtRanlib = Just (Ranlib {ranlibProgram = Program {prgPath = "x86_64-w64-mingw32-ranlib", prgFlags = []}})
38c38
< , tgtWindres = Nothing
---
> , tgtWindres = Just (Program {prgPath = "x86_64-w64-mingw32-windres", prgFlags = []})

Don't worry! This won't affect your ghc in any way.
However, in a near future, we will move to configuring toolchains with "ghc-toolchain" by default, so you might have discovered a future bug.

(that message is fairly hard to parse, which file is left side, which one is right side of the diff?)

Edited by Moritz Angermann
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information