Changes to help GHCJS, GHC API multi-target cross compile
simonpj at microsoft.com
Tue Feb 12 18:24:52 CET 2013
I've had a look. As you say, the changes are modest.
For (2), I'd like to see a
Note [Overriding the GHC.Prim interface]
with the field decl for sOverridePrimIface in DynFlags, with enough commentary
to explain what is going on.
In particular, this DynFlag field is never altered from the command line flags etc; it is only used via the GHC API. This point needs to be made so that we don't remove it again as dead code!
Similarly (1): a Note with the CustomWay constructor
Then I'm happy for Ian to commit, if Ian is happy too.
| -----Original Message-----
| From: ghc-devs-bounces at haskell.org [mailto:ghc-devs-bounces at haskell.org]
| On Behalf Of Luite Stegeman
| Sent: 08 February 2013 18:53
| To: ghc-devs at haskell.org
| Subject: RFC: Changes to help GHCJS, GHC API multi-target cross compile
| Hi all,
| I'm looking for comments on two minor patches that would greatly help
| GHCJS . The goal is to make a cabal-installable GHCJS compiler that
| code (to run Template Haskell). This way we can release updates
| frequently and have an easy installation procedure for users.
| I have an experimental branch  that uses the patches below to make
| compiler, with working TH.
| 1. Add a Way for custom build tags.
| Since we generate code for two architectures, we need to make sure that
| manually in DynFlags does not work, because it gets reset every time a
| file is preprocessed (due to OPTIONS pragma handling).
| This patch adds an extra Way that just adds something to the build tag,
| it could be extended to also add custom program options and extras.
| 2. Make GHC.Prim interface overridable.
| 32 bit code, even if our host platform is 64 bit. HEAD has
| wORD_SIZE_IN_BITS already configurable though DynFlags, but
| unfortunately the primop interface (GHC.Prim) is also platform
| dependent, some primops have a different type on a 64 bit system.
| This patch makes it possible for a GHC API user to supply a custom
| interface for GHC.Prim. It's rather hacky, requires an extra hs-boot
| file and requires the user to mess with the NameCache to make it work
| correctly . Probably a stopgap measure until GHC supports multitarget
| cross compilation out of the box. Is there a better way of doing this?
|  https://github.com/ghcjs
|  https://github.com/ghcjs/ghcjs/tree/gen2-64
More information about the ghc-devs