From dff6ab2d210ff6139aaea38bef16c0ae2d1a005a Mon Sep 17 00:00:00 2001 From: sof Date: Tue, 15 Jan 2002 05:39:15 +0000 Subject: [PATCH] [project @ 2002-01-15 05:39:14 by sof] updates & fixes to hc-bootstrapping story; from Thomas Nordin --- Makefile | 10 ++++++-- distrib/hc-build | 10 ++++++-- ghc/rts/Makefile | 3 ++- mk/bootstrap.mk | 73 ++++++++++++++++++++++++++++++------------------------ 4 files changed, 58 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index c32fc69..6fe0fb5 100644 --- a/Makefile +++ b/Makefile @@ -294,12 +294,18 @@ hc-file-bundle : project-check $(ProjectNameShort)-$(ProjectVersion)/ghc/driver \ $(ProjectNameShort)-$(ProjectVersion)/ghc/lib \ $(ProjectNameShort)-$(ProjectVersion)/hslibs \ - -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" > hc-files-to-go + \( -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" \) -print > hc-files-to-go find $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler \ $(ProjectNameShort)-$(ProjectVersion)/ghc/driver \ $(ProjectNameShort)-$(ProjectVersion)/ghc/lib \ $(ProjectNameShort)-$(ProjectVersion)/hslibs \ - -name "*.hsc" | sed 's/hsc$$/hs/g' >> hc-files-to-go + -name "*.hsc" -print | sed 's/hsc$$/hs/g' >> hc-files-to-go + echo $(ProjectNameShort)-$(ProjectVersion)/ghc/lib/std/PrelPrimopWrappers.hs >> hc-files-to-go + echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/*.hs-incl >> hc-files-to-go + echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/rename/ParseIface.hs >> hc-files-to-go + echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/parser/Parser.hs >> hc-files-to-go + echo $(ProjectNameShort)-$(ProjectVersion)/ghc/compiler/main/ParsePkgConf.hs >> hc-files-to-go + echo $(ProjectNameShort)-$(ProjectVersion)/hslibs/hssource/HsParser.hs >> hc-files-to-go tar czf $(ProjectNameShort)-$(ProjectVersion)-$(TARGETPLATFORM)-hc.tar.gz `cat hc-files-to-go` CLEAN_FILES += hc-files-to-go *-hc.tar.gz diff --git a/distrib/hc-build b/distrib/hc-build index 948d34b..8461b3b 100644 --- a/distrib/hc-build +++ b/distrib/hc-build @@ -9,6 +9,7 @@ # useful with --prefix). configopts="$*" # e.g., --enable-hc-boot-unregisterised +PWD=`pwd` # check for GNU make # @@ -34,6 +35,11 @@ END touch ghc/compiler/rename/ParseIface.hs touch ghc/compiler/parser/Parser.hs touch ghc/compiler/main/ParsePkgConf.hs +touch hslibs/hssource/HsParser.hs + +# We don't have genprimopcode yet so don't try to use it +touch ghc/compiler/prelude/primops.txt +touch ghc/lib/std/PrelPrimopWrappers.hs echo "*** Building hsc..." ./configure --enable-hc-boot $configopts @@ -63,12 +69,12 @@ PRIMOP_BITS=primop-data-decl.hs-incl \ # The reconfigure step updates a few files, which can lead to # unnecessary recompilations. Touch a bunch of things here to avoid # having to recompile stuff that we've already built. -(cd ghc/compiler; touch $PRIMOP_BITS prelude/PrimOp.o main/Config.{hs,o} ghc-*) +(cd ghc/compiler; touch $PRIMOP_BITS prelude/PrimOp.o main/Config.hs main/Config.o ghc-*) # Remove the old libraries. Don't use make clean, because we don't # want to delete the .hs files generated from the .hsc files, because # we don't have hsc2hs built yet. -/usr/bin/find ghc/lib/std hslibs | grep '\.\(o\|a\)' | /usr/bin/xargs rm -f +find ghc/lib/std hslibs | grep '\.\(o\|a\)' | xargs rm -f # Do includes and RTS now $MAKE -C ghc/includes boot && $MAKE -C ghc/includes all diff --git a/ghc/rts/Makefile b/ghc/rts/Makefile index e1065d6..c01d5e2 100644 --- a/ghc/rts/Makefile +++ b/ghc/rts/Makefile @@ -1,5 +1,5 @@ #----------------------------------------------------------------------------- -# $Id: Makefile,v 1.55 2001/10/19 09:33:28 sewardj Exp $ +# $Id: Makefile,v 1.56 2002/01/15 05:39:15 sof Exp $ # # This is the Makefile for the runtime-system stuff. # This stuff is written in C (and cannot be written in Haskell). @@ -105,6 +105,7 @@ SRC_MKDEPENDC_OPTS += -I. -I../includes ifeq "$(BootingFromHc)" "YES" # use the normal $(CC) when booting from .hc files SRC_CC_OPTS += $(HC_OPTS) +SRC_CC_OPTS += -I../includes -I. -Iparallel -DCOMPILING_RTS else # otherwise, use $(GHC_INPLACE) as the C compiler. CC=$(GHC_INPLACE) diff --git a/mk/bootstrap.mk b/mk/bootstrap.mk index cbd6041..614878b 100644 --- a/mk/bootstrap.mk +++ b/mk/bootstrap.mk @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: bootstrap.mk,v 1.17 2001/09/25 18:08:48 ken Exp $ +# $Id: bootstrap.mk,v 1.18 2002/01/15 05:39:15 sof Exp $ # # Makefile rules for booting from .hc files without a driver. # @@ -66,6 +66,13 @@ SRC_CC_OPTS += -I$(FPTOOLS_TOP_ABS)/ghc/includes -I$(FPTOOLS_TOP_ABS)/ghc/lib/st # ----------------------------------------------------------------------------- # Linking: we have to give all the libraries explicitly. +ifeq "$(LeadingUnderscore)" "YES" +UNDERSCORE=_ +else +UNDERSCORE= +endif + + HC_BOOT_LD_OPTS = \ -L$(FPTOOLS_TOP_ABS)/ghc/rts \ -L$(FPTOOLS_TOP_ABS)/ghc/rts/gmp \ @@ -81,38 +88,38 @@ HC_BOOT_LD_OPTS = \ -L$(FPTOOLS_TOP_ABS)/hslibs/util/cbits \ -L$(FPTOOLS_TOP_ABS)/hslibs/text \ -L$(FPTOOLS_TOP_ABS)/hslibs/text/cbits \ - -u "PrelBase_Izh_static_info" \ - -u "PrelBase_Czh_static_info" \ - -u "PrelFloat_Fzh_static_info" \ - -u "PrelFloat_Dzh_static_info" \ - -u "PrelPtr_Ptr_static_info" \ - -u "PrelWord_Wzh_static_info" \ - -u "PrelInt_I8zh_static_info" \ - -u "PrelInt_I16zh_static_info" \ - -u "PrelInt_I32zh_static_info" \ - -u "PrelInt_I64zh_static_info" \ - -u "PrelWord_W8zh_static_info" \ - -u "PrelWord_W16zh_static_info" \ - -u "PrelWord_W32zh_static_info" \ - -u "PrelWord_W64zh_static_info" \ - -u "PrelStable_StablePtr_static_info" \ - -u "PrelBase_Izh_con_info" \ - -u "PrelBase_Czh_con_info" \ - -u "PrelFloat_Fzh_con_info" \ - -u "PrelFloat_Dzh_con_info" \ - -u "PrelPtr_Ptr_con_info" \ - -u "PrelStable_StablePtr_con_info" \ - -u "PrelBase_False_closure" \ - -u "PrelBase_True_closure" \ - -u "PrelPack_unpackCString_closure" \ - -u "PrelIOBase_stackOverflow_closure" \ - -u "PrelIOBase_heapOverflow_closure" \ - -u "PrelIOBase_NonTermination_closure" \ - -u "PrelIOBase_BlockedOnDeadMVar_closure" \ - -u "PrelWeak_runFinalizzerBatch_closure" \ - -u "__stginit_Prelude" \ - -u "PrelMain_mainIO_closure" \ - -u "__stginit_PrelMain" + -u "$(UNDERSCORE)PrelBase_Izh_static_info" \ + -u "$(UNDERSCORE)PrelBase_Czh_static_info" \ + -u "$(UNDERSCORE)PrelFloat_Fzh_static_info" \ + -u "$(UNDERSCORE)PrelFloat_Dzh_static_info" \ + -u "$(UNDERSCORE)PrelPtr_Ptr_static_info" \ + -u "$(UNDERSCORE)PrelWord_Wzh_static_info" \ + -u "$(UNDERSCORE)PrelInt_I8zh_static_info" \ + -u "$(UNDERSCORE)PrelInt_I16zh_static_info" \ + -u "$(UNDERSCORE)PrelInt_I32zh_static_info" \ + -u "$(UNDERSCORE)PrelInt_I64zh_static_info" \ + -u "$(UNDERSCORE)PrelWord_W8zh_static_info" \ + -u "$(UNDERSCORE)PrelWord_W16zh_static_info" \ + -u "$(UNDERSCORE)PrelWord_W32zh_static_info" \ + -u "$(UNDERSCORE)PrelWord_W64zh_static_info" \ + -u "$(UNDERSCORE)PrelStable_StablePtr_static_info" \ + -u "$(UNDERSCORE)PrelBase_Izh_con_info" \ + -u "$(UNDERSCORE)PrelBase_Czh_con_info" \ + -u "$(UNDERSCORE)PrelFloat_Fzh_con_info" \ + -u "$(UNDERSCORE)PrelFloat_Dzh_con_info" \ + -u "$(UNDERSCORE)PrelPtr_Ptr_con_info" \ + -u "$(UNDERSCORE)PrelStable_StablePtr_con_info" \ + -u "$(UNDERSCORE)PrelBase_False_closure" \ + -u "$(UNDERSCORE)PrelBase_True_closure" \ + -u "$(UNDERSCORE)PrelPack_unpackCString_closure" \ + -u "$(UNDERSCORE)PrelIOBase_stackOverflow_closure" \ + -u "$(UNDERSCORE)PrelIOBase_heapOverflow_closure" \ + -u "$(UNDERSCORE)PrelIOBase_NonTermination_closure" \ + -u "$(UNDERSCORE)PrelIOBase_BlockedOnDeadMVar_closure" \ + -u "$(UNDERSCORE)PrelWeak_runFinalizzerBatch_closure" \ + -u "$(UNDERSCORE)__stginit_Prelude" \ + -u "$(UNDERSCORE)PrelMain_mainIO_closure" \ + -u "$(UNDERSCORE)__stginit_PrelMain" HC_BOOT_LIBS = -lHStext -lHStext_cbits -lHSutil -lHSposix -lHSposix_cbits -lHSconcurrent -lHSlang -lHSlang_cbits -lHSstd -lHSstd_cbits -lHSrts -lgmp -lm $(EXTRA_HC_BOOT_LIBS) -- 1.7.10.4