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 /configure.ac | |
parent | ef99c782042ea6f1d47b94a511dbf667b0d474cb (diff) | |
download | elfutils-c435a33811428ebad7b8d420821d0b8e10cd84d2.tar.gz |
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>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |