summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2018-02-21 14:16:00 +0000
committerSimon Marlow <marlowsd@gmail.com>2018-02-21 17:03:01 +0000
commit0a3629af36e89de73b7012c726fd533c4c5460fb (patch)
tree98c109e2168f6c9d80eee23b08a35bbf05ddd33b /rules
parenta032ff77210736df45cf49820c882f40dc10230e (diff)
downloadhaskell-0a3629af36e89de73b7012c726fd533c4c5460fb.tar.gz
Don't use ld.gold when building libraries for GHCi
Summary: ld.gold is buggy when using -r and a linker script. See upstream bug https://sourceware.org/bugzilla/show_bug.cgi?id=22266 This has been causing various brokenness for the GHC runtime linker, where we load these broken object files. Test Plan: Test program from #14675 Reviewers: bgamari, RyanGlScott, alpmestan, hvr, erikd Subscribers: rwbarton, thomie, erikd, carter GHC Trac Issues: #14328, #14675, #14291 Differential Revision: https://phabricator.haskell.org/D4431
Diffstat (limited to 'rules')
-rw-r--r--rules/build-package-way.mk7
1 files changed, 5 insertions, 2 deletions
diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk
index 9c101c4a9d..8d14b7a3e2 100644
--- a/rules/build-package-way.mk
+++ b/rules/build-package-way.mk
@@ -121,8 +121,11 @@ BINDIST_LIBS += $$($1_$2_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)
- $$(call cmd,LD) $$(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)
-
+ $$(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
+# generated GHCi library to have some bogus relocations. Performance
+# isn't critical here, so we fall back to the ordinary ld.
ifeq "$$($1_$2_BUILD_GHCI_LIB)" "YES"
# Don't bother making ghci libs for bootstrapping packages
ifneq "$4" "0"