configure: Make sure we try all possible linkers
ClosedPublic

Authored by bgamari on Sep 26 2017, 6:00 PM.

Details

Summary

Previously if we had both ld.lld and ld.gold installed but a gcc which didn't
support -fuse-ld=lld we would fail when trying ld.lld and fall immediately back
to plain ld. Now we will try ld.gold as well. This was brought to light
by Trac #14280, where using ld.bfd resulted in a broken stage2 compiler.

Test Plan

Configure

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bgamari created this revision.Sep 26 2017, 6:00 PM
angerman accepted this revision.Sep 26 2017, 7:57 PM

Looks reasonable. I'll bark if this breaks my cross compilers :-)

This revision is now accepted and ready to land.Sep 26 2017, 7:57 PM
bgamari added inline comments.Sep 26 2017, 8:12 PM
aclocal.m4
2340

Arg, this doesn't work due to autoconf's caching.

angerman added inline comments.Sep 26 2017, 8:59 PM
aclocal.m4
2340

I thought we didn't use autoconf's caching?

How about

AC_CHECK_TARGET_TOOLS([TmpLdLLVM], [ld.lld])
AC_CHECK_TARGET_TOOLS([TmpLdGOLD], [ld.gold])
AC_CHECK_TARGET_TOOLS([TmpLd], [ld])

for possible_ld in $LD $TmpLdLLVM $TmpLdGOLD $TmpLd; do
   ...
done
This revision was automatically updated to reflect the committed changes.