https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105858
--- Comment #5 from Brecht Sanders <brechtsanders at users dot sourceforge.net> --- I believe this is issue is cause by the fact that mmap is missing on Windows. In gcc/ggc-common.cc this causes use of default_gt_pch_get_address() as HOST_HOOKS_GT_PCH_GET_ADDRESS which just returns NULL resulting in "cannot write PCH file: required memory segment unavailable". Though mmap doesn't exist, it isn't that hard to emulate, as can be seen in https://github.com/alitrack/mman-win32 , so maybe some code is needed to use the Windows memory mapping mechanism. I did try to build against https://github.com/alitrack/mman-win32, but I ran into the issue that this requires linking with the library mman-win32, but passing it to LDFLAGS doesn't work as it's not near the end of the linker command and link order is important on Windows/MinGW.