summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-06-29 19:38:51 -0400
committerBen Gamari <ben@smart-cactus.org>2017-06-29 19:38:52 -0400
commit625143f473b58d770d2515b91c2566b52d35a4c3 (patch)
tree5da1910c86956cb4ae6ea8534d0867bfeae134e3 /configure.ac
parent007f255644f885d445e47e291e50eb12b5ecd08d (diff)
downloadhaskell-625143f473b58d770d2515b91c2566b52d35a4c3.tar.gz
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 5 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index c0961cf8fc..92d37141ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -414,7 +414,6 @@ then
# are screwed up. Configure doesn't think they're ever equal and
# so never tried without the prefix.
AC_PATH_PROG([CC],[gcc], [clang])
- AC_PATH_PROG([LD],[ld], [lld])
AC_PATH_PROG([NM],[nm])
AC_PATH_PROG([AR],[ar])
AC_PATH_PROG([RANLIB],[ranlib])
@@ -530,9 +529,12 @@ FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
-dnl ** Which ld to use?
+dnl ** Choose a linker
dnl --------------------------------------------------------------
-FIND_LD([$target],[LdCmd])
+FIND_LD([$target],[GccUseLdOpt])
+CONF_GCC_LINKER_OPTS_STAGE1="$CONF_GCC_LINKER_OPTS_STAGE1 $GccUseLdOpt"
+CONF_GCC_LINKER_OPTS_STAGE2="$CONF_GCC_LINKER_OPTS_STAGE2 $GccUseLdOpt"
+LdCmd="$LD"
AC_SUBST([LdCmd])
dnl ** Which nm to use?
@@ -694,7 +696,6 @@ FP_PROG_LD_BUILD_ID
FP_PROG_LD_NO_COMPACT_UNWIND
FP_PROG_LD_FILELIST
-
FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE1],[CONF_GCC_LINKER_OPTS_STAGE1],[CONF_LD_LINKER_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])