Skip to content

Binary distributions produced from cross-compiled stage2 are broken

The binary distribution by a cross-compiled build (e.g. configure with ./configure --target=$cross_target) is broken out of the box.

After untarring and configuring the bindist, make install fails due to missing files,

# make install
make --no-print-directory -f ghc.mk install BINDIST=YES NO_INCLUDE_DEPS=YES
ghc.mk:742: utils/ghctags/ghc.mk: No such file or directory
ghc.mk:742: utils/check-api-annotations/ghc.mk: No such file or directory
ghc.mk:742: utils/check-ppr/ghc.mk: No such file or directory
make[1]: *** No rule to make target 'utils/check-ppr/ghc.mk'.  Stop.
Makefile:51: recipe for target 'install' failed
make: *** [install] Error 2

This can be worked around by,

$ mkdir utils/ghctags utils/check-ppr utils/check-api-annotations
$ touch utils/hp2ps/dist/build/tmp/hp2ps \
        utils/ghctags/ghc.mk \
        utils/check-api-annotations/ghc.mk \
        utils/check-ppr/ghc.mk

I believe the reason for this is that these are utilities which would typically be built by the stage2 compiler, which we obviously are unable to build.

There are a few options for fixing this,

  • Produce a shell script throwing an error to sit in place of the unbuildable utilities
  • Fix the build system to include the appropriate ghc.mk files in the bindist, despite the utilities they build not being present
  • Include the sources for the utilities in the bindist and teach make install to build them
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information