diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-11-19 12:56:48 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-11-19 13:24:33 +0100 |
commit | 75036aacb492886a7c65035127ee11fec11ee7ce (patch) | |
tree | c6976a4b7fe4bb48b542b0515860cfd516366da8 /compiler | |
parent | c5d8162d230c373b2b49ec94d3f9a027ff6e2dd6 (diff) | |
download | haskell-75036aacb492886a7c65035127ee11fec11ee7ce.tar.gz |
Set AIX specific CFLAGS flags
First of all, 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.
Then, we also need to set the `THREAD_SAFE` CPP #define in order to
unlock the thread-safe `errno` which is essential for the threaded
runtime.
Depends on D1501
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie, erikd
Differential Revision: https://phabricator.haskell.org/D1502
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ghc.mk | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 887a876b56..6fde5c0301 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -380,6 +380,19 @@ 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 +# On IBM AIX we need to wrokaround XCOFF's TOC limitations (see also +# comment in `aclocal.m4` about `-mminimal-toc` for more details) +# However, Parser.hc defines so many symbols that `-mminimal-toc` +# generates instructions with offsets exceeding the PPC offset +# addressing limits. So we need to counter-act this via `-mfull-toc` +# which disables a preceding `-mminimal-toc` again. +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 |