[前][次][番号順一覧][スレッド一覧]

ruby-changes:63703

From: Nobuyoshi <ko1@a...>
Date: Mon, 23 Nov 2020 18:18:02 +0900 (JST)
Subject: [ruby-changes:63703] 2939c57ca7 (master): Check if _FORTIFY_SOURCE really works

https://git.ruby-lang.org/ruby.git/commit/?id=2939c57ca7

From 2939c57ca7aa80df126332e04de8a33a56978b42 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 23 Nov 2020 17:51:52 +0900
Subject: Check if _FORTIFY_SOURCE really works

i686-pc-cygwin gcc 6.4.0 seems broken around ssp.h, when compiling
with both of optimization and _FORTIFY_SOURCE.

diff --git a/configure.ac b/configure.ac
index 3174781..c2b1a07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -673,7 +673,8 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L673
 				 [disable -D_FORTIFY_SOURCE=2 option, which causes link error on mingw]),
 		  [fortify_source=$enableval])
     AS_IF([test "x$fortify_source" != xno], [
-    RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+        RUBY_TRY_CFLAGS([$optflags -D_FORTIFY_SOURCE=2], [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)], [],
+                        [@%:@include <stdio.h>])
     ])
 
     : ${MJIT_HEADER_FLAGS='-P -dD'}
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]