https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104217
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:8562fbaae9d0c06316188c4749a2171071b6b926 commit r11-9971-g8562fbaae9d0c06316188c4749a2171071b6b926 Author: Jonathan Wakely <jwak...@redhat.com> Date: Tue Jan 25 10:11:36 2022 +0000 libstdc++: Define _GNU_SOURCE for secure_getenv on Cygwin [PR104217] For GNU/Linux G++ defines _GNU_SOURCE automatically, but not for Cygwin. This means secure_getenv is not declared by Cygwin's <stdlib.h>, even though autoconf detected it is present in the library. Define it in the source files that want to use secure_getenv. libstdc++-v3/ChangeLog: PR libstdc++/104217 * src/c++17/fs_ops.cc (_GNU_SOURCE): Define. * src/filesystem/dir.cc (_GNU_SOURCE): Define. * src/filesystem/ops.cc (_GNU_SOURCE): Define. (cherry picked from commit e20486d508afdf22790a271e90ca76d8df5fa7a5)