1.1 --- a/common/autoconf/generated-configure.sh Thu Sep 05 18:40:51 2019 +0800 1.2 +++ b/common/autoconf/generated-configure.sh Thu Sep 05 18:49:45 2019 +0800 1.3 @@ -686,6 +686,7 @@ 1.4 CFLAGS_JDKEXE 1.5 CFLAGS_JDKLIB 1.6 MACOSX_VERSION_MIN 1.7 +FDLIBM_CFLAGS 1.8 NO_LIFETIME_DSE_CFLAG 1.9 NO_DELETE_NULL_POINTER_CHECKS_CFLAG 1.10 LEGACY_EXTRA_LDFLAGS 1.11 @@ -3911,7 +3912,7 @@ 1.12 1.13 1.14 # 1.15 -# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. 1.16 +# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. 1.17 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.18 # 1.19 # This code is free software; you can redistribute it and/or modify it 1.20 @@ -4384,7 +4385,7 @@ 1.21 #CUSTOM_AUTOCONF_INCLUDE 1.22 1.23 # Do not change or remove the following line, it is needed for consistency checks: 1.24 -DATE_WHEN_GENERATED=1554371898 1.25 +DATE_WHEN_GENERATED=1556533111 1.26 1.27 ############################################################################### 1.28 # 1.29 @@ -41617,6 +41618,7 @@ 1.30 # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. 1.31 # 1.32 1.33 + FDLIBM_CFLAGS="" 1.34 # Setup compiler/platform specific flags to CFLAGS_JDK, 1.35 # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?) 1.36 if test "x$TOOLCHAIN_TYPE" = xgcc; then 1.37 @@ -41858,6 +41860,148 @@ 1.38 : 1.39 fi 1.40 1.41 + 1.42 + # Check that the compiler supports -ffp-contract=off flag 1.43 + # Set FDLIBM_CFLAGS to -ffp-contract=off if it does. 1.44 + # For GCC < 4.6, on x86, x86_64 and ppc check for 1.45 + # -mno-fused-madd and -fno-strict-aliasing. If they exist, 1.46 + # use them as a substitute for -ffp-contract=off. 1.47 + # 1.48 + # These flags are required for GCC-based builds of 1.49 + # fdlibm with optimization without losing precision. 1.50 + # Notably, -ffp-contract=off needs to be added for GCC >= 4.6, 1.51 + # -mno-fused-madd -fno-strict-aliasing for GCC < 4.6 1.52 + COMPILER_FP_CONTRACT_OFF_FLAG="-ffp-contract=off" 1.53 + 1.54 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$COMPILER_FP_CONTRACT_OFF_FLAG -Werror\"" >&5 1.55 +$as_echo_n "checking if the C++ compiler supports \"$COMPILER_FP_CONTRACT_OFF_FLAG -Werror\"... " >&6; } 1.56 + supports=yes 1.57 + 1.58 + saved_cxxflags="$CXXFLAGS" 1.59 + CXXFLAGS="$CXXFLAG $COMPILER_FP_CONTRACT_OFF_FLAG -Werror" 1.60 + ac_ext=cpp 1.61 +ac_cpp='$CXXCPP $CPPFLAGS' 1.62 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1.63 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1.64 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 1.65 + 1.66 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1.67 +/* end confdefs.h. */ 1.68 +int i; 1.69 +_ACEOF 1.70 +if ac_fn_cxx_try_compile "$LINENO"; then : 1.71 + 1.72 +else 1.73 + supports=no 1.74 +fi 1.75 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 1.76 + ac_ext=cpp 1.77 +ac_cpp='$CXXCPP $CPPFLAGS' 1.78 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1.79 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1.80 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 1.81 + 1.82 + CXXFLAGS="$saved_cxxflags" 1.83 + 1.84 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 1.85 +$as_echo "$supports" >&6; } 1.86 + if test "x$supports" = "xyes" ; then 1.87 + : 1.88 + else 1.89 + COMPILER_FP_CONTRACT_OFF_FLAG="" 1.90 + fi 1.91 + 1.92 + if test "x$COMPILER_FP_CONTRACT_OFF_FLAG" = x; then 1.93 + if test "$OPENJDK_TARGET_CPU_ARCH" = "x86" || 1.94 + test "$OPENJDK_TARGET_CPU_ARCH" = "x86_64" || 1.95 + test "$OPENJDK_TARGET_CPU_ARCH" = "ppc"; then 1.96 + M_NO_FUSED_ADD_FLAG="-mno-fused-madd" 1.97 + 1.98 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$M_NO_FUSED_ADD_FLAG -Werror\"" >&5 1.99 +$as_echo_n "checking if the C++ compiler supports \"$M_NO_FUSED_ADD_FLAG -Werror\"... " >&6; } 1.100 + supports=yes 1.101 + 1.102 + saved_cxxflags="$CXXFLAGS" 1.103 + CXXFLAGS="$CXXFLAG $M_NO_FUSED_ADD_FLAG -Werror" 1.104 + ac_ext=cpp 1.105 +ac_cpp='$CXXCPP $CPPFLAGS' 1.106 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1.107 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1.108 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 1.109 + 1.110 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1.111 +/* end confdefs.h. */ 1.112 +int i; 1.113 +_ACEOF 1.114 +if ac_fn_cxx_try_compile "$LINENO"; then : 1.115 + 1.116 +else 1.117 + supports=no 1.118 +fi 1.119 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 1.120 + ac_ext=cpp 1.121 +ac_cpp='$CXXCPP $CPPFLAGS' 1.122 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1.123 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1.124 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 1.125 + 1.126 + CXXFLAGS="$saved_cxxflags" 1.127 + 1.128 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 1.129 +$as_echo "$supports" >&6; } 1.130 + if test "x$supports" = "xyes" ; then 1.131 + : 1.132 + else 1.133 + M_NO_FUSED_ADD_FLAG="" 1.134 + fi 1.135 + 1.136 + NO_STRICT_ALIASING_FLAG="-fno-strict-aliasing" 1.137 + 1.138 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$NO_STRICT_ALIASING_FLAG -Werror\"" >&5 1.139 +$as_echo_n "checking if the C++ compiler supports \"$NO_STRICT_ALIASING_FLAG -Werror\"... " >&6; } 1.140 + supports=yes 1.141 + 1.142 + saved_cxxflags="$CXXFLAGS" 1.143 + CXXFLAGS="$CXXFLAG $NO_STRICT_ALIASING_FLAG -Werror" 1.144 + ac_ext=cpp 1.145 +ac_cpp='$CXXCPP $CPPFLAGS' 1.146 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1.147 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1.148 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 1.149 + 1.150 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1.151 +/* end confdefs.h. */ 1.152 +int i; 1.153 +_ACEOF 1.154 +if ac_fn_cxx_try_compile "$LINENO"; then : 1.155 + 1.156 +else 1.157 + supports=no 1.158 +fi 1.159 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 1.160 + ac_ext=cpp 1.161 +ac_cpp='$CXXCPP $CPPFLAGS' 1.162 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1.163 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1.164 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu 1.165 + 1.166 + CXXFLAGS="$saved_cxxflags" 1.167 + 1.168 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 1.169 +$as_echo "$supports" >&6; } 1.170 + if test "x$supports" = "xyes" ; then 1.171 + : 1.172 + else 1.173 + NO_STRICT_ALIASING_FLAG="" 1.174 + fi 1.175 + 1.176 + if test "x$M_NO_FUSED_ADD_FLAG" != "x" && test "x$NO_STRICT_ALIASING_FLAG" != "x"; then 1.177 + FDLIBM_CFLAGS="$M_NO_FUSED_ADD_FLAG $NO_STRICT_ALIASING_FLAG" 1.178 + fi 1.179 + fi 1.180 + else 1.181 + FDLIBM_CFLAGS="$COMPILER_FP_CONTRACT_OFF_FLAG" 1.182 + fi 1.183 elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then 1.184 CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" 1.185 if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then 1.186 @@ -41890,6 +42034,7 @@ 1.187 fi 1.188 fi 1.189 1.190 + 1.191 ############################################################################### 1.192 1.193 # Adjust flags according to debug level.