From: Ian Lynagh Date: Sun, 17 May 2009 13:05:58 +0000 (+0000) Subject: Bootstrapping fixes X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=56aad1af62167a41117419a94f6b9ce1f2e60576 Bootstrapping fixes --- diff --git a/ghc.mk b/ghc.mk index b12583a..2bea829 100644 --- a/ghc.mk +++ b/ghc.mk @@ -929,7 +929,7 @@ maintainer-clean : distclean .PHONY: all_libraries .PHONY: bootstrapping-files -bootstrapping-files: $(GMP_LIB) +bootstrapping-files: $(OTHER_LIBS) bootstrapping-files: includes/ghcautoconf.h bootstrapping-files: includes/DerivedConstants.h bootstrapping-files: includes/GHCConstants.h diff --git a/ghc/ghc.mk b/ghc/ghc.mk index 103c590..1115946 100644 --- a/ghc/ghc.mk +++ b/ghc/ghc.mk @@ -137,7 +137,8 @@ $(GHC_STAGE3) : $(TOUCHY) $(INPLACE)/stamp-mingw $(INPLACE_LIB)/perl.exe endif ifeq "$(BootingFromHc)" "YES" -ghc_stage2_OTHER_OBJS += $(compiler_stage2_v_LIB) $(ALL_LIBS) $(ALL_LIBS) $(ALL_LIBS) $(ALL_RTS_LIBS) -lgmp $(libffi_STATIC_LIB) -lm -lutil -lrt +$(GHC_STAGE2) : $(ALL_STAGE1_LIBS) +ghc_stage2_OTHER_OBJS += $(compiler_stage2_v_LIB) $(ALL_STAGE1_LIBS) $(ALL_STAGE1_LIBS) $(ALL_STAGE1_LIBS) $(ALL_RTS_LIBS) $(libffi_STATIC_LIB) endif endif diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index 06e432a..636f641 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -29,9 +29,14 @@ $$($1_PACKAGE)-$($1_$2_VERSION)_$2_$3_LIB = $$($1_$2_$3_LIB) # All the .a/.so library file dependencies for this library $1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEPS),$$($$(dep)_$2_$3_LIB)) +ifneq "$$(BootingFromHc)" "YES" $1_$2_$3_MKSTUBOBJS = find $1/$2/build -name "*_stub.$$($3_osuf)" -print # HACK ^^^ we tried to use $(wildcard), but apparently it fails due to # make using cached directory contents, or something. +else +$1_$2_$3_MKSTUBOBJS = true +$1_$2_v_C_OBJS += $$(shell find $1/$2/build -name "*_stub.c" -print | sed 's/c$$$$/o/') +endif ifeq "$3" "dyn" # Link a dynamic library diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 20cf46f..1bb9028 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -104,7 +104,7 @@ $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2 else $1/$2/build/tmp/$$($1_$2_PROG) : $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$(MKDIRHIER) $$(dir $$@) - $$(CC) -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) + $$(CC) -o $$@ $$($1_$2_v_ALL_CC_OPTS) $$(LD_OPTS) $$($1_$2_v_HS_OBJS) $$($1_$2_v_C_OBJS) $$($1_$2_v_S_OBJS) $$($1_$2_OTHER_OBJS) $$($1_$2_v_EXTRA_CC_OPTS) endif # Note [lib-depends] if this program is built with stage1 or greater, we diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk index 4aa7b7e..ceeede8 100644 --- a/rules/hs-suffix-rules-srcdir.mk +++ b/rules/hs-suffix-rules-srcdir.mk @@ -84,10 +84,12 @@ $1/$2/build/%.$$($3_way_)o-boot : $1/$4/%.hs-boot $$($1_$2_HC_DEP) $1/$2/build/%.$$($3_way_)o-boot : $1/$4/%.lhs-boot $$($1_$2_HC_DEP) $$($1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@ +ifneq "$$(BootingFromHc)" "YES" # stubs are automatically generated and compiled by GHC $1/$2/build/%_stub.$$($3_osuf): $1/$2/build/%.$$($3_osuf) @: +endif endef