summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-02 13:20:00 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-12-02 13:20:00 +0900
commita7b9f085ff952fcb18f82de39b3bf9ab7e5ba3e7 (patch)
tree5089251461f045fa8f6501427c31ff5d96951139 /configure.ac
parentb1c92363a74b0e649a685ae47ae400fbaab7b29d (diff)
Disable _FORTIFY_SOURCE on mingw for now
It causes a link error due to some `__*_chk` functions on mingw.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0435f124ee..2230e188fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -569,6 +569,17 @@ AS_IF([test "$GCC" = yes], [
# argument check. The performance drop is very little and Ubuntu enables
# _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
# a mistake of silly C extensions.
+
+ # TODO: check if link succeeds with _FORTIFY_SOURCE=2.
+ AS_CASE(["$target_os"],
+ [mingw*], [
+ fortify_source=no
+ ])
+ AC_ARG_ENABLE(fortify_source,
+ AS_HELP_STRING([--disable-fortify-source],
+ [disable -D_FORTIFY_SOURCE=2 option, which causes link error on mingw]),
+ [fortify_source=$enableval])
+ test "x$fortify_source" = xno ||
RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
: ${MJIT_HEADER_FLAGS='-P -dD'}