wiki:Building/Architecture/Idiom/PlatformNames

Idiom: platform names

There are three platforms of interest when building GHC:

  • $(BUILDPLATFORM): The build platform.
    The platform on which we are doing this build.
  • $(HOSTPLATFORM): The host platform.
    The platform on which these binaries will run.
  • $(TARGETPLATFORM): The target platform.
    The platform for which this compiler will generate code.

These platforms are set when running the configure script, using the --build, --host, and --target options. The mk/project.mk file, which is generated by configure from mk/project.mk.in, defines several symbols related to the platform settings.

We don't currently support build and host being different, because the build process creates binaries that are both run during the build, and also installed.

If host and target are different, then we are building a cross-compiler. See CrossCompilation for the work-in-progress toolset.

There is another option, which is similar in essence, namely creating a portable compiler. For GHC, this means a compiler which will generate intermediate .hc files to port to the target architecture for bootstrapping. The libraries and stage 2 compiler will be built as .hc files for the target system (see Porting GHC for details).

More details on when to use BUILD, HOST or TARGET can be found in the comments in mk/project.mk.in.

Last modified 2 years ago Last modified on Jan 3, 2012 10:24:13 PM