1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.
This commit is contained in:
Nobuyoshi Nakada 2022-10-29 16:14:19 +09:00
parent 5e0432f59b
commit c5ca250eb5
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2022-10-29 09:57:54 +00:00

View file

@ -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>])
])