porting ghc-6.4 to x86_64

Andrei A. Voropaev av at simcon-mt.com
Mon Mar 21 04:52:20 EST 2005


Hello!

I know that this has been done already (at least by RedHat), but since I
don't use RedHat (or any other distro of linux) and instead compiled
everything myself, I have to bootstrap ghc as well. So I'm carefully
following the instruction. On my host (i386) I have ghc-6.2.2 (and
ghc-6.4). Looks like I have some problem.

As far as I understand this should fail.

$ cd H/ghc && make boot && make
.....
==fptools== make all -r;
 in /usr/local/src/ghc-6.4/ghc/rts
------------------------------------------------------------------------
../../ghc/compiler/ghc-inplace -H16m -O -H32m -keep-hc-files -static -I. -#include Prelude.h -#include Rts.h -#include RtsFlags.h -#include RtsUtils.h -#include StgRun.h -#include Schedule.h -#include Printer.h -#include Sanity.h -#include STM.h -#include Storage.h -#include SchedAPI.h -#include Timer.h -#include Itimer.h -#include ProfHeap.h -#include LdvProfile.h -#include Profiling.h -#include Apply.h -fvia-C -dcmm-lint     -c Apply.cmm -o Apply.o
In file included from Apply.cmm:13:
/usr/local/src/ghc-6.4/ghc/includes/Cmm.h:288: #error mp_limb_t != StgWord: assumptions in PrimOps.cmm are now false
make[1]: *** [Apply.o] Error 1
make: *** [all] Error 1

But this is failing as well

