summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-02-06 13:52:45 -0500
committerBen Gamari <ben@smart-cactus.org>2020-02-07 13:26:23 -0500
commitf922dd0b1f2d46b83899c65d21580cc7ef66b634 (patch)
treecef08c16be800291385822336a7391a38345bb88
parente8004e5d1e993363a89b0107380604c5bc02be6b (diff)
downloadhaskell-wip/smartos.tar.gz
configure: Don't assume Gnu linker on Solariswip/smartos
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.
-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