Various Windows / Cross Compile to Windows fixes
ClosedPublic

Authored by angerman on Feb 21 2018, 7:59 AM.

Details

Summary
  • Adds quick-cross-ncg flavour.
  • Fix windows wchar with _s for mingw
  • Lookup windres, dllwrap and objdump
  • Fix type.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
angerman created this revision.Feb 21 2018, 7:59 AM
angerman added inline comments.Feb 21 2018, 8:02 AM
configure.ac
421–424

if we don't bundle th mingw toolchain, we might still want to lookup those tools with the target prefix.

mk/config.mk.in
656–657 ↗(On Diff #15522)

--via-asm reqires haskell/hsc2hs#5

rts/PathUtils.c
12

These are needed for MinGW to expose the _s suffixed functions.

rts/win32/OSMem.c
461

See L452

Can you add some notes regarding this cross-compilation configuration to the wiki?

rts/win32/OSMem.c
461

Good catch.

Can you add some notes regarding this cross-compilation configuration to the wiki?

At this point, this almost works out of the box. If you have the mingw64 toolchain in $PATH, ./boot && ./configure --target=x86_64-w64-mingw32 && make -j after setting mk/build.mk appropriately will "just work" (assuming the hsc2hs patch).

angerman updated this revision to Diff 15534.EditedFeb 22 2018, 8:06 AM
  • drop hsc2hs related changes. (end up in a different diff: D4439)
angerman edited the summary of this revision. (Show Details)Feb 22 2018, 8:09 AM

Can you add some notes regarding this cross-compilation configuration to the wiki?

At this point, this almost works out of the box. If you have the mingw64 toolchain in $PATH, ./boot && ./configure --target=x86_64-w64-mingw32 && make -j after setting mk/build.mk appropriately will "just work" (assuming the hsc2hs patch).

I've re-read the wiki, and I don't know what to add exactly that isn't already covered. I do think however we should move CrossCompiling, Building/CrossCompiling, Building/CrossCompiling/iOS into a single document eventually. I'd prefer this to be https://github.com/zw3rk/ghc-dev (even better under the ghc org).

angerman updated this revision to Diff 15542.Feb 23 2018, 1:13 AM
angerman edited the summary of this revision. (Show Details)
  • rebase
  • drop flavour change

Can you add some notes regarding this cross-compilation configuration to the wiki?

At this point, this almost works out of the box. If you have the mingw64 toolchain in $PATH, ./boot && ./configure --target=x86_64-w64-mingw32 && make -j after setting mk/build.mk appropriately will "just work" (assuming the hsc2hs patch).

I've re-read the wiki, and I don't know what to add exactly that isn't already covered.

Alright, fair enough.

I do think however we should move CrossCompiling, Building/CrossCompiling, Building/CrossCompiling/iOS into a single document eventually. I'd prefer this to be https://github.com/zw3rk/ghc-dev (even better under the ghc org).

I think it would be quite reasonable to add building/packaging instructions to the users guide.

bgamari accepted this revision.Feb 26 2018, 5:36 PM
This revision is now accepted and ready to land.Feb 26 2018, 5:36 PM
Closed by commit rGHC4a0d0d8062a2: Various Windows / Cross Compile to Windows fixes (authored by Moritz Angermann <moritz.angermann@gmail.com>, committed by bgamari). · Explain WhyMar 2 2018, 3:24 PM
This revision was automatically updated to reflect the committed changes.