Bootstrapping ghc through cross-build?

Samuel Thibault sthibault at debian.org
Wed Jul 31 21:14:06 BST 2024


Hello,

I'm trying to bootstrap ghc on hurd-amd64 through cross-building from
i386 using ghc version 9.0.2-4, but this is failing this way:

"/usr/bin/ghc" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O -lffi -optl-pthread -O0 -H64m -Wall   -package-db libraries/bootstrapping.conf  -this-unit-id text-1.2.5.0 -hide-all-packages -package-env - -i -ilibraries/text/src -ilibraries/text/dist-boot/build -Ilibraries/text/dist-boot/build -ilibraries/text/dist-boot/build/./autogen -Ilibraries/text/dist-boot/build/./autogen -Ilibraries/text/include -Ilibraries/text/dist-boot/build/include    -optP-include -optPlibraries/text/dist-boot/build/./autogen/cabal_macros.h -package-id array-0.5.4.0 -package-id base-4.15.1.0 -package-id binary-0.8.8.0 -package-id bytestring-0.10.12.1 -package-id deepseq-1.4.5.0 -package-id ghc-prim-0.7.0 -package-id template-haskell-2.17.0.0 -Wall -fwarn-tabs -funbox-strict-fields -O2 -XHaskell2010 -XNondecreasingIndentation   -no-user-package-db -rtsopts  -fno-warn-deprecated-flags      -outputdir libraries/text/dist-boot/build   -c libraries/text/src/Data/Text/Array.hs -o libraries/text/dist-boot/build/Data/Text/Array.o
In file included from includes/Rts.h:216,

In file included from includes/Rts.h:216,

                 from compiler/cbits/cutils.c:6:0: error:
includes/rts/storage/Block.h: In function 'Bdescr':

In file included from includes/Rts.h:216,

                 from compiler/cbits/keepCAFsForGHCi.c:1:0: error:                 from compiler/cbits/genSym.c:1:0: error:

includes/rts/storage/Block.h: In function 'Bdescr':
includes/rts/storage/Block.h: In function 'Bdescr':


includes/rts/storage/Block.h:193:8: error:
     warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      193 |     ((((W_)p &  MBLOCK_MASK & ~BLOCK_MASK) >> (BLOCK_SHIFT-BDESCR_SHIFT))
          |        ^
    |
193 |     ((((W_)p &  MBLOCK_MASK & ~BLOCK_MASK) >> (BLOCK_SHIFT-BDESCR_SHIFT))
    |        ^


It looks like it's confusing the pointer size of the builder and the
target? (SIZEOF_VOID_P is defined to 8 in config.logand mk/config.h)

Does one have to use a 64bit host to build for a 64bit target?
(this is not convenient since the rebootstrap script currently doesn't
support cross-building foo-amd64 on bar-amd64)

Is there another way to produce a ghc binary that can be used to build
ghc.deb?

Samuel



More information about the Pkg-haskell-maintainers mailing list