Fix bindist for ghci library
authorZejun Wu <watashi@fb.com>
Wed, 2 Jan 2019 02:59:23 +0000 (18:59 -0800)
committerBen Gamari <ben@smart-cactus.org>
Sun, 6 Jan 2019 12:27:09 +0000 (07:27 -0500)
Summary:
https://phabricator.haskell.org/D5169 built libghci for both vanilla way
and profiling way. We need to include both in the bindist list so they
will be installed.

Test Plan:
```
$ grep '^BuildFlavour' mk/build.mk
BuildFlavour=perf
$ make test_bindist
$ grep HSghc-prim bindist-list.uniq
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.o
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.p_o
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3.a
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3-ghc8.7.20190101.so
ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a
```

ghc.mk
rules/build-package-way.mk

diff --git a/ghc.mk b/ghc.mk
index e0d5837..f6d3b48 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -784,8 +784,11 @@ ifneq "$(BINDIST)" "YES"
 # Make sure we have all the GHCi libs by the time we've built
 # ghc-stage2.
 #
-GHCI_LIBS = $(foreach lib,$(PACKAGES_STAGE1),$(libraries/$(lib)_dist-install_GHCI_LIB)) \
-           $(compiler_stage2_GHCI_LIB)
+GHCI_LIBS = \
+    $(foreach way,$(GhcLibWays),\
+        $(foreach lib,$(PACKAGES_STAGE1),\
+            $(libraries/$(lib)_dist-install_$(way)_GHCI_LIB)) \
+        $(compiler_stage2_$(way)_GHCI_LIB))
 
 ifeq "$(UseArchivesForGhci)" "NO"
 ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(GHCI_LIBS)
index 0a762d3..f9eca23 100644 (file)
@@ -113,14 +113,14 @@ endif
 
 # Build the GHCi library
 ifneq "$(filter $3, v p)" ""
-$1_$2_GHCI_LIB = $1/$2/build/HS$$($1_$2_COMPONENT_ID).$$($3_osuf)
+$1_$2_$3_GHCI_LIB = $1/$2/build/HS$$($1_$2_COMPONENT_ID).$$($3_osuf)
 ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
 # Don't put bootstrapping packages in the bindist
 ifneq "$4" "0"
-BINDIST_LIBS += $$($1_$2_GHCI_LIB)
+BINDIST_LIBS += $$($1_$2_$3_GHCI_LIB)
 endif
 endif
-$$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) $$($1_$2_LD_SCRIPT)
+$$($1_$2_$3_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) $$($1_$2_LD_SCRIPT)
        $$(call cmd,LD_NO_GOLD) $$(CONF_LD_LINKER_OPTS_STAGE$4) -r $$(if $$($1_$2_LD_SCRIPT),$$($1_$2_LD_SCRIPT_CMD) $$($1_$2_LD_SCRIPT)) -o $$@ $$(EXTRA_LD_LINKER_OPTS) $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS)
 # NB. LD_NO_GOLD above: see #14328 (symptoms: #14675,#14291). At least
 # some versions of ld.gold appear to have a bug that causes the
@@ -129,7 +129,7 @@ $$($1_$2_GHCI_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OB
 ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
 # Don't bother making ghci libs for bootstrapping packages
 ifneq "$4" "0"
-$(call all-target,$1_$2,$$($1_$2_GHCI_LIB))
+$(call all-target,$1_$2,$$($1_$2_$3_GHCI_LIB))
 endif
 endif # "$$($1_$2_BUILD_GHCI_LIB)" "YES"
 endif # "$(filter $3, v p)" ""