Unicode in GHC: need some advice on building
simonmar at microsoft.com
Tue Jan 11 06:24:21 EST 2005
On 11 January 2005 02:29, Dimitry Golubovsky wrote:
> Bad thing is, LD_PRELOAD does not work on all systems. So I tried to
> put the code directly into the runtime (where I believe it should be;
> the Unicode properties table is packed, and won't eat much space). I
> renamed foreign function names in GHC.Unicode (to avoid conflict with
> libc functions) adding u_ to them (so now they are u_iswupper, etc).
> I placed the new file into ghc/rts, and the include file into
> ghc/includes. I could not avoid messages about missing prototypes for
> u_... functions , but finally I was able to build ghc. Now when I
> compiled my test program with the rebuilt ghc, it worked without the
> LD_PRELOADed library. However, GHCi could not start complaining that
> it could not see these u_... symbols. I noticed some other entry
> points into the runtime like revertCAFs, or getAllocations, declared
> in the Haskell part of GHCi just as other foreign calls, so I just
> followed the same style - partly unsuccessfully.
> Where am I wrong?
You're doing fine - but a better place for the tables is as part of the
base package, rather than the RTS. We already have some C files in the
base package: see libraries/base/cbits, for example. I suggest just
putting your code in there.
More information about the Glasgow-haskell-users