summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-02-06 13:52:45 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-11 05:10:40 -0500
commitb157399f987c31574968719a52a5b00f2acfb36a (patch)
treef62b3966254c123446168621395533928b6edb2b /aclocal.m4
parentaba51b65863db5f2687f29d10ba24ffa49dabd3b (diff)
downloadhaskell-b157399f987c31574968719a52a5b00f2acfb36a.tar.gz
configure: Don't assume Gnu linker on Solaris
Compl Yue noticed that the linker was dumping the link map on SmartOS. This is because Smartos uses the Solaris linker, which uses the `-64` flag, not `-m64` like Gnu ld, to indicate that it should link for 64-bits. Fix the configure script to handle the Solaris linker correctly.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m413
1 files changed, 12 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 3dc30eb7d9..5b16f6c3eb 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -647,6 +647,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
# $5 is the name of the CPP flags variable
AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
[
+ AC_REQUIRE([FP_PROG_LD_IS_GNU])
AC_MSG_CHECKING([Setting up $2, $3, $4 and $5])
case $$1 in
i386-*)
@@ -663,10 +664,20 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$2="$$2 -march=i686"
;;
x86_64-unknown-solaris2)
+ # Solaris is a multi-lib platform, providing both 32- and 64-bit
+ # user-land. It appears to default to 32-bit builds but we of course want to
+ # compile for 64-bits on x86-64.
+ #
+ # On OpenSolaris uses gnu ld whereas SmartOS appears to use the Solaris
+ # implementation, which rather uses the -64 flag.
$2="$$2 -m64"
$3="$$3 -m64"
- $4="$$4 -m64"
$5="$$5 -m64"
+ if test "$fp_cv_gnu_ld" = "yes"; then
+ $4="$$4 -m64"
+ else
+ $4="$$4 -64"
+ fi
;;
alpha-*)
# For now, to suppress the gcc warning "call-clobbered