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

ruby-changes:74285

From: Nobuyoshi <ko1@a...>
Date: Sat, 29 Oct 2022 18:57:58 +0900 (JST)
Subject: [ruby-changes:74285] c5ca250eb5 (master): Clear `_FORTIFY_SOURCE` before definition

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

From c5ca250eb5a0e55391607cc20fa382cd64e49e5e Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 29 Oct 2022 16:14:19 +0900
Subject: Clear `_FORTIFY_SOURCE` before definition

As clang on macOS defines this macro as 0 internally when a sanitizer
option is given, clear it before definition to suppress redefinition
warnings.
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 0e22aabbe5..711ff997e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -785,7 +785,8 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L785
 				 [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([$optflags -D_FORTIFY_SOURCE=2], [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)], [],
+        RUBY_TRY_CFLAGS([$optflags -D_FORTIFY_SOURCE=2],
+                        [RUBY_APPEND_OPTION(XCFLAGS, -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2)], [],
                         [@%:@include <stdio.h>])
     ])
 
-- 
cgit v1.2.3


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

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