Please disregard my previous message. I'm trying a different approach now (with --build=x86_64-w64-mingw32 instead of --build=x86_64-pc-msys). That should be a better option. This, however, fails too. But in a different way: >checking how to run the C++ preprocessor... /lib/cpp >configure: error: in `/home/JW/build-gcc-mingw64/gmp': >configure: error: C++ preprocessor "/lib/cpp" fails sanity check >See `config.log' for more details >make[2]: *** [Makefile:5277: configure-stage2-gmp] Error 1 >make[2]: Leaving directory '/home/JW/build-gcc-mingw64' >make[1]: *** [Makefile:23982: stage2-bubble] Error 2 >make[1]: Leaving directory '/home/JW/build-gcc-mingw64' >make: *** [Makefile:945: all] Error 2 Inspecting gmp/config.log shows: >configure:19836: checking how to run the C++ preprocessor >configure:19863: /home/JW/build-gcc-mingw64/./prev-gcc/xg++ -B/home/JW/build-gcc-mingw64/./prev-gcc/ -B/mingw64/x86_64-w64-mingw32/bin/ -nostdinc++ -B/home/JW/build-gcc-mingw64/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -B/home/JW/build-gcc-mingw64/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -I/home/JW/build-gcc-mingw64/prev-x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 -I/home/JW/build-gcc-mingw64/prev-x86_64-w64-mingw32/libstdc++-v3/include -I/home/JW/gcc-7.1.0/libstdc++-v3/libsupc++ -L/home/JW/build-gcc-mingw64/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -L/home/JW/build-gcc-mingw64/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -E conftest.cpp >In file included from D:/msys64/home/JW/build-gcc-mingw64/prev-gcc/include-fixed/syslimits.h:7:0, > from D:/msys64/home/JW/build-gcc-mingw64/prev-gcc/include-fixed/limits.h:34, > from conftest.cpp:26: >D:/msys64/home/JW/build-gcc-mingw64/prev-gcc/include-fixed/limits.h:194:15: fatal error: limits.h: No such file or directory > #include_next <limits.h> /* recurse down to the real one */ > ^~~~~~~~~~ >compilation terminated. So it can't find limits.h. I passed the corresponding option to configure (--with-native-system-header-dir) but that appears to be ignored. Any ideas?