diff options
author | Simon Marlow <marlowsd@gmail.com> | 2018-02-21 14:16:00 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2018-02-21 17:03:01 +0000 |
commit | 0a3629af36e89de73b7012c726fd533c4c5460fb (patch) | |
tree | 98c109e2168f6c9d80eee23b08a35bbf05ddd33b /aclocal.m4 | |
parent | a032ff77210736df45cf49820c882f40dc10230e (diff) | |
download | haskell-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 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 6f37972c08..5ad3752d71 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2340,6 +2340,7 @@ AC_DEFUN([FIND_LD],[ # Make sure the user didn't specify LD manually. if test "z$LD" != "z"; then AC_CHECK_TARGET_TOOL([LD], [ld]) + LD_NO_GOLD=$LD return fi @@ -2352,10 +2353,16 @@ AC_DEFUN([FIND_LD],[ if test "x$TmpLd" = "x"; then continue; fi out=`$TmpLd --version` + LD_NO_GOLD=$TmpLd case $out in - "GNU ld"*) FP_CC_LINKER_FLAG_TRY(bfd, $2) ;; - "GNU gold"*) FP_CC_LINKER_FLAG_TRY(gold, $2) ;; - "LLD"*) FP_CC_LINKER_FLAG_TRY(lld, $2) ;; + "GNU ld"*) + FP_CC_LINKER_FLAG_TRY(bfd, $2) ;; + "GNU gold"*) + FP_CC_LINKER_FLAG_TRY(gold, $2) + LD_NO_GOLD=ld + ;; + "LLD"*) + FP_CC_LINKER_FLAG_TRY(lld, $2) ;; *) AC_MSG_NOTICE([unknown linker version $out]) ;; esac if test "z$$2" = "z"; then |