diff options
author | Omar Sandoval <osandov@fb.com> | 2019-12-11 16:23:27 -0800 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-12-12 12:08:51 +0100 |
commit | c435a33811428ebad7b8d420821d0b8e10cd84d2 (patch) | |
tree | 80918bbe939e54bd260c8ae0434ff037a2c07f32 | |
parent | ef99c782042ea6f1d47b94a511dbf667b0d474cb (diff) |
configure: Fix -D_FORTIFY_SOURCE=2 check when CFLAGS contains -Wno-error
If CFLAGS contains -Wno-error, then the check for -D_FORTIFY_SOURCE=2
won't fail when appropriate. E.g., compiling with:
./configure CFLAGS='-Wno-error -O0' &&
Results in a flood of "_FORTIFY_SOURCE requires compiling with
optimization (-O)" warnings.
Make sure we add -Werror after the user-defined CFLAGS.
Signed-off-by: Omar Sandoval <osandov@fb.com>
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | configure.ac | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2019-12-11 Omar Sandoval <osandov@fb.com> + + * configure.ac: Apply -Werror after user-defined CFLAGS in + -D_FORTIFY_SOURCE=2 check. + 2019-12-06 Mark Wielaard <mark@klomp.org> * configure.ac: Add ac_cv_buildid check. diff --git a/configure.ac b/configure.ac index 36a6b6c2..25555d0b 100644 --- a/configure.ac +++ b/configure.ac @@ -273,7 +273,7 @@ case "$CFLAGS" in ;; *) save_CFLAGS="$CFLAGS" - CFLAGS="-D_FORTIFY_SOURCE=2 -Werror $CFLAGS" + CFLAGS="-D_FORTIFY_SOURCE=2 $CFLAGS -Werror" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include <string.h> int main() { return 0; } |