summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc.mk2
-rw-r--r--ghc/ghc.mk3
-rw-r--r--rules/build-package-way.mk5
-rw-r--r--rules/build-prog.mk2
-rw-r--r--rules/hs-suffix-rules-srcdir.mk2
5 files changed, 11 insertions, 3 deletions
diff --git a/ghc.mk b/ghc.mk
index b12583a251..2bea8290e8 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 103c590652..1115946c4e 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 06e432a7c5..636f6410b9 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 20cf46fe0c..1bb9028f3b 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 4aa7b7eb2a..ceeede8e96 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