diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-08-11 02:14:20 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-08-11 02:14:20 +0000 |
commit | 4bf797bcc0607c81a5109ab381a04419f86ff8e7 (patch) | |
tree | 1757c197287e334d30f4a426c4b8b5e92bd9a69e /configure.in | |
parent | a5abe51580cbe0e88369002c7d82670bce88b573 (diff) | |
download | wireshark-4bf797bcc0607c81a5109ab381a04419f86ff8e7.tar.gz wireshark-4bf797bcc0607c81a5109ab381a04419f86ff8e7.tar.bz2 wireshark-4bf797bcc0607c81a5109ab381a04419f86ff8e7.zip |
Use '-D_FORTIFY_SOURCE=2' when compiling with GCC or CLang.
For info see: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
svn path=/trunk/; revision=38467
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 857ac63a49..ba353d9c76 100644 --- a/configure.in +++ b/configure.in @@ -404,6 +404,13 @@ else CFLAGS="-D_U_=\"\" $CFLAGS" fi +# If we're running GCC or CLang, always use FORTIFY_SOURCE=2 +# See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html +# Note: FORTIFY_SOURCE is only effective for gcc -O2 (and -O1 ?) +if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then + CFLAGS="-D_FORTIFY_SOURCE=2 $CFLAGS" +fi + # # If the compiler supports GCC-style flags, enable a barrier "stop on # warning". |