提交 c495cc42 编写于 作者: A andrew

8223219: Backport of JDK-8199552 to OpenJDK 8 leads to duplicate...

8223219: Backport of JDK-8199552 to OpenJDK 8 leads to duplicate -fstack-protector flags, overriding --with-extra-cflags
Summary: Apply -fstack-protector to all archs and remove duplication in JDK build
Reviewed-by: sgehwolf
上级 49351c02
...@@ -388,16 +388,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], ...@@ -388,16 +388,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
elif test "x$TOOLCHAIN_TYPE" = xgcc; then elif test "x$TOOLCHAIN_TYPE" = xgcc; then
case $OPENJDK_TARGET_CPU_ARCH in LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
x86 ) LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
;;
x86_64 )
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
;;
esac
if test "x$OPENJDK_TARGET_OS" != xmacosx; then if test "x$OPENJDK_TARGET_OS" != xmacosx; then
LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro" LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro" LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro"
...@@ -456,7 +448,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], ...@@ -456,7 +448,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
if test "x$TOOLCHAIN_TYPE" = xgcc; then if test "x$TOOLCHAIN_TYPE" = xgcc; then
# these options are used for both C and C++ compiles # these options are used for both C and C++ compiles
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in case $OPENJDK_TARGET_CPU_ARCH in
arm ) arm )
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
...@@ -465,10 +457,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], ...@@ -465,10 +457,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
ppc ) ppc )
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
;; ;;
x86 )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer -fstack-protector"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing -fstack-protector"
;;
* ) * )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
......
...@@ -4376,7 +4376,7 @@ VS_SDK_PLATFORM_NAME_2017= ...@@ -4376,7 +4376,7 @@ VS_SDK_PLATFORM_NAME_2017=
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1556533111 DATE_WHEN_GENERATED=1560366811
############################################################################### ###############################################################################
# #
...@@ -41432,16 +41432,8 @@ $as_echo "$ac_cv_c_bigendian" >&6; } ...@@ -41432,16 +41432,8 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
elif test "x$TOOLCHAIN_TYPE" = xgcc; then elif test "x$TOOLCHAIN_TYPE" = xgcc; then
case $OPENJDK_TARGET_CPU_ARCH in LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
x86 ) LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
;;
x86_64 )
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
;;
esac
if test "x$OPENJDK_TARGET_OS" != xmacosx; then if test "x$OPENJDK_TARGET_OS" != xmacosx; then
LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro" LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro" LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro"
...@@ -41552,7 +41544,7 @@ fi ...@@ -41552,7 +41544,7 @@ fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then if test "x$TOOLCHAIN_TYPE" = xgcc; then
# these options are used for both C and C++ compiles # these options are used for both C and C++ compiles
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in case $OPENJDK_TARGET_CPU_ARCH in
arm ) arm )
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
...@@ -41561,10 +41553,6 @@ fi ...@@ -41561,10 +41553,6 @@ fi
ppc ) ppc )
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
;; ;;
x86 )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer -fstack-protector"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing -fstack-protector"
;;
* ) * )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册