[commit: ghc] master: Fix a dependency bug in the build system (e1846d7)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/e1846d7f49d55e300a6cb63aa26a3bfcbba9dd6e

>---------------------------------------------------------------

commit e1846d7f49d55e300a6cb63aa26a3bfcbba9dd6e
Author: Simon Marlow <[email protected]>
Date:   Fri Oct 5 10:34:42 2012 +0100

    Fix a dependency bug in the build system
    
    I've been meaning to track this one down for a long time.
    Occasionally a build will fail with an error about a .so library being
    truncated; the reason was that we weren't tracking the dependencies of
    the GHC stage2 .so library correctly.

>---------------------------------------------------------------

 rules/build-package-way.mk |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 18ac917..a4b604f 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/')
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.