aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.in4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 641216da3a..6cfa5650f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Nov 25 08:03:28 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * configure.in: add -D_FORTIFY_SOURCE=2. It provide some compile
+ time and runtime check for security.
+
Fri Nov 25 08:00:23 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* lib/mkmf.rb: get rid of warnings of mkmf.rb if -Wmissing-declarations
diff --git a/configure.in b/configure.in
index 24aa84d149..827bece224 100644
--- a/configure.in
+++ b/configure.in
@@ -495,6 +495,10 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
rb_cv_warnflags="$warnflags"
warnflags=
fi
+if test "$GCC" = yes; then
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+fi
+
if test "$GCC" = ""; then
AS_CASE(["$target_os"],[aix*],[warnflags="-qinfo=por"])
fi