configure: Coerce gcc to use $LD instead of system default
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 29 Jun 2017 23:38:51 +0000 (19:38 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 29 Jun 2017 23:38:52 +0000 (19:38 -0400)
commit625143f473b58d770d2515b91c2566b52d35a4c3
tree5da1910c86956cb4ae6ea8534d0867bfeae134e3
parent007f255644f885d445e47e291e50eb12b5ecd08d
configure: Coerce gcc to use $LD instead of system default

The configure script will now try to coerce gcc to use the linker
pointed to by $LD instead of the system default (typically bfd ld).
Moreover, we now check for `ld.gold` and `ld.lld` before trying `ld`.

The previous behavior can be reverted to by using the new
--disable-ld-override flag.

On my machine gold seems to trigger an apparent infelicity in
constructor behavior, causing T5435_asm to fail. I've opened #13883 to
record this issue and have accepted the questionable constructor
ordering for the time being.

Test Plan: Validate with `config_args='--enable-ld-override'`

Reviewers: austin, hvr, simonmar

Subscribers: duog, nh2, rwbarton, thomie, erikd, snowleopard

GHC Trac Issues: #13541, #13810, #13883

Differential Revision: https://phabricator.haskell.org/D3449
aclocal.m4
configure.ac
distrib/configure.ac.in
testsuite/tests/rts/all.T