[Lunar-commits] <moonbase> gcc: stack protector option (hardening)

Auke Kok sofar at foo-projects.org
Tue Sep 7 06:32:03 CEST 2010


commit 4016042e837eab50224b67526c3dc9ddfda86d7b
Author: Auke Kok <auke at foo-projects.org>
Date:   Tue Sep 7 06:32:03 2010 +0200

    gcc: stack protector option (hardening)
---
 compilers/gcc/plugin.d/optimize-gcc_4_5.plugin |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/compilers/gcc/plugin.d/optimize-gcc_4_5.plugin b/compilers/gcc/plugin.d/optimize-gcc_4_5.plugin
index df553bc..a58cca3 100644
--- a/compilers/gcc/plugin.d/optimize-gcc_4_5.plugin
+++ b/compilers/gcc/plugin.d/optimize-gcc_4_5.plugin
@@ -119,6 +119,9 @@ plugin_compiler_gcc_4_5_optimize()
       Pipe)
         c_cxx_flags_add "-pipe"
         ;;
+      Fortify)
+        c_cxx_flags_add "-D_FORTIFY_SOURCE=2"
+        ;;
     esac
   done
 
@@ -583,6 +586,7 @@ EOF
             "Deprecated" "-Wno-deprecated for C++" $( echo ${CC_OPTS[@]} | grep -qw "Deprecated" && echo "on" || echo "off" ) "Disable warnings of deprecated symbols in C++"
             "Debug" "-g" $( echo ${CC_OPTS[@]} | grep -qw "Debug" && echo "on" || echo "off" ) "Add debug symbols"
             "Pipe" "-pipe (RECOMMENDED)" $( echo ${CC_OPTS[@]} | grep -qw "Pipe" && echo "on" || echo "off" ) "Enable cc to use named pipes."
+            "Fortify" "-D_FORTIFY_SOURCE=2" $( echo ${CC_OPTS[@]} | grep -qw "Fortify" && echo "on" || echo "off" ) "Gcc Stack protector checking"
             )
           menu checklist "General C/C++ compiler settings" &&
           CC_OPTS=($RESULT)


More information about the Lunar-commits mailing list