changeset 3280:11325608b718

Moved format security flags to default CFLAGS
author unexist
date Fri, 09 Feb 2018 13:07:48 +0100
parents 1507598a8b95
children 51899d4db077
files Rakefile
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Rakefile	Fri Feb 02 15:29:12 2018 +0100
+++ b/Rakefile	Fri Feb 09 13:07:48 2018 +0100
@@ -64,7 +64,7 @@
   "hdrdir"     => "",
   "archdir"    => "",
   "revision"   => "3224", #< Latest stable
-  "cflags"     => "-Wall -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -std=gnu99 " + (ENV["CFLAGS"] || ""),
+  "cflags"     => "-Wall -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -Wformat -Wformat-security -std=gnu99 " + (ENV["CFLAGS"] || ""),
   "cpppath"    => "-I. -I$(builddir) -Isrc -Isrc/shared -Isrc/subtle -idirafter$(hdrdir) -idirafter$(archdir) " + (ENV["CPPFLAGS"] || ""),
   "ldflags"    => "$(rpath) -L$(libdir) $(LIBS) -l$(RUBY_SO_NAME) " + (ENV["LDFLAGS"] || ""),
   "extflags"   => "$(LDFLAGS) $(rpath) $(LIBS) -l$(RUBY_SO_NAME)",
@@ -284,7 +284,7 @@
 
     # Hardening
     if "yes" == @options["hardening"]
-      @options["cflags"] <<  " -fstack-protector-strong -Wformat -Wformat-security"
+      @options["cflags"] <<  " -fstack-protector-strong -D_FORTIFY_SOURCE=2"
     end
 
     # Get revision