Changes between Version 37 and Version 38 of Commentary/CodingStyle


Ignore:
Timestamp:
Jul 9, 2011 1:59:47 AM (4 years ago)
Author:
dterei
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/CodingStyle

    v37 v38  
    216216=== Platform tests === 
    217217 
    218 There are three platforms of interest to GHC: 
     218Please read [wiki:CrossCompilation this wiki page] on cross compilation for a better understanding of the situation here. There are three platforms of interest to GHC when compiling and running: 
    219219  
    220220 * The '''Build''' platform. This is the platform on which we are building GHC. 
     
    222222 * The '''Target''' platform. This is the platform for which this GHC binary will generate code. 
    223223 
    224 At the moment, there is very limited support for having different values for buil, host, and target.  In particular: 
    225  
    226  * The build platform is currently always the same as the host platform.  The build process needs to use some of the tools in 
    227 the source tree, for example `ghc-pkg` and `hsc2hs` 
    228  
    229  * If the target platform differs from the host platform, then this is generally for the purpose of building `.hc` files from Haskell source for porting GHC to the target platform. Full cross-compilation isn't supported (yet). 
     224At the moment, there is limited support for having different values for build, host, and target. Please refer to the [wiki:CrossCompilation cross compilation] page for more details. 
    230225 
    231226In the compiler's source code, you may make use of the following CPP symbols: 
     
    238233 * ''xxx''`_HOST_OS` 
    239234 
    240 where ''xxx'' is the appropriate value: eg. `i386_TARGET_ARCH`. 
     235where ''xxx'' is the appropriate value: eg. `i386_TARGET_ARCH`. However GHC is moving away from using CPP for this purpose in many cases due to the problems it creates with supporting cross compilation. So instead it the new plan is to always build GHC as a cross compiler and select the appropriate values and backend code generator to run and runtime. For this purpose there is the Platform module ([[GhcFile(compiler/utils/Platform.hs)]]). That contains various methods for querying the !DynFlags ([[GhcFile(compiler/main/DynFlags.hs)]]) value for what platform GHC is currently compiling for.