Cross-compiling network package

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Cross-compiling network package

Arie Peterson
Can the network package be cross-compiled? I'm running into problems because
the preprocessor cannot handle some of the directives that network uses when
it's working in cross-compilation mode.

Specifically, this part gives trouble:

> #if __GLASGOW_HASKELL__ < 800
> #let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)
> #endif
> instance Storable In6Addr where
>     sizeOf _    = #const sizeof(struct in6_addr)
> alignment _ = #alignment struct in6_addr

In my first attempt, with ghc-7.10, this failed because the "let" directive is
not supported when cross-compiling. Looking at the above code I thought I'd
try ghc-8.0, but as it turns out the "alignment" directive is also not
supported when cross-compiling...

Any ideas?

I'm compiling from x86_64 to arm-linux-gnueabihf BTW, to run my haskell
program on the raspberry pi (3).

Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
Only members subscribed via the mailman list are allowed to post.