$ cd H/ghc/compiler
$ make boot stage=2 && make stage=2
........
../../ghc/compiler/stage1/ghc-inplace -o stage2/ghc-6.4 -H16m -O -H32m  -istage2/utils  -istage2/basicTypes  -istage2/types  -istage2/hsSyn  -istage2/prelude  -istage2/rename  -istage2/typecheck  -istage2/deSugar  -istage2/coreSyn  -istage2/specialise  -istage2/simplCore  -istage2/stranal  -istage2/stgSyn  -istage2/simplStg  -istage2/codeGen  -istage2/main  -istage2/profiling  -istage2/parser  -istage2/cprAnalysis  -istage2/compMan  -istage2/ndpFlatten  -istage2/iface  -istage2/cmm -Istage2 -DOMIT_NATIVE_CODEGEN -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -IcodeGen -InativeGen -Iparser -package unix -package Cabal -recomp -Rghc-timing -O -fvia-C -keep-hc-files -H16M '-#include "hschooks.h"'    -no-link-chk    stage2/basicTypes/BasicTypes.o  stage2/basicTypes/DataCon.o  stage2/basicTypes/Demand.o  stage2/basicTypes/FieldLabel.o  stage2/basicTypes/Id.o  stage2/basicTypes/IdInfo.o  stage2/basicTypes/Literal.o  stage2/basicTypes/MkId.o  stage2/basicTypes/Module.o  stage2/basicTypes/Name.o  stage2/basicTypes/NameEnv.o  stage2/basicTypes/NameSet.o  stage2/basicTypes/NewDemand.o  stage2/basicTypes/OccName.o  stage2/basicTypes/RdrName.o  stage2/basicTypes/SrcLoc.o  stage2/basicTypes/UniqSupply.o  stage2/basicTypes/Unique.o  stage2/basicTypes/Var.o  stage2/basicTypes/VarEnv.o  stage2/basicTypes/VarSet.o  stage2/cmm/CLabel.o  stage2/cmm/Cmm.o  stage2/cmm/CmmLex.o  stage2/cmm/CmmLint.o  stage2/cmm/CmmParse.o  stage2/cmm/CmmUtils.o  stage2/cmm/MachOp.o  stage2/cmm/PprC.o  stage2/cmm/PprCmm.o  stage2/codeGen/Bitmap.o  stage2/codeGen/CgBindery.o  stage2/codeGen/CgCallConv.o  stage2/codeGen/CgCase.o  stage2/codeGen/CgClosure.o  stage2/codeGen/CgCon.o  stage2/codeGen/CgExpr.o  stage2/codeGen/CgForeignCall.o  stage2/codeGen/CgHeapery.o  stage2/codeGen/CgInfoTbls.o  stage2/codeGen/CgLetNoEscape.o  stage2/codeGen/CgMonad.o  stage2/codeGen/CgParallel.o  stage2/codeGen/CgPrimOp.o  stage2/codeGen/CgProf.o  stage2/codeGen/CgStackery.o  stage2/codeGen/CgTailCall.o  stage2/codeGen/CgTicky.o  stage2/codeGen/CgUtils.o  stage2/codeGen/ClosureInfo.o  stage2/codeGen/CodeGen.o  stage2/codeGen/SMRep.o  stage2/compMan/CompManager.o  stage2/coreSyn/CoreFVs.o  stage2/coreSyn/CoreLint.o  stage2/coreSyn/CorePrep.o  stage2/coreSyn/CoreSubst.o  stage2/coreSyn/CoreSyn.o  stage2/coreSyn/CoreTidy.o  stage2/coreSyn/CoreUnfold.o  stage2/coreSyn/CoreUtils.o  stage2/coreSyn/ExternalCore.o  stage2/coreSyn/MkExternalCore.o  stage2/coreSyn/PprCore.o  stage2/coreSyn/PprExternalCore.o  stage2/cprAnalysis/CprAnalyse.o  stage2/deSugar/Check.o  stage2/deSugar/Desugar.o  stage2/deSugar/DsArrows.o  stage2/deSugar/DsBinds.o  stage2/deSugar/DsCCall.o  stage2/deSugar/DsExpr.o  stage2/deSugar/DsForeign.o  stage2/deSugar/DsGRHSs.o  stage2/deSugar/DsListComp.o  stage2/deSugar/DsMonad.o  stage2/deSugar/DsUtils.o  stage2/deSugar/Match.o  stage2/deSugar/MatchCon.o  stage2/deSugar/MatchLit.o  stage2/hsSyn/HsBinds.o  stage2/hsSyn/HsDecls.o  stage2/hsSyn/HsExpr.o  stage2/hsSyn/HsImpExp.o  stage2/hsSyn/HsLit.o  stage2/hsSyn/HsPat.o  stage2/hsSyn/HsSyn.o  stage2/hsSyn/HsTypes.o  stage2/hsSyn/HsUtils.o  stage2/iface/BinIface.o  stage2/iface/BuildTyCl.o  stage2/iface/IfaceEnv.o  stage2/iface/IfaceSyn.o  stage2/iface/IfaceType.o  stage2/iface/LoadIface.o  stage2/iface/MkIface.o  stage2/iface/TcIface.o  stage2/main/CmdLineOpts.o  stage2/main/CodeOutput.o  stage2/main/Config.o  stage2/main/Constants.o  stage2/main/DriverFlags.o  stage2/main/DriverMkDepend.o  stage2/main/DriverPhases.o  stage2/main/DriverPipeline.o  stage2/main/DriverState.o  stage2/main/DriverUtil.o  stage2/main/ErrUtils.o  stage2/main/Finder.o  stage2/main/GetImports.o  stage2/main/HscMain.o  stage2/main/HscStats.o  stage2/main/HscTypes.o  stage2/main/Main.o  stage2/main/PackageConfig.o  stage2/main/Packages.o  stage2/main/ParsePkgConf.o  stage2/main/SysTools.o  stage2/main/TidyPgm.o  stage2/ndpFlatten/FlattenInfo.o  stage2/ndpFlatten/FlattenMonad.o  stage2/ndpFlatten/Flattening.o  stage2/ndpFlatten/NDPCoreUtils.o  stage2/ndpFlatten/PArrAnal.o  stage2/parser/Ctype.o  stage2/parser/LexCore.o  stage2/parser/Lexer.o  stage2/parser/Parser.o  stage2/parser/ParserCore.o  stage2/parser/ParserCoreUtils.o  stage2/parser/RdrHsSyn.o  stage2/prelude/ForeignCall.o  stage2/prelude/PrelInfo.o  stage2/prelude/PrelNames.o  stage2/prelude/PrelRules.o  stage2/prelude/PrimOp.o  stage2/prelude/TysPrim.o  stage2/prelude/TysWiredIn.o  stage2/profiling/CostCentre.o  stage2/profiling/SCCfinal.o  stage2/rename/RnBinds.o  stage2/rename/RnEnv.o  stage2/rename/RnExpr.o  stage2/rename/RnHsSyn.o  stage2/rename/RnNames.o  stage2/rename/RnSource.o  stage2/rename/RnTypes.o  stage2/simplCore/CSE.o  stage2/simplCore/FloatIn.o  stage2/simplCore/FloatOut.o  stage2/simplCore/LiberateCase.o  stage2/simplCore/OccurAnal.o  stage2/simplCore/SAT.o  stage2/simplCore/SATMonad.o  stage2/simplCore/SetLevels.o  stage2/simplCore/SimplCore.o  stage2/simplCore/SimplEnv.o  stage2/simplCore/SimplMonad.o  stage2/simplCore/SimplUtils.o  stage2/simplCore/Simplify.o  stage2/simplStg/SRT.o  stage2/simplStg/SimplStg.o  stage2/simplStg/StgStats.o  stage2/specialise/Rules.o  stage2/specialise/SpecConstr.o  stage2/specialise/Specialise.o  stage2/stgSyn/CoreToStg.o  stage2/stgSyn/StgLint.o  stage2/stgSyn/StgSyn.o  stage2/stranal/DmdAnal.o  stage2/stranal/SaAbsInt.o  stage2/stranal/SaLib.o  stage2/stranal/StrictAnal.o  stage2/stranal/WorkWrap.o  stage2/stranal/WwLib.o  stage2/typecheck/Inst.o  stage2/typecheck/TcArrows.o  stage2/typecheck/TcBinds.o  stage2/typecheck/TcClassDcl.o  stage2/typecheck/TcDefaults.o  stage2/typecheck/TcDeriv.o  stage2/typecheck/TcEnv.o  stage2/typecheck/TcExpr.o  stage2/typecheck/TcForeign.o  stage2/typecheck/TcGenDeriv.o  stage2/typecheck/TcHsSyn.o  stage2/typecheck/TcHsType.o  stage2/typecheck/TcInstDcls.o  stage2/typecheck/TcMType.o  stage2/typecheck/TcMatches.o  stage2/typecheck/TcPat.o  stage2/typecheck/TcRnDriver.o  stage2/typecheck/TcRnMonad.o  stage2/typecheck/TcRnTypes.o  stage2/typecheck/TcRules.o  stage2/typecheck/TcSimplify.o  stage2/typecheck/TcTyClsDecls.o  stage2/typecheck/TcTyDecls.o  stage2/typecheck/TcType.o  stage2/typecheck/TcUnify.o  stage2/types/Class.o  stage2/types/FunDeps.o  stage2/types/Generics.o  stage2/types/InstEnv.o  stage2/types/Kind.o  stage2/types/TyCon.o  stage2/types/Type.o  stage2/types/TypeRep.o  stage2/types/Unify.o  stage2/utils/Bag.o  stage2/utils/Binary.o  stage2/utils/BitSet.o  stage2/utils/Digraph.o  stage2/utils/FastMutInt.o  stage2/utils/FastString.o  stage2/utils/FastTypes.o  stage2/utils/FiniteMap.o  stage2/utils/IOEnv.o  stage2/utils/ListSetOps.o  stage2/utils/Maybes.o  stage2/utils/OrdList.o  stage2/utils/Outputable.o  stage2/utils/Panic.o  stage2/utils/Pretty.o  stage2/utils/PrimPacked.o  stage2/utils/StringBuffer.o  stage2/utils/UnicodeUtil.o  stage2/utils/UniqFM.o  stage2/utils/UniqSet.o  stage2/utils/Util.o  stage2/parser/hschooks.o  
/usr/i386-slackware-linux/bin/ld: cannot find -lHSrts
collect2: ld returned 1 exit status
<<ghc: 6093992 bytes, 2 GCs, 129908/129908 avg/max bytes residency (1 samples), 12M in use, 0.00 INIT (0.00 elapsed), 0.02 MUT (0.95 elapsed), 0.01 GC (0.01 elapsed) :ghc>>
make: *** [stage2/ghc-6.4] Error 1

So in the final step for creating .hc files I get these errors

$ cd H
$ make hc-file-bundle Project=Ghc
..........
echo ghc-6.4/libraries/haskell-src/Language/Haskell/Parser.hs >> hc-files-to-go
tar czf ghc-6.4-x86_64-unknown-linux-hc.tar.gz `cat hc-files-to-go`
tar: ghc-6.4/ghc/rts/Apply.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/Exception.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/HeapStackCheck.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/PrimOps.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/StgMiscClosures.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/StgStartup.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/StgStdThunks.hc: Cannot stat: No such file or directory
tar: ghc-6.4/ghc/rts/Updates.hc: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
make: *** [hc-file-bundle] Error 2

I still tried to copy the package to the target machine an compile
unregistered ghc, but I got 

make[1]: *** No rule to make target `Apply.o', needed by `libHSrts.a'.  Stop.

What could be problem? And what shall I try next?

Thank you
-- 
Minds, like parachutes, function best when open


More information about the Glasgow-haskell-users mailing list