summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules/build-package-way.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 18ac917099..a4b604fe24 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -28,6 +28,7 @@ $(call hs-objs,$1,$2,$3)
$1_$2_$3_LIB = $1/$2/build/libHS$$($1_PACKAGE)-$$($1_$2_VERSION)$$($3_libsuf)
$$($1_PACKAGE)-$($1_$2_VERSION)_$2_$3_LIB = $$($1_$2_$3_LIB)
+# Note [inconsistent distdirs]
# hack: the DEPS_LIBS mechanism assumes that the distdirs for packages
# that depend on each other are the same, but that is not the case for
# ghc where we use stage1/stage2 rather than dist/dist-install.
@@ -37,8 +38,11 @@ ifeq "$$($1_PACKAGE) $2" "ghc stage2"
$$($1_PACKAGE)-$($1_$2_VERSION)_dist-install_$3_LIB = $$($1_$2_$3_LIB)
endif
-# All the .a/.so library file dependencies for this library
-$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEPS),$$($$(dep)_$2_$3_LIB))
+# All the .a/.so library file dependencies for this library.
+#
+# The $(subst stage2,dist-install,..) is needed due to Note
+# [inconsistent distdirs].
+$1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEPS),$$($$(dep)_$(subst stage2,dist-install,$2)_$3_LIB))
ifeq "$$(BootingFromHc)" "YES"
$1_$2_$3_C_OBJS += $$(shell $$(FIND) $1/$2/build -name "*_stub.c" -print | sed 's/c$$$$/o/')