foo_TARGET_ARCH, foo_TARGET_OS problems
Norman Ramsey
nr at eecs.harvard.edu
Wed Jan 26 11:54:18 EST 2005
> Remember that in a GHC build:
>
> - build refers to the platform we're building on
> - host refers to the platform we're going to run GHC on
> - target refers to the platform that this GHC build targets
>
> Defines for foo_TARGET_ARCH, foo_TARGET_OS, and several other symbols,
> are placed in ghc/includes/ghcconfig.h by the build system.
Simon,
I'm not really qualified to comment on this narrow issue, but I'm
aware of a heavyweight solution that helps make this and similar
problems go away---in most compilers I have worked on, we have
eventually made the shift to loading all targets at once in a single
binary. The compiler's target is then selected on the command line,
when the compiler is run. If planned for in advance, this strategy is
fairly simple to implement and saves enormous effort in configuration
management. If not planned for in advance, it can be painful to
switch---I remember, for example, helping to make the transition from
lcc 2 to lcc 3. If you want to see how it is handled in lcc, this is
covered pretty well in the book.
I realize this is more radical than any of the alternatives you are
asking about, but I thought it was something you might like to have in
the back of your mind in case you ever do a significant refactoring of
your build setup.
Norman
More information about the Cvs-ghc
mailing list