aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrew <unknown>2019-07-24 03:18:35 +0100
committerbell-sw <liberica@bell-sw.com>2019-10-23 16:21:38 +0300
commit59c1ed30ade6619973f27f139981755f89e998f4 (patch)
treea80f58ac6cbc35be29ffc26d4ab080d39349dc9d
parentd55e1e8f6a6af77f288352b20044f4918f9ee9d1 (diff)
downloadjdk8u-59c1ed30ade6619973f27f139981755f89e998f4.tar.gz
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 Conflicts: common/autoconf/flags.m4 common/autoconf/generated-configure.sh
-rw-r--r--common/autoconf/flags.m411
-rw-r--r--common/autoconf/generated-configure.sh13
2 files changed, 13 insertions, 11 deletions
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index 20ad5e9..a81e12d 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -388,6 +388,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+<<<<<<< HEAD
$2CC_VER_STR=`${CC} -v 2>&1 | $GREP 'version'`
$2CC_VER_NUM_MAJOR=`echo ${$2CC_VER_STR} | $GREP 'version' | $SED 's/.* version@<:@ @:>@*\(@<:@0-9@:>@*\).*/\1/'`
if test \( `echo ${$2CC_VER_STR} | $GREP -c 'LLVM'` -eq "0" \) -a ${$2CC_VER_NUM_MAJOR} -lt "9" ; then
@@ -404,6 +405,10 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
;;
esac
+=======
+ LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
+ LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
+>>>>>>> c495cc4... 8223219: Backport of JDK-8199552 to OpenJDK 8 leads to duplicate -fstack-protector flags, overriding --with-extra-cflags
if test "x$OPENJDK_TARGET_OS" != xmacosx; then
LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro"
@@ -461,7 +466,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
if test "x$TOOLCHAIN_TYPE" = xgcc; then
# 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 \
- -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
arm )
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -470,10 +475,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
ppc )
# 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"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 560f049..075e54a 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -4376,7 +4376,7 @@ VS_SDK_PLATFORM_NAME_2017=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1556533111
+DATE_WHEN_GENERATED=1560366811
###############################################################################
#
@@ -41432,6 +41432,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
+<<<<<<< HEAD
CC_VER_STR=`${CC} -v 2>&1 | $GREP 'version'`
CC_VER_NUM_MAJOR=`echo ${CC_VER_STR} | $GREP 'version' | $SED 's/.* version[ ]*\([0-9]*\).*/\1/'`
if test \( `echo ${CC_VER_STR} | $GREP -c 'LLVM'` -eq "0" \) -a ${CC_VER_NUM_MAJOR} -lt "9" ; then
@@ -41448,6 +41449,10 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
;;
esac
+=======
+ LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector"
+ LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector"
+>>>>>>> c495cc4... 8223219: Backport of JDK-8199552 to OpenJDK 8 leads to duplicate -fstack-protector flags, overriding --with-extra-cflags
if test "x$OPENJDK_TARGET_OS" != xmacosx; then
LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro"
@@ -41557,7 +41562,7 @@ fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
# 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 \
- -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
arm )
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -41566,10 +41571,6 @@ fi
ppc )
# 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"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"