https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107511
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I suspect adding: #ifndef _GNU_SOURCE // Cygwin needs this for secure_getenv # define _GNU_SOURCE 1 #endif at the beginging of eh_alloc.cc fixes the issue; just like what was done for src/c++17/fs_ops.cc, src/filesystem/dir.cc, etc.