From 73ef8a1178d64c213de7f02c007fa35db391dac3 Mon Sep 17 00:00:00 2001
From: zhangyipeng  <zhangyipeng7@huawei.com>
Date: Sun, 12 Nov 2023 13:04:57 +0000
Subject: [PATCH] [Huawei]Add compiling option /GS when building windows JDK
---
 common/autoconf/flags.m4               | 2 +-
 common/autoconf/generated-configure.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index 71703a155..6474a0a47 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -566,7 +566,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
     CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK \
-        -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+        -GS -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
         -DWIN32_LEAN_AND_MEAN \
         -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
         -DWIN32 -DIAL"
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 8fa28b61f..b296f81c2 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -43598,7 +43598,7 @@ $as_echo "$supports" >&6; }
     CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK \
-        -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
+        -GS -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
         -DWIN32_LEAN_AND_MEAN \
         -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
         -DWIN32 -DIAL"
-- 
2.12.3

