
#8143: File name module name mismatch in Parser.hs in HEAD -------------------------------------+------------------------------------ Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by carter): Seems to be that the Parser.hs file generated by Parser.y.pp has some leading white space on its CPP pragmas {{{ #if __GLASGOW_HASKELL__ >= 707 -- Required on x86 to avoid the register allocator running out of -- stack slots when compiling this module with -fPIC -dynamic. {-# OPTIONS_GHC -fcmm-sink #-} #endif }}} If I change it to {{{ #if __GLASGOW_HASKELL__ >= 707 -- Required on x86 to avoid the register allocator running out of -- stack slots when compiling this module with -fPIC -dynamic. {-# OPTIONS_GHC -fcmm-sink #-} #endif }}} the build works The offending original code seems to be this: {{{ -- 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 __IF_GHC_77__ -- Required on x86 to avoid the register allocator running out of -- stack slots when compiling this module with -fPIC -dynamic. {-# OPTIONS_GHC -fcmm-sink #-} __ENDIF__ }}} I'm trying a test build of Current HEAD where my host c compiler is gcc-4.8, and my ./configure with-gcc=clang where I put the CPP in directly. (i'm not sure why we need the __IF_GHC_77__ and __ENDIF__) alternatively, to prevent the leading whitespace, something like {{{ #define __IF_GHC_77__ / #if __GLASGOW_HASKELL__ >= 707 }}} might make sense? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8143#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler