aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2011-08-11 02:14:20 +0000
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>2011-08-11 02:14:20 +0000
commiteab2556720ccce4760d3533389c96efc42abe3f4 (patch)
tree1757c197287e334d30f4a426c4b8b5e92bd9a69e /configure.in
parent064296c51b1c59458b6ae93d5c6853ee310370e2 (diff)
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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38467 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in7
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".