summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2013-05-04 16:07:22 -0500
committerAustin Seipp <aseipp@pobox.com>2013-06-16 20:01:25 -0500
commit71a194d8ca2efd075a5c000be0b378c8706ca0b3 (patch)
tree2bc67fdf845354bbe4fb0b3f729b0e8c054dc8ca /aclocal.m4
parentb097dc9a25f986f0a07dcd2ad1e7fdeeac63198a (diff)
downloadhaskell-71a194d8ca2efd075a5c000be0b378c8706ca0b3.tar.gz
Detect linker information at runtime. Fixes Trac #6063
Previously, we did ./configure time checks to see if 'GNU ld' supported certain options. If it does, we bake those options into the link step. See Trac #5240. Unfortunately, the linker we use at runtime can change for several reasons. One is that the user specifies -pgml 'foo'. The other is if /usr/bin/ld or whatnot changes from when GHC was built. Those options mentioned earlier are specific to GNU ld, but many systems support GNU gold too. This is Trac #6063. So we need to check at runtime what linker we're using. This is actually a little bit complicated because we normally use the C compiler as our linker. Windows and OS X are also special here. Finally, this patch also unconditionally gives '--hash-size=31' and '--reduce-memory-overheads' to the system linker if it's GNU ld. These options have been supported for 8+ years from what I can see, and there are probably a lot of other reasons why GHC would not work with such an ancient binutils, all things considered. See Note [Run-time linker info] in SysTools for details. There are plenty of comments as well in the surrounding code. Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m433
1 files changed, 0 insertions, 33 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 2ab4ad5ddb..0283206d67 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -535,18 +535,6 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$2="$$2 -fno-stack-protector"
fi
- # Reduce memory usage when linking. See trac #5240.
- if test -n "$LdHashSize31"
- then
- $3="$$3 -Wl,$LdHashSize31"
- $4="$$4 $LdHashSize31"
- fi
- if test -n "$LdReduceMemoryOverheads"
- then
- $3="$$3 -Wl,$LdReduceMemoryOverheads"
- $4="$$4 $LdReduceMemoryOverheads"
- fi
-
rm -f conftest.c conftest.o
AC_MSG_RESULT([done])
])
@@ -921,27 +909,6 @@ $2=$fp_cv_$2
])# FP_PROG_LD_FLAG
-# FP_PROG_LD_HashSize31
-# ------------
-# Sets the output variable LdHashSize31 to --hash-size=31 if ld supports
-# this flag. Otherwise the variable's value is empty.
-AC_DEFUN([FP_PROG_LD_HashSize31],
-[
-FP_PROG_LD_FLAG([--hash-size=31],[LdHashSize31])
-])# FP_PROG_LD_HashSize31
-
-
-# FP_PROG_LD_ReduceMemoryOverheads
-# ------------
-# Sets the output variable LdReduceMemoryOverheads to
-# --reduce-memory-overheads if ld supports this flag.
-# Otherwise the variable's value is empty.
-AC_DEFUN([FP_PROG_LD_ReduceMemoryOverheads],
-[
-FP_PROG_LD_FLAG([--reduce-memory-overheads],[LdReduceMemoryOverheads])
-])# FP_PROG_LD_ReduceMemoryOverheads
-
-
# FP_PROG_LD_BUILD_ID
# ------------