linuxcygwincross-compilingmingw-w64msys2

Cross-compilation targeting Cygwin with Linux host


Is it possible to cross-compile a program targeting a Cygwin environment from a Linux/Unix host? I'm mostly trying to avoid using a Windows (virtual) machine for building a collection of programs.

From the website:

Cygwin is not:

  • a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.

mingw-w64 is not enough, I need a full POSIX platform. I'm also wondering if it's possible to target MSYS2.

Perhaps I do not understand correctly, and one doesn't need to compile in Cygwin, but only mingw-w64 is necessary.

Thanks!


Solution

  • It is possible to compile for Cygwin from Linux.
    The cygwin1.dll itself is built in such way.

    Packages/libraries are available at:

    https://copr.fedorainfracloud.org/coprs/yselkowitz/cygwin/

    Of course only a minimal set of tools/libraries is available