foreigner icon indicating copy to clipboard operation
foreigner copied to clipboard

Add build win64 on linux cross compile support + more

Open follower opened this issue 5 years ago • 1 comments

Adds Windows cross-compiling on Linux support to my earlier Mac build PR (although I still need to verify I didn't break anything in that :) ), also:

  • Fixes an issue where opening would "fail" because the last error value was checked even when the handle was valid.

  • Makes the test script work cross-platform.

I've checked the resulting .dll works both on Wine64 & an actual Windows 10 Home machine.

I haven't tested non-cross-compilation building on Windows.

(Oh, yeah, just remembered, make all may not work at the moment--I just always use the test target.)

I've tried to document as much as I can, because figuring out the approach for libffi in particular took a bunch of research. I've got some more related notes which I may or may not get around to adding. :)

Anyway, it seems to work sufficiently for my purposes currently so I thought I'd at least submit as a draft PR so you know it'd been done. :)

follower avatar Jun 12 '20 16:06 follower

Quick update: The -Wl,-static flag seems to make the Mac build unhappy (in relation to C++/System libraries) so I might change it to make just libffi statically linked.

follower avatar Jun 13 '20 06:06 follower