summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-11-16 10:16:43 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2015-11-16 10:20:47 +0100
commite71cab2663323415c15033c09fa5314b42ae47ef (patch)
tree2883f120cb5a37de5799b86b7a87eec43568fe2b
parentbac953b23611fc2fb58a79bd2e432a947668c1b6 (diff)
downloadhaskell-e71cab2663323415c15033c09fa5314b42ae47ef.tar.gz
We need to use -mminimal-toc on IBM AIX
AIX's XCOFF is limited to 16k entries in its TOC for 32bit compilation, which quickly overflows with GHC's code generation. Otoh, the Parser.hs module contains more entries than fit into a minimal-toc, so we need to switch back to `-mfull-toc` for that single module again.
-rw-r--r--aclocal.m46
-rw-r--r--compiler/ghc.mk8
2 files changed, 14 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 4242539af3..8732e0ed36 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -586,6 +586,12 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
$3="$$3 -fuse-ld=gold -Wl,-z,noexecstack"
$4="$$4 -z noexecstack"
;;
+
+ powerpc-ibm-aix*)
+ $2="$$2 -mminimal-toc"
+ $3="$$3 -mminimal-toc"
+ ;;
+
esac
# If gcc knows about the stack protector, turn it off.
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 7bb72c2f59..b7dc1c95ce 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -381,6 +381,14 @@ endif
compiler/stage2/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas -fcmm-sink
compiler/stage3/build/Parser_HC_OPTS += -O0 -fno-ignore-interface-pragmas -fcmm-sink
+# Parser.hc has so many symbols it overflows when using -mminimal-toc
+ifeq "$(HostOS_CPP)" "aix"
+compiler/stage1/build/Parser_HC_OPTS += -optc-mfull-toc
+endif
+ifeq "$(TargetOS_CPP)" "aix"
+compiler/stage2/build/Parser_HC_OPTS += -optc-mfull-toc
+compiler/stage3/build/Parser_HC_OPTS += -optc-mfull-toc
+endif
ifeq "$(GhcProfiled)" "YES"
# If we're profiling GHC then we want SCCs. However, adding -auto-all