[MOAB-dev] commit/MOAB: danwu: Add -fstack-protector-all option for g++ and gcc in debug mode, to detect possible stack smashing bugs. If src/ScdInterface.cpp is reverted to a version before the fix for array index out of bounds, unit scdseq_test will terminate during make check, with <stack smashing detected> message.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Sep 18 14:50:09 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/d4d0e2bc5f31/
Changeset:   d4d0e2bc5f31
Branch:      master
User:        danwu
Date:        2013-09-18 21:49:48
Summary:     Add -fstack-protector-all option for g++ and gcc in debug mode, to detect possible stack smashing bugs. If src/ScdInterface.cpp is reverted to a version before the fix for array index out of bounds, unit scdseq_test will terminate during make check, with <stack smashing detected> message.

Affected #:  1 file

diff --git a/config/compiler.m4 b/config/compiler.m4
index 6a7e2ed..ce83a5f 100644
--- a/config/compiler.m4
+++ b/config/compiler.m4
@@ -222,6 +222,14 @@ if test "xyes" = "x$enable_debug"; then
   CFLAGS="$CFLAGS -g"
   FCFLAGS="$FCFLAGS -g"
   FFLAGS="$FFLAGS -g"
+  # Add -fstack-protector-all option for g++ in debug mode
+  if test "x$cxx_compiler" = "xGNU"; then
+    CXXFLAGS="$CXXFLAGS -fstack-protector-all"
+  fi
+  # Add -fstack-protector-all option for gcc in debug mode
+  if test "x$cc_compiler" = "xGNU"; then
+    CFLAGS="$CFLAGS -fstack-protector-all"
+  fi
 fi
 if test "xyes" = "x$enable_cxx_optimize"; then
   CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list