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

ruby-changes:74295

From: Nobuyoshi <ko1@a...>
Date: Sun, 30 Oct 2022 19:16:32 +0900 (JST)
Subject: [ruby-changes:74295] 0717cb8419 (master): Try -fstack-protector-strong on MinGW

https://git.ruby-lang.org/ruby.git/commit/?id=0717cb8419

From 0717cb84193083cbfb7daee115a82418fd9c1474 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 30 Oct 2022 18:22:50 +0900
Subject: Try -fstack-protector-strong on MinGW

The CI for MinGW has used it.
---
 .github/workflows/mingw.yml | 4 ++--
 configure.ac                | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml
index 001fab9cf1..6f7af8ccf8 100644
--- a/.github/workflows/mingw.yml
+++ b/.github/workflows/mingw.yml
@@ -32,10 +32,10 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/mingw.yml#L32
       MSYSTEM: ${{ matrix.msystem }}
       MSYS2_ARCH: x86_64
       CHOST: "x86_64-w64-mingw32"
-      CFLAGS:   "-march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong"
+      CFLAGS:   "-march=x86-64 -mtune=generic -O3 -pipe"
       CXXFLAGS: "-march=x86-64 -mtune=generic -O3 -pipe"
       CPPFLAGS: "-D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048"
-      LDFLAGS:  "-pipe -fstack-protector-strong"
+      LDFLAGS:  "-pipe"
       UPDATE_UNICODE: "UNICODE_FILES=. UNICODE_PROPERTY_FILES=. UNICODE_AUXILIARY_FILES=. UNICODE_EMOJI_FILES=."
       GITPULLOPTIONS: --no-tags origin ${{github.ref}}
     strategy:
diff --git a/configure.ac b/configure.ac
index 711ff997e7..87966fdfcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -794,7 +794,7 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L794
 
     # -fstack-protector
     AS_CASE(["$target_os"],
-    [mingw*|emscripten*|wasi*], [
+    [emscripten*|wasi*], [
 	stack_protector=no
     ])
     AS_IF([test -z "${stack_protector+set}"], [
@@ -806,6 +806,8 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L806
 	    AS_IF([test "x$stack_protector" = xyes], [stack_protector=option; break])
 	])
     ])
+    AC_MSG_CHECKING([for -fstack-protector])
+    AC_MSG_RESULT(["$stack_protector"])
     AS_CASE(["$stack_protector"], [-*], [
 	RUBY_APPEND_OPTION(XCFLAGS, $stack_protector)
 	RUBY_APPEND_OPTION(XLDFLAGS, $stack_protector)
-- 
cgit v1.2.3


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

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