[commit: ghc] master: Work-around clang weirdness by adding a newline. (5dc98a0)
Austin Seipp
mad.one at gmail.com
Mon Jun 17 12:56:44 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : master
https://github.com/ghc/ghc/commit/5dc98a0d826c4b8ace006106cbb66f468d5fadd0
>---------------------------------------------------------------
commit 5dc98a0d826c4b8ace006106cbb66f468d5fadd0
Author: Austin Seipp <aseipp at pobox.com>
Date: Mon Jun 17 05:36:29 2013 -0500
Work-around clang weirdness by adding a newline.
I really wish this were a joke, but alas...
This gets me a working stage1 compiler on Linux with Clang with no
modifications. Unfortunately it won't get much farther than that for
various other reasons.
Signed-off-by: Austin Seipp <aseipp at pobox.com>
>---------------------------------------------------------------
compiler/parser/Parser.y.pp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 34c0bc6..483ed87 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -26,8 +26,16 @@ throw away inlinings as it would normally do in -O0 mode.
-- CPP tricks because we want the directives in the output of the
-- first CPP pass.
+--
+-- Clang note, 6/17/2013 by aseipp: It is *extremely* important (for
+-- some reason) that there be a line of whitespace between the two
+-- definitions here, and the subsequent use of __IF_GHC_77__ - this
+-- seems to be a bug in clang or something, where having the line of
+-- whitespace will make the preprocessor correctly format the rendered
+-- lines in the 'two step' CPP pass. No, this is not a joke.
#define __IF_GHC_77__ #if __GLASGOW_HASKELL__ >= 707
-#define __ENDIF__ #endif
+#define __ENDIF__ #endif
+
__IF_GHC_77__
-- Required on x86 to avoid the register allocator running out of
-- stack slots when compiling this module with -fPIC -dynamic.
More information about the ghc-commits
mailing list