Eric Blake wrote: > Newer glibc hates unconditional use of FORTIFY_SOURCE when optimization > is disabled but -Werror is in effect. > > * configure.ac (FORTIFY_SOURCE): Make conditional. > --- > > Copied from a trick I used in libvirt. > > configure.ac | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 083fd34..044b6a0 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -162,8 +162,13 @@ if test "$gl_gcc_warnings" = yes; then > AC_SUBST([WARN_CFLAGS]) > > AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.]) > - AC_DEFINE([_FORTIFY_SOURCE], [2], > - [enable compile-time and run-time bounds-checking, and some warnings]) > + AH_VERBATIM([FORTIFY_SOURCE], > + [/* Enable compile-time and run-time bounds-checking, and some warnings, > + without upsetting newer glibc. */
Thanks. That looks fine. My only request would be to change the comment to say with which version of glibc this change starts being useful. Saying "newer glibc" sounds fine now, but is guaranteed to be misleading in a year or two.
