JuliaLang/julia — pull request #5965 by tkelman (2014-02-26 13:06:43+00:00)
Title: RFC: Allow Cygwin to MinGW cross compilation

This isn't perfect, but it could be fewer manual steps and have better potential for automation for local Windows builds than the MSYS option (ref. discussion in #5961). And this shouldn't break anything, though please correct me if I'm wrong.

With these changes, I can build Julia under 64-bit Cygwin, setting `XC_HOST = x86_64-w64-mingw32` in Make.user to use the MinGW cross-compilers. This way the compiled libraries and executables are native Windows, they do not require Cygwin or its runtime library to use. In fact the REPL doesn't start up correctly inside Cygwin's terminal at all, but neither does the MSYS-compiled version so that's not new.

Remaining issues: the unit tests start, but have an apparent failure in linalg2:
```
exception on 3: ERROR: test failed: norm((F[:vectors] * Diagonal(F[:values])) / F[:vectors] - A) > 0.01
in error at error.jl:21
in default_handler at test.jl:19
in do_test at test.jl:39
while loading linalg2.jl, in expression starting on line 515
```
and the parallel tests hang completely. This may be indicative of a bigger problem, possibly in the threading model of the Cygwin-distributed MinGW compilers (as with the MSYS2 pacman-distributed versions, see #5943)? I'm not sure which they use, but I'll look into it.