This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch RHEL7
in repository gfs2-utils.
commit 0067299783bae59fb793b10a180b319dc5a74ca6
Author: Andrew Price <anprice(a)redhat.com>
Date: Wed Jun 29 20:07:04 2016 +0100
gfs2-utils: Build with -D_FORTIFY_SOURCE=2
A survey of popular Linux distros shows that they all compile their
packages with _FORTIFY_SOURCE=2 defined so it makes sense to enable it
upstream too, in order to fix any issues it highlights before they reach
the distros. It will also allow us to factor the overhead it adds into
perf measurements.
Briefly, using this flag adds buffer overflow detection to some
functions, and enables -Wunused-result warnings.
It requires the optimization level to be -O1 or higher so it is only
added to CPPFLAGS when --enable-debug is not used.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
configure.ac | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index b421fbe..cc49642 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,8 +143,10 @@ ENV_LDFLAGS="$LDFLAGS"
if test "x${enable_debug}" = xyes; then
AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code])
OPT_CFLAGS="-O0"
+ OPT_CPPFLAGS=""
else
OPT_CFLAGS="-O2"
+ OPT_CPPFLAGS="-D_FORTIFY_SOURCE=2"
fi
# gdb flags
@@ -203,7 +205,7 @@ for j in $WARNLIST; do
done
CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS $EXTRA_WARNINGS $WERROR_CFLAGS"
-CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make -I. $ENV_CPPFLAGS"
+CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make -I. $ENV_CPPFLAGS
$OPT_CPPFLAGS"
LDFLAGS="$ENV_LDFLAGS"
AC_CONFIG_TESTDIR([tests],
[gfs2/libgfs2:gfs2/mkfs:gfs2/fsck:gfs2/edit:gfs2/convert:gfs2/tune:tests])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date