diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-29 16:14:19 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-10-29 16:17:45 +0900 |
commit | c5ca250eb5a0e55391607cc20fa382cd64e49e5e (patch) | |
tree | 798991df1d7c69a91421e766abf4c5c8d109858a | |
parent | 5e0432f59bb85dd3d98be3c1043a1f9c5b41d86b (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6646
-rw-r--r-- | configure.ac | 3 |
1 files changed, 2 insertions, 1 deletions
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], [ [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>]) ]) |