summaryrefslogtreecommitdiff
path: root/distrib
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 /distrib
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 'distrib')
-rw-r--r--distrib/configure.ac.in25
1 files changed, 13 insertions, 12 deletions
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index cea3c493e9..53c79e1a2d 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -84,23 +84,11 @@ FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion])
OptCmd="$OPT"
AC_SUBST([OptCmd])
-dnl ** Which ld to use?
-dnl --------------------------------------------------------------
-FIND_LD([$target],[LdCmd])
-AC_SUBST([LdCmd])
-
FP_GCC_VERSION
FP_GCC_SUPPORTS_NO_PIE
AC_PROG_CPP
-FP_PROG_LD_IS_GNU
-FP_PROG_LD_BUILD_ID
-FP_PROG_LD_NO_COMPACT_UNWIND
-FP_PROG_LD_FILELIST
-
-#
dnl ** Check gcc version and flags we need to pass it **
-#
FP_GCC_EXTRA_FLAGS
FP_SET_CFLAGS_C99([CC],[CFLAGS],[CPPFLAGS])
@@ -127,6 +115,19 @@ AC_SUBST(CONF_CPP_OPTS_STAGE0)
AC_SUBST(CONF_CPP_OPTS_STAGE1)
AC_SUBST(CONF_CPP_OPTS_STAGE2)
+dnl ** Which ld to use?
+dnl --------------------------------------------------------------
+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])
+
+FP_PROG_LD_IS_GNU
+FP_PROG_LD_BUILD_ID
+FP_PROG_LD_NO_COMPACT_UNWIND
+FP_PROG_LD_FILELIST
+
dnl ** Set up the variables for the platform in the settings file.
dnl May need to use gcc to find platform details.
dnl --------------------------------------------------------------