summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2013-09-04 11:23:03 -0500
committerAustin Seipp <aseipp@pobox.com>2013-09-04 11:57:51 -0500
commit9e133b9dccec0553c6ec302d6ca0d3bc5eea06c4 (patch)
treee23214db5b114639689db8a36f61b8035fc8e128 /configure.ac
parentba576e55f88043cda639ac2d848e1162d43ffdbe (diff)
downloadhaskell-9e133b9dccec0553c6ec302d6ca0d3bc5eea06c4.tar.gz
Make sure -fcmm-sink is passed to Parser properly
Parser.hs needs to be compiled with -fcmm-sink on x86 platforms, so the register allocator doesn't run out of stack slots. Previously, we had to do some CPP hacks in order to emit an #ifdef into the file - this is because we preprocess it once up front, and run the preprocessor again when we compile it. There's two cases: the boostrap compiler is > 7.8, and the stage1 parser needs the flag, or the stage1 compiler is compiling the stage2 Parser.hs, and needs the flag.. The previous approach was super fragile with Clang. The more principled fix is to instead do this through the build system. This fixes #8182. Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8d8136f756..b0ada24240 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,12 @@ FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.5],
GHC_PACKAGE_DB_FLAG=package-db)
AC_SUBST(GHC_PACKAGE_DB_FLAG)
+# GHC 7.7+ needs -fcmm-sink when compiling Parser.hs. See #8182
+FP_COMPARE_VERSIONS([$GhcVersion],[-gt],[7.7],
+ CMM_SINK_BOOTSTRAP_IS_NEEDED=YES,
+ CMM_SINK_BOOTSTRAP_IS_NEEDED=NO)
+AC_SUBST(CMM_SINK_BOOTSTRAP_IS_NEEDED)
+
# GHC is passed to Cabal, so we need a native path
if test "${WithGhc}" != ""
then