[commit: ghc] wip/ghc710-aix: We need to use -mminimal-toc on IBM AIX (e71cab2)

git at git.haskell.org git at git.haskell.org
Tue Nov 17 22:29:04 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/ghc710-aix
Link       : http://ghc.haskell.org/trac/ghc/changeset/e71cab2663323415c15033c09fa5314b42ae47ef/ghc

>---------------------------------------------------------------

commit e71cab2663323415c15033c09fa5314b42ae47ef
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Mon Nov 16 10:16:43 2015 +0100

    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.


>---------------------------------------------------------------

e71cab2663323415c15033c09fa5314b42ae47ef
 aclocal.m4      | 6 ++++++
 compiler/ghc.mk | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/aclocal.m4 b/aclocal.m4
index 4242539..8732e0e 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 7bb72c2..b7dc1c9 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



More information about the ghc-commits mailing list