https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68610
--- Comment #2 from David <gccbugzilla at limegreensocks dot com> --- Yes, this still occurs with trunk Revision 239974. I'm using MSYS2 under Windows and my current configure line is: ../gcctrunk/configure --enable-languages=c,c++ --target=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --disable-multilib --disable-nls --disable-win32-registry --enable-checking=release --disable-bootstrap --enable-version-specific-runtime-libs --disable-fixed-point --prefix=/home/david/gccb --enable-twoprocess --with-native-system-header-dir=/mingw64/include None of which turns out to be important. Looking at libssp/configure.ac, we see this code for testing to see if fstack-protector works: AC_MSG_CHECKING([whether -fstack-protector works]) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fstack-protector -Werror" AC_TRY_COMPILE([ void __attribute__((noinline)) bar (char *x) { __builtin_memset (x, 0, 64); }],[char buf[64]; bar (buf);], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CFLAGS="$save_CFLAGS" Note how it saves the CFLAGS, explicitly sets Werror, then does the AC_TRY_COMPILE. Contrast this with the code that immediately follows which attempts to do the same thing for visibility: AC_MSG_CHECKING([whether hidden visibility is supported]) AC_TRY_COMPILE([ void __attribute__((visibility ("hidden"))) bar (void) {}],, [ssp_hidden=yes],[ssp_hidden=no]) AC_MSG_RESULT($ssp_hidden) if test x$ssp_hidden = xyes; then AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported]) fi If visibility is NOT supported, the compiler will produce a warning. However, since in this case Werror is NOT being specified, the compile 'succeeds,' and visibility is assumed to be supported, even though the compiler explicitly said it wasn't. I've learned a lot about how configure scripts work since I originally posted this bug. Hopefully this helps makes the problem clearer.