Compile with `--via-asm` when cross compiling.
ClosedPublic

Authored by angerman on Feb 22 2018, 8:08 AM.

Details

Summary

This bumps hsc2hs and adds the new --via-asm flag,
which allows to successfully cross compile the win32
lirbary.

Test Plan

./validate

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 22 2018, 8:08 AM
bgamari accepted this revision.Feb 26 2018, 4:07 PM

Cool, sounds good to me.

This revision is now accepted and ready to land.Feb 26 2018, 4:07 PM
Closed by commit rGHC5f6fcf7808b1: Compile with `--via-asm` when cross compiling. (authored by Moritz Angermann <moritz.angermann@gmail.com>, committed by bgamari). · Explain WhyMar 2 2018, 4:38 PM
This revision was automatically updated to reflect the committed changes.
trofi added a subscriber: trofi.Mar 3 2018, 4:50 AM
trofi added inline comments.
mk/config.mk.in
656

I don't see a hsc2hs submodule bump bump and ghc-HEAD fails cross-compilation here:

"inplace/bin/hsc2hs" '--cc=sparc-unknown-linux-gnu-gcc' '--ld=sparc-unknown-linux-gnu-gcc'  --cross-safe  --cflag=-O2 --cflag=-pipe --cflag=-Wall --cflag=-fno-stack-protector   --cross-compile --via-asm --cflag=-Dsparc_HOST_ARCH --cflag=-Dlinux_HOST_OS --cflag=-D__GLASGOW_HASKELL__=805 '--cflag=-fno-stack-protector' '--cflag=-O2' '--cflag=-pipe' '--cflag=-Wall' '--cflag=-Icompiler/stage2/build/./autogen' '--cflag=-Icompiler/.' '--cflag=-Icompiler/parser' '--cflag=-Icompiler/utils' '--cflag=-Icompiler/../rts/dist/build' '--cflag=-Icompiler/stage2' '--cflag=-DGHCI' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/process/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/directory/.' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/unix/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/time/lib/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/containers/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/bytestring/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/base/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/libraries/integer-gmp/include' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/rts/dist/build' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/includes' '--cflag=-I/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/includes/dist-derivedconstants/header' '--cflag=-Werror=unused-but-set-variable' '--cflag=-Wno-error=inline' '--lflag=-Wl,-O1' --cflag=-Icompiler/stage2/build/./autogen --cflag=-include --cflag=compiler/stage2/build/./autogen/cabal_macros.h   compiler/utils/Fingerprint.hsc -o compiler/stage2/build/Fingerprint.hs
sed -e '/hs$/ p' -e '/hs$/ s/o /hi /g' -e '/hs$/ s/:/ : %hi: %o /' -e '/hs$/ s/^/$(eval $(call hi-rule,/' -e '/hs$/ s/$/))/' -e '/hs-boot$/ p' -e '/hs-boot$/ s/o-boot /hi-boot /g' -e '/hs-boot$/ s/:/ : %hi-boot: %o-boot /' -e '/hs-boot$/ s/^/$(eval $(call hi-rule,/' -e '/hs-boot$/ s/$/))/' utils/ghc-cabal/dist-install/build/.depend.haskell.tmp2 > utils/ghc-cabal/dist-install/build/.depend.haskell
sed -e 's|\\|/|g' -e 's| /$| \\|' -e "1s|\.o|\.o|" -e "1s|^|compiler/parser/|" -e "1s|compiler/|compiler/stage2/build/|" -e "1s|stage2/build/stage2/build|stage2/build|g" -e "s|^/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/||g" compiler/stage2/build/.depend-v-dyn.c_asm.bit >> compiler/stage2/build/.depend-v-dyn.c_asm.tmp && sed -e 's|\\|/|g' -e 's| /$| \\|' -e "1s|\.o|\.dyn_o|" -e "1s|^|compiler/parser/|" -e "1s|compiler/|compiler/stage2/build/|" -e "1s|stage2/build/stage2/build|stage2/build|g" -e "s|^/tmp/portage-tmpdir/portage/cross-sparc-unknown-linux-gnu/ghc-9999/work/ghc-9999/||g" compiler/stage2/build/.depend-v-dyn.c_asm.bit >> compiler/stage2/build/.depend-v-dyn.c_asm.tmp && true  
un"rm" -f compiler/stage2/ghc_boot_platform.h  
recognized option `--via-asm'
Usage: hsc2hs [OPTIONS] INPUT.hsc [...]

What am I missing?

angerman added inline comments.Mar 3 2018, 5:16 AM
mk/config.mk.in
656

This diff is actually missing the hsc2hs bump O_o. That should have been part of this diff.