[GHC] #7678: GHC should compile cleanly with clang

GHC cvs-ghc at haskell.org
Sun Feb 10 09:35:54 CET 2013


#7678: GHC should compile cleanly with clang
--------------------------------+-------------------------------------------
Reporter:  thoughtpolice        |          Owner:  thoughtpolice   
    Type:  bug                  |         Status:  new             
Priority:  normal               |      Component:  Compiler        
 Version:  7.7                  |       Keywords:  clang           
      Os:  Unknown/Multiple     |   Architecture:  Unknown/Multiple
 Failure:  Building GHC failed  |      Blockedby:                  
Blocking:  7602                 |        Related:                  
--------------------------------+-------------------------------------------
 I'm running into several difficulties (which I'll catalog shortly)
 building GHC HEAD with Clang 3.2. These mostly seem to be difficulties
 relating to the preprocessor and the fact clang does not really respect
 ```-traditional-cpp``` mode, and that it is stricter than gcc about
 whitespace and whatnot too. This means code like:

 {{{

 {-# RULES

  "thing" ...

   #-}

 }}}

 becomes invalid: ```clang``` is strict about the fact that preprocessor
 definitions must occur on the beginning of a line. There seems to be a bug
 in the preprocessor directive source code to this effect (that it doesn't
 handle whitespace before a directive.) It's quite unfortunate, because we
 do this a lot.

 This also causes build failures in the parser due to some crazy CPP
 hackery we do. I'll follow up with that shortly.

 As a workaround, we may have to force ```CPP``` to just continue being
 ```cpp``` which will Do The Right Thing, while ```CC``` will use
 ```clang``` instead. Or we'll have to have some script that seds
 whitespace out or something.

 This currently blocks #7602 since I can't test my fix otherwise.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7678>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list