karamel icon indicating copy to clipboard operation
karamel copied to clipboard

Kremlin cross-compiles

Open wintersteiger opened this issue 7 years ago • 2 comments

Not intended to be merged as is, just a demo to show that it doesn't take all that much. I just ran CROSS=yes make and, on a proper Ubuntu machine (no WSL) it gets me very swiftly to

...:~/kremlin$ file _build/src/Kremlin.native 
_build/src/Kremlin.native: PE32+ executable (console) x86-64, for MS Windows

Those ppx options are a bit of a mess, I'm sure there's a nicer way to get those options through (e.g. in _tags, but I don't know how to get $(OCAMLLIB) into _tags).

wintersteiger avatar Jan 30 '18 20:01 wintersteiger

I thought ppx_deriving was supposed to be able to deal with these cases. Perhaps worth pinging the ppx_deriving folks to see if they're missing support for cross-compilation? In any case, good news!

msprotz avatar Jan 30 '18 22:01 msprotz

That would be nice if they could support cross-compilation out of the box! I must admit, I don't fully understand how it's supposed to work and I may have set up the ppx_deriving package(s) the wrong way. If those object files are not needed at link time, the *-windows package could just be a link to the build system's (non-windows) packages. I think that's pretty much the effect of those options I set.

wintersteiger avatar Jan 30 '18 22:01 wintersteiger