3434 # under the terms of the GNU General Public License version 2 only, as
3435 # published by the Free Software Foundation. Oracle designates this
3436 # particular file as subject to the "Classpath" exception as provided
3437 # by Oracle in the LICENSE file that accompanied this code.
3438 #
3439 # This code is distributed in the hope that it will be useful, but WITHOUT
3440 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3441 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3442 # version 2 for more details (a copy is included in the LICENSE file that
3443 # accompanied this code).
3444 #
3445 # You should have received a copy of the GNU General Public License version
3446 # 2 along with this work; if not, write to the Free Software Foundation,
3447 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3448 #
3449 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3450 # or visit www.oracle.com if you need additional information or have any
3451 # questions.
3452 #
3453
3454 # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
3455 # If so, then append $1 to $2 \
3456 # Also set JVM_ARG_OK to true/false depending on outcome.
3457
3458
3459 # Appends a string to a path variable, only adding the : when needed.
3460
3461
3462 # Prepends a string to a path variable, only adding the : when needed.
3463
3464
3465 # This will make sure the given variable points to a full and proper
3466 # path. This means:
3467 # 1) There will be no spaces in the path. On unix platforms,
3468 # spaces in the path will result in an error. On Windows,
3469 # the path will be rewritten using short-style to be space-free.
3470 # 2) The path will be absolute, and it will be in unix-style (on
3471 # cygwin).
3472 # $1: The name of the variable to fix
3473
3869 # -xrestrict: Pointer parameters to functions do not overlap
3870 # (Similar to -xalias_level=basic usage, but less obvious sometimes.
3871 # If you pass in multiple pointers to the same data, do not use this)
3872 # -xlibmil: Inline some library routines
3873 # (If you expect perfect errno behavior, do not use this)
3874 # -xlibmopt: Use optimized math routines (CURRENTLY DISABLED)
3875 # (If you expect perfect errno behavior, do not use this)
3876 # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
3877
3878 # FIXME: this will never happen since sparc != sparcv9, ie 32 bit, which we don't build anymore.
3879 # Bug?
3880 #if test "x$OPENJDK_TARGET_CPU" = xsparc; then
3881 # CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
3882 # CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
3883 #fi
3884
3885
3886
3887
3888
3889 # FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
3890 # [RUN-IF-FALSE])
3891 # ------------------------------------------------------------
3892 # Check that the c and c++ compilers support an argument
3893
3894
3895 # FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
3896 # [RUN-IF-FALSE])
3897 # ------------------------------------------------------------
3898 # Check that the linker support an argument
3899
3900
3901
3902
3903 #
3904 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3905 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3906 #
3907 # This code is free software; you can redistribute it and/or modify it
3908 # under the terms of the GNU General Public License version 2 only, as
3909 # published by the Free Software Foundation. Oracle designates this
3910 # particular file as subject to the "Classpath" exception as provided
3911 # by Oracle in the LICENSE file that accompanied this code.
3912 #
3913 # This code is distributed in the hope that it will be useful, but WITHOUT
3914 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3915 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3916 # version 2 for more details (a copy is included in the LICENSE file that
3917 # accompanied this code).
3918 #
3919 # You should have received a copy of the GNU General Public License version
3920 # 2 along with this work; if not, write to the Free Software Foundation,
3921 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3922 #
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807 # This line needs to be here, verbatim, after all includes and the dummy hook
4808 # definitions. It is replaced with custom functionality when building
4809 # custom sources.
4810 #CUSTOM_AUTOCONF_INCLUDE
4811
4812 # Do not change or remove the following line, it is needed for consistency checks:
4813 DATE_WHEN_GENERATED=1452261921
4814
4815 ###############################################################################
4816 #
4817 # Initialization / Boot-strapping
4818 #
4819 # The bootstrapping process needs to solve the "chicken or the egg" problem,
4820 # thus it jumps back and forth, each time gaining something needed later on.
4821 #
4822 ###############################################################################
4823
4824 # If we are requested to print additional help, do that and then exit.
4825 # This must be the very first call.
4826
4827 if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
4828 $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
4829 $PRINTF "Which are valid to use depends on the build platform.\n"
4830 for toolchain in $VALID_TOOLCHAINS_all; do
4831 # Use indirect variable referencing
4832 toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
4833 TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
45341 COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
45342 if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
45343 if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
45344 as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\" or \"x86\"." "$LINENO" 5
45345 fi
45346 elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
45347 if test "x$COMPILER_CPU_TEST" != "xx64"; then
45348 as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5
45349 fi
45350 fi
45351 fi
45352
45353 if test "x$TOOLCHAIN_TYPE" = xgcc; then
45354 # If this is a --hash-style=gnu system, use --hash-style=both, why?
45355 HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
45356 # This is later checked when setting flags.
45357
45358 # "-Og" suppported for GCC 4.8 and later
45359 CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
45360
45361 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5
45362 $as_echo_n "checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; }
45363 supports=yes
45364
45365 saved_cflags="$CFLAGS"
45366 CFLAGS="$CFLAGS $CFLAG_OPTIMIZE_DEBUG_FLAG"
45367 ac_ext=c
45368 ac_cpp='$CPP $CPPFLAGS'
45369 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45370 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45371 ac_compiler_gnu=$ac_cv_c_compiler_gnu
45372
45373 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45374 /* end confdefs.h. */
45375 int i;
45376 _ACEOF
45377 if ac_fn_c_try_compile "$LINENO"; then :
45378
45379 else
45380 supports=no
45400 /* end confdefs.h. */
45401 int i;
45402 _ACEOF
45403 if ac_fn_cxx_try_compile "$LINENO"; then :
45404
45405 else
45406 supports=no
45407 fi
45408 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45409 ac_ext=cpp
45410 ac_cpp='$CXXCPP $CPPFLAGS'
45411 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45412 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45413 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
45414
45415 CXXFLAGS="$saved_cxxflags"
45416
45417 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
45418 $as_echo "$supports" >&6; }
45419 if test "x$supports" = "xyes" ; then
45420 HAS_CFLAG_OPTIMIZE_DEBUG=true
45421 else
45422 HAS_CFLAG_OPTIMIZE_DEBUG=false
45423 fi
45424
45425
45426 # "-z relro" supported in GNU binutils 2.17 and later
45427 LINKER_RELRO_FLAG="-Wl,-z,relro"
45428
45429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5
45430 $as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; }
45431 supports=yes
45432
45433 saved_ldflags="$LDFLAGS"
45434 LDFLAGS="$LDFLAGS $LINKER_RELRO_FLAG"
45435 ac_ext=c
45436 ac_cpp='$CPP $CPPFLAGS'
45437 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45438 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45439 ac_compiler_gnu=$ac_cv_c_compiler_gnu
45440
45441 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45442 /* end confdefs.h. */
45443
45444 int
45445 main ()
45446 {
45447
45448 ;
45450 }
45451 _ACEOF
45452 if ac_fn_c_try_link "$LINENO"; then :
45453
45454 else
45455 supports=no
45456 fi
45457 rm -f core conftest.err conftest.$ac_objext \
45458 conftest$ac_exeext conftest.$ac_ext
45459 ac_ext=cpp
45460 ac_cpp='$CXXCPP $CPPFLAGS'
45461 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45462 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45463 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
45464
45465 LDFLAGS="$saved_ldflags"
45466
45467 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
45468 $as_echo "$supports" >&6; }
45469 if test "x$supports" = "xyes" ; then
45470 HAS_LINKER_RELRO=true
45471 else
45472 HAS_LINKER_RELRO=false
45473 fi
45474
45475
45476 # "-z now" supported in GNU binutils 2.11 and later
45477 LINKER_NOW_FLAG="-Wl,-z,now"
45478
45479 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5
45480 $as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; }
45481 supports=yes
45482
45483 saved_ldflags="$LDFLAGS"
45484 LDFLAGS="$LDFLAGS $LINKER_NOW_FLAG"
45485 ac_ext=c
45486 ac_cpp='$CPP $CPPFLAGS'
45487 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45488 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45489 ac_compiler_gnu=$ac_cv_c_compiler_gnu
45490
45491 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45492 /* end confdefs.h. */
45493
45494 int
45495 main ()
45496 {
45497
45498 ;
45500 }
45501 _ACEOF
45502 if ac_fn_c_try_link "$LINENO"; then :
45503
45504 else
45505 supports=no
45506 fi
45507 rm -f core conftest.err conftest.$ac_objext \
45508 conftest$ac_exeext conftest.$ac_ext
45509 ac_ext=cpp
45510 ac_cpp='$CXXCPP $CPPFLAGS'
45511 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45512 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45513 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
45514
45515 LDFLAGS="$saved_ldflags"
45516
45517 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
45518 $as_echo "$supports" >&6; }
45519 if test "x$supports" = "xyes" ; then
45520 HAS_LINKER_NOW=true
45521 else
45522 HAS_LINKER_NOW=false
45523 fi
45524
45525 fi
45526
45527 # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
45528 # in executable.'
45529 USING_BROKEN_SUSE_LD=no
45530 if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
45531 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5
45532 $as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; }
45533 $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
45534 $ECHO "int main() { }" > main.c
45535 if $CXX -Wl,-version-script=version-script.map main.c 2>&5 >&5; then
45536 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45537 $as_echo "no" >&6; }
45538 USING_BROKEN_SUSE_LD=no
45539 else
45540 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45541 $as_echo "yes" >&6; }
45542 USING_BROKEN_SUSE_LD=yes
45543 fi
45544 rm -rf version-script.map main.c a.out
46825 CFLAGS_DEBUG_SYMBOLS="-g"
46826 CXXFLAGS_DEBUG_SYMBOLS="-g"
46827 fi
46828
46829
46830
46831 # bounds, memory and behavior checking options
46832 if test "x$TOOLCHAIN_TYPE" = xgcc; then
46833 case $DEBUG_LEVEL in
46834 release )
46835 # no adjustment
46836 ;;
46837 fastdebug )
46838 # no adjustment
46839 ;;
46840 slowdebug )
46841 # Add runtime stack smashing and undefined behavior checks.
46842 # Not all versions of gcc support -fstack-protector
46843 STACK_PROTECTOR_CFLAG="-fstack-protector-all"
46844
46845 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"" >&5
46846 $as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"... " >&6; }
46847 supports=yes
46848
46849 saved_cflags="$CFLAGS"
46850 CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG"
46851 ac_ext=c
46852 ac_cpp='$CPP $CPPFLAGS'
46853 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
46854 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
46855 ac_compiler_gnu=$ac_cv_c_compiler_gnu
46856
46857 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46858 /* end confdefs.h. */
46859 int i;
46860 _ACEOF
46861 if ac_fn_c_try_compile "$LINENO"; then :
46862
46863 else
46864 supports=no
46885 int i;
46886 _ACEOF
46887 if ac_fn_cxx_try_compile "$LINENO"; then :
46888
46889 else
46890 supports=no
46891 fi
46892 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46893 ac_ext=cpp
46894 ac_cpp='$CXXCPP $CPPFLAGS'
46895 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
46896 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
46897 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
46898
46899 CXXFLAGS="$saved_cxxflags"
46900
46901 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
46902 $as_echo "$supports" >&6; }
46903 if test "x$supports" = "xyes" ; then
46904 :
46905 else
46906 STACK_PROTECTOR_CFLAG=""
46907 fi
46908
46909
46910 CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
46911 CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
46912 ;;
46913 esac
46914 fi
46915
46916 # Optimization levels
46917 if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
46918 CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
46919
46920 if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
46921 # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global?
46922 C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
46923 C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
46924 C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
46925 C_O_FLAG_DEBUG="-xregs=no%frameptr"
46926 C_O_FLAG_NONE="-xregs=no%frameptr"
46927 CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
46928 CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
46929 CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
47367
47368
47369
47370 LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
47371 LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
47372
47373
47374
47375
47376
47377 # Some Zero and Shark settings.
47378 # ZERO_ARCHFLAG tells the compiler which mode to build for
47379 case "${OPENJDK_TARGET_CPU}" in
47380 s390)
47381 ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31"
47382 ;;
47383 *)
47384 ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
47385 esac
47386
47387 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$ZERO_ARCHFLAG\"" >&5
47388 $as_echo_n "checking if compiler supports \"$ZERO_ARCHFLAG\"... " >&6; }
47389 supports=yes
47390
47391 saved_cflags="$CFLAGS"
47392 CFLAGS="$CFLAGS $ZERO_ARCHFLAG"
47393 ac_ext=c
47394 ac_cpp='$CPP $CPPFLAGS'
47395 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47396 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47397 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47398
47399 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47400 /* end confdefs.h. */
47401 int i;
47402 _ACEOF
47403 if ac_fn_c_try_compile "$LINENO"; then :
47404
47405 else
47406 supports=no
47427 int i;
47428 _ACEOF
47429 if ac_fn_cxx_try_compile "$LINENO"; then :
47430
47431 else
47432 supports=no
47433 fi
47434 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47435 ac_ext=cpp
47436 ac_cpp='$CXXCPP $CPPFLAGS'
47437 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47438 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47439 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47440
47441 CXXFLAGS="$saved_cxxflags"
47442
47443 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47444 $as_echo "$supports" >&6; }
47445 if test "x$supports" = "xyes" ; then
47446 :
47447 else
47448 ZERO_ARCHFLAG=""
47449 fi
47450
47451
47452
47453 # Check that the compiler supports -mX (or -qX on AIX) flags
47454 # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
47455
47456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"" >&5
47457 $as_echo_n "checking if compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"... " >&6; }
47458 supports=yes
47459
47460 saved_cflags="$CFLAGS"
47461 CFLAGS="$CFLAGS ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
47462 ac_ext=c
47463 ac_cpp='$CPP $CPPFLAGS'
47464 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47465 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47466 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47467
47468 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47469 /* end confdefs.h. */
47470 int i;
47471 _ACEOF
47472 if ac_fn_c_try_compile "$LINENO"; then :
47473
47474 else
47475 supports=no
47495 /* end confdefs.h. */
47496 int i;
47497 _ACEOF
47498 if ac_fn_cxx_try_compile "$LINENO"; then :
47499
47500 else
47501 supports=no
47502 fi
47503 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47504 ac_ext=cpp
47505 ac_cpp='$CXXCPP $CPPFLAGS'
47506 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47507 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47508 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47509
47510 CXXFLAGS="$saved_cxxflags"
47511
47512 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47513 $as_echo "$supports" >&6; }
47514 if test "x$supports" = "xyes" ; then
47515 COMPILER_SUPPORTS_TARGET_BITS_FLAG=true
47516 else
47517 COMPILER_SUPPORTS_TARGET_BITS_FLAG=false
47518 fi
47519
47520
47521
47522 # Check whether --enable-warnings-as-errors was given.
47523 if test "${enable_warnings_as_errors+set}" = set; then :
47524 enableval=$enable_warnings_as_errors;
47525 fi
47526
47527
47528 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native warnings are errors" >&5
47529 $as_echo_n "checking if native warnings are errors... " >&6; }
47530 if test "x$enable_warnings_as_errors" = "xyes"; then
47531 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitely set)" >&5
47532 $as_echo "yes (explicitely set)" >&6; }
47533 WARNINGS_AS_ERRORS=true
47534 elif test "x$enable_warnings_as_errors" = "xno"; then
47535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47536 $as_echo "no" >&6; }
47537 WARNINGS_AS_ERRORS=false
47538 elif test "x$enable_warnings_as_errors" = "x"; then
47539 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
47540 $as_echo "yes (default)" >&6; }
47541 WARNINGS_AS_ERRORS=true
47548 HOTSPOT_SET_WARNINGS_AS_ERRORS="WARNINGS_ARE_ERRORS="
47549 else
47550 HOTSPOT_SET_WARNINGS_AS_ERRORS=""
47551 fi
47552
47553
47554
47555
47556 case "${TOOLCHAIN_TYPE}" in
47557 microsoft)
47558 DISABLE_WARNING_PREFIX="-wd"
47559 CFLAGS_WARNINGS_ARE_ERRORS="-WX"
47560 ;;
47561 solstudio)
47562 DISABLE_WARNING_PREFIX="-erroff="
47563 CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
47564 ;;
47565 gcc)
47566 # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
47567
47568 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
47569 $as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
47570 supports=yes
47571
47572 saved_cflags="$CFLAGS"
47573 CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist"
47574 ac_ext=c
47575 ac_cpp='$CPP $CPPFLAGS'
47576 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47577 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47578 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47579
47580 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47581 /* end confdefs.h. */
47582 int i;
47583 _ACEOF
47584 if ac_fn_c_try_compile "$LINENO"; then :
47585
47586 else
47587 supports=no
47607 /* end confdefs.h. */
47608 int i;
47609 _ACEOF
47610 if ac_fn_cxx_try_compile "$LINENO"; then :
47611
47612 else
47613 supports=no
47614 fi
47615 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47616 ac_ext=cpp
47617 ac_cpp='$CXXCPP $CPPFLAGS'
47618 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47619 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47620 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47621
47622 CXXFLAGS="$saved_cxxflags"
47623
47624 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47625 $as_echo "$supports" >&6; }
47626 if test "x$supports" = "xyes" ; then
47627 GCC_CAN_DISABLE_WARNINGS=true
47628 else
47629 GCC_CAN_DISABLE_WARNINGS=false
47630
47631 fi
47632
47633 if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
47634 DISABLE_WARNING_PREFIX="-Wno-"
47635 else
47636 DISABLE_WARNING_PREFIX=
47637 fi
47638 CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
47639 # Repeate the check for the BUILD_CC
47640 CC_OLD="$CC"
47641 CC="$BUILD_CC"
47642
47643 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
47644 $as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
47645 supports=yes
47646
47647 saved_cflags="$CFLAGS"
47648 CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist"
47649 ac_ext=c
47650 ac_cpp='$CPP $CPPFLAGS'
47651 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47652 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47653 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47654
47655 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47656 /* end confdefs.h. */
47657 int i;
47658 _ACEOF
47659 if ac_fn_c_try_compile "$LINENO"; then :
47660
47661 else
47662 supports=no
47682 /* end confdefs.h. */
47683 int i;
47684 _ACEOF
47685 if ac_fn_cxx_try_compile "$LINENO"; then :
47686
47687 else
47688 supports=no
47689 fi
47690 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47691 ac_ext=cpp
47692 ac_cpp='$CXXCPP $CPPFLAGS'
47693 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47694 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47695 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47696
47697 CXXFLAGS="$saved_cxxflags"
47698
47699 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47700 $as_echo "$supports" >&6; }
47701 if test "x$supports" = "xyes" ; then
47702 BUILD_CC_CAN_DISABLE_WARNINGS=true
47703 else
47704 BUILD_CC_CAN_DISABLE_WARNINGS=false
47705
47706 fi
47707
47708 if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
47709 BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
47710 else
47711 BUILD_CC_DISABLE_WARNING_PREFIX=
47712 fi
47713 CC="$CC_OLD"
47714 ;;
47715 clang)
47716 DISABLE_WARNING_PREFIX="-Wno-"
47717 CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
47718 ;;
47719 esac
47720
47721
47722
47723
47724 # Setup debug symbols (need objcopy from the toolchain for that)
47725
47726 #
|
3434 # under the terms of the GNU General Public License version 2 only, as
3435 # published by the Free Software Foundation. Oracle designates this
3436 # particular file as subject to the "Classpath" exception as provided
3437 # by Oracle in the LICENSE file that accompanied this code.
3438 #
3439 # This code is distributed in the hope that it will be useful, but WITHOUT
3440 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3441 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3442 # version 2 for more details (a copy is included in the LICENSE file that
3443 # accompanied this code).
3444 #
3445 # You should have received a copy of the GNU General Public License version
3446 # 2 along with this work; if not, write to the Free Software Foundation,
3447 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3448 #
3449 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3450 # or visit www.oracle.com if you need additional information or have any
3451 # questions.
3452 #
3453
3454 # Create a function/macro that takes a series of named arguments. The call is
3455 # similar to AC_DEFUN, but the setup of the function looks like like this:
3456 # BASIC_DEFUN_NAMED([MYFUNC], [FOO *BAR], [$@], [
3457 # ... do something
3458 # AC_MSG_NOTICE([Value of BAR is ARG_BAR])
3459 # ])
3460 # A star (*) in front of a named argument means that it is required and it's
3461 # presence will be verified. To pass e.g. the first value as a normal indexed
3462 # argument, use [m4_shift($@)] as the third argument instead of [$@]. These
3463 # arguments are referenced in the function by their name prefixed by ARG_, e.g.
3464 # "ARG_FOO".
3465 #
3466 # The generated function can be called like this:
3467 # MYFUNC(FOO: [foo-val], BAR:
3468 # [
3469 # $ECHO hello world
3470 # ])
3471 #
3472 #
3473 # Argument 1: Name of the function to define
3474 # Argument 2: List of legal named arguments, with a * prefix for required arguments
3475 # Argument 3: Argument array to treat as named, typically $@
3476 # Argument 4: The main function body
3477
3478
3479 # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
3480 # If so, then append $1 to $2 \
3481 # Also set JVM_ARG_OK to true/false depending on outcome.
3482
3483
3484 # Appends a string to a path variable, only adding the : when needed.
3485
3486
3487 # Prepends a string to a path variable, only adding the : when needed.
3488
3489
3490 # This will make sure the given variable points to a full and proper
3491 # path. This means:
3492 # 1) There will be no spaces in the path. On unix platforms,
3493 # spaces in the path will result in an error. On Windows,
3494 # the path will be rewritten using short-style to be space-free.
3495 # 2) The path will be absolute, and it will be in unix-style (on
3496 # cygwin).
3497 # $1: The name of the variable to fix
3498
3894 # -xrestrict: Pointer parameters to functions do not overlap
3895 # (Similar to -xalias_level=basic usage, but less obvious sometimes.
3896 # If you pass in multiple pointers to the same data, do not use this)
3897 # -xlibmil: Inline some library routines
3898 # (If you expect perfect errno behavior, do not use this)
3899 # -xlibmopt: Use optimized math routines (CURRENTLY DISABLED)
3900 # (If you expect perfect errno behavior, do not use this)
3901 # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
3902
3903 # FIXME: this will never happen since sparc != sparcv9, ie 32 bit, which we don't build anymore.
3904 # Bug?
3905 #if test "x$OPENJDK_TARGET_CPU" = xsparc; then
3906 # CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
3907 # CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
3908 #fi
3909
3910
3911
3912
3913
3914 # FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
3915 # IF_FALSE: [RUN-IF-FALSE])
3916 # ------------------------------------------------------------
3917 # Check that the c and c++ compilers support an argument
3918
3919
3920
3921
3922 # FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
3923 # IF_FALSE: [RUN-IF-FALSE])
3924 # ------------------------------------------------------------
3925 # Check that the linker support an argument
3926
3927
3928
3929
3930
3931
3932 #
3933 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3934 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3935 #
3936 # This code is free software; you can redistribute it and/or modify it
3937 # under the terms of the GNU General Public License version 2 only, as
3938 # published by the Free Software Foundation. Oracle designates this
3939 # particular file as subject to the "Classpath" exception as provided
3940 # by Oracle in the LICENSE file that accompanied this code.
3941 #
3942 # This code is distributed in the hope that it will be useful, but WITHOUT
3943 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3944 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3945 # version 2 for more details (a copy is included in the LICENSE file that
3946 # accompanied this code).
3947 #
3948 # You should have received a copy of the GNU General Public License version
3949 # 2 along with this work; if not, write to the Free Software Foundation,
3950 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3951 #
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836 # This line needs to be here, verbatim, after all includes and the dummy hook
4837 # definitions. It is replaced with custom functionality when building
4838 # custom sources.
4839 #CUSTOM_AUTOCONF_INCLUDE
4840
4841 # Do not change or remove the following line, it is needed for consistency checks:
4842 DATE_WHEN_GENERATED=1452695612
4843
4844 ###############################################################################
4845 #
4846 # Initialization / Boot-strapping
4847 #
4848 # The bootstrapping process needs to solve the "chicken or the egg" problem,
4849 # thus it jumps back and forth, each time gaining something needed later on.
4850 #
4851 ###############################################################################
4852
4853 # If we are requested to print additional help, do that and then exit.
4854 # This must be the very first call.
4855
4856 if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then
4857 $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n"
4858 $PRINTF "Which are valid to use depends on the build platform.\n"
4859 for toolchain in $VALID_TOOLCHAINS_all; do
4860 # Use indirect variable referencing
4861 toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
4862 TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
45370 COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
45371 if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
45372 if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
45373 as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\" or \"x86\"." "$LINENO" 5
45374 fi
45375 elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
45376 if test "x$COMPILER_CPU_TEST" != "xx64"; then
45377 as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5
45378 fi
45379 fi
45380 fi
45381
45382 if test "x$TOOLCHAIN_TYPE" = xgcc; then
45383 # If this is a --hash-style=gnu system, use --hash-style=both, why?
45384 HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
45385 # This is later checked when setting flags.
45386
45387 # "-Og" suppported for GCC 4.8 and later
45388 CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
45389
45390
45391
45392
45393
45394
45395
45396
45397
45398
45399
45400
45401
45402
45403
45404
45405
45406
45407
45408
45409
45410
45411
45412
45413
45414
45415
45416
45417
45418
45419
45420
45421
45422
45423
45424
45425
45426
45427
45428
45429
45430
45431
45432
45433
45434
45435
45436 # Execute function body
45437
45438 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5
45439 $as_echo_n "checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; }
45440 supports=yes
45441
45442 saved_cflags="$CFLAGS"
45443 CFLAGS="$CFLAGS $CFLAG_OPTIMIZE_DEBUG_FLAG"
45444 ac_ext=c
45445 ac_cpp='$CPP $CPPFLAGS'
45446 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45447 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45448 ac_compiler_gnu=$ac_cv_c_compiler_gnu
45449
45450 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45451 /* end confdefs.h. */
45452 int i;
45453 _ACEOF
45454 if ac_fn_c_try_compile "$LINENO"; then :
45455
45456 else
45457 supports=no
45477 /* end confdefs.h. */
45478 int i;
45479 _ACEOF
45480 if ac_fn_cxx_try_compile "$LINENO"; then :
45481
45482 else
45483 supports=no
45484 fi
45485 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45486 ac_ext=cpp
45487 ac_cpp='$CXXCPP $CPPFLAGS'
45488 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45489 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45490 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
45491
45492 CXXFLAGS="$saved_cxxflags"
45493
45494 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
45495 $as_echo "$supports" >&6; }
45496 if test "x$supports" = "xyes" ; then
45497 :
45498 HAS_CFLAG_OPTIMIZE_DEBUG=true
45499 else
45500 :
45501 HAS_CFLAG_OPTIMIZE_DEBUG=false
45502 fi
45503
45504
45505
45506
45507
45508
45509
45510
45511
45512
45513
45514
45515
45516 # "-z relro" supported in GNU binutils 2.17 and later
45517 LINKER_RELRO_FLAG="-Wl,-z,relro"
45518
45519
45520
45521
45522
45523
45524
45525
45526
45527
45528
45529
45530
45531
45532
45533
45534
45535
45536
45537
45538
45539
45540
45541
45542
45543
45544
45545
45546
45547
45548
45549
45550
45551
45552
45553
45554
45555
45556
45557
45558
45559
45560
45561
45562
45563
45564
45565 # Execute function body
45566
45567 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5
45568 $as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; }
45569 supports=yes
45570
45571 saved_ldflags="$LDFLAGS"
45572 LDFLAGS="$LDFLAGS $LINKER_RELRO_FLAG"
45573 ac_ext=c
45574 ac_cpp='$CPP $CPPFLAGS'
45575 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45576 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45577 ac_compiler_gnu=$ac_cv_c_compiler_gnu
45578
45579 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45580 /* end confdefs.h. */
45581
45582 int
45583 main ()
45584 {
45585
45586 ;
45588 }
45589 _ACEOF
45590 if ac_fn_c_try_link "$LINENO"; then :
45591
45592 else
45593 supports=no
45594 fi
45595 rm -f core conftest.err conftest.$ac_objext \
45596 conftest$ac_exeext conftest.$ac_ext
45597 ac_ext=cpp
45598 ac_cpp='$CXXCPP $CPPFLAGS'
45599 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45600 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45601 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
45602
45603 LDFLAGS="$saved_ldflags"
45604
45605 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
45606 $as_echo "$supports" >&6; }
45607 if test "x$supports" = "xyes" ; then
45608 :
45609 HAS_LINKER_RELRO=true
45610 else
45611 :
45612 HAS_LINKER_RELRO=false
45613 fi
45614
45615
45616
45617
45618
45619
45620
45621
45622
45623
45624
45625
45626
45627 # "-z now" supported in GNU binutils 2.11 and later
45628 LINKER_NOW_FLAG="-Wl,-z,now"
45629
45630
45631
45632
45633
45634
45635
45636
45637
45638
45639
45640
45641
45642
45643
45644
45645
45646
45647
45648
45649
45650
45651
45652
45653
45654
45655
45656
45657
45658
45659
45660
45661
45662
45663
45664
45665
45666
45667
45668
45669
45670
45671
45672
45673
45674
45675
45676 # Execute function body
45677
45678 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5
45679 $as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; }
45680 supports=yes
45681
45682 saved_ldflags="$LDFLAGS"
45683 LDFLAGS="$LDFLAGS $LINKER_NOW_FLAG"
45684 ac_ext=c
45685 ac_cpp='$CPP $CPPFLAGS'
45686 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45687 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45688 ac_compiler_gnu=$ac_cv_c_compiler_gnu
45689
45690 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45691 /* end confdefs.h. */
45692
45693 int
45694 main ()
45695 {
45696
45697 ;
45699 }
45700 _ACEOF
45701 if ac_fn_c_try_link "$LINENO"; then :
45702
45703 else
45704 supports=no
45705 fi
45706 rm -f core conftest.err conftest.$ac_objext \
45707 conftest$ac_exeext conftest.$ac_ext
45708 ac_ext=cpp
45709 ac_cpp='$CXXCPP $CPPFLAGS'
45710 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
45711 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
45712 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
45713
45714 LDFLAGS="$saved_ldflags"
45715
45716 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
45717 $as_echo "$supports" >&6; }
45718 if test "x$supports" = "xyes" ; then
45719 :
45720 HAS_LINKER_NOW=true
45721 else
45722 :
45723 HAS_LINKER_NOW=false
45724 fi
45725
45726
45727
45728
45729
45730
45731
45732
45733
45734
45735
45736
45737 fi
45738
45739 # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
45740 # in executable.'
45741 USING_BROKEN_SUSE_LD=no
45742 if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
45743 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5
45744 $as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; }
45745 $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
45746 $ECHO "int main() { }" > main.c
45747 if $CXX -Wl,-version-script=version-script.map main.c 2>&5 >&5; then
45748 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45749 $as_echo "no" >&6; }
45750 USING_BROKEN_SUSE_LD=no
45751 else
45752 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45753 $as_echo "yes" >&6; }
45754 USING_BROKEN_SUSE_LD=yes
45755 fi
45756 rm -rf version-script.map main.c a.out
47037 CFLAGS_DEBUG_SYMBOLS="-g"
47038 CXXFLAGS_DEBUG_SYMBOLS="-g"
47039 fi
47040
47041
47042
47043 # bounds, memory and behavior checking options
47044 if test "x$TOOLCHAIN_TYPE" = xgcc; then
47045 case $DEBUG_LEVEL in
47046 release )
47047 # no adjustment
47048 ;;
47049 fastdebug )
47050 # no adjustment
47051 ;;
47052 slowdebug )
47053 # Add runtime stack smashing and undefined behavior checks.
47054 # Not all versions of gcc support -fstack-protector
47055 STACK_PROTECTOR_CFLAG="-fstack-protector-all"
47056
47057
47058
47059
47060
47061
47062
47063
47064
47065
47066
47067
47068
47069
47070
47071
47072
47073
47074
47075
47076
47077
47078
47079
47080
47081
47082
47083
47084
47085
47086
47087
47088
47089
47090
47091
47092
47093
47094
47095
47096
47097
47098 # Execute function body
47099
47100 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"" >&5
47101 $as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"... " >&6; }
47102 supports=yes
47103
47104 saved_cflags="$CFLAGS"
47105 CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG"
47106 ac_ext=c
47107 ac_cpp='$CPP $CPPFLAGS'
47108 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47109 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47110 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47111
47112 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47113 /* end confdefs.h. */
47114 int i;
47115 _ACEOF
47116 if ac_fn_c_try_compile "$LINENO"; then :
47117
47118 else
47119 supports=no
47140 int i;
47141 _ACEOF
47142 if ac_fn_cxx_try_compile "$LINENO"; then :
47143
47144 else
47145 supports=no
47146 fi
47147 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47148 ac_ext=cpp
47149 ac_cpp='$CXXCPP $CPPFLAGS'
47150 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47151 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47152 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47153
47154 CXXFLAGS="$saved_cxxflags"
47155
47156 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47157 $as_echo "$supports" >&6; }
47158 if test "x$supports" = "xyes" ; then
47159 :
47160
47161 else
47162 :
47163 STACK_PROTECTOR_CFLAG=""
47164 fi
47165
47166
47167
47168
47169
47170
47171
47172
47173
47174
47175
47176
47177
47178 CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
47179 CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
47180 ;;
47181 esac
47182 fi
47183
47184 # Optimization levels
47185 if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
47186 CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
47187
47188 if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
47189 # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global?
47190 C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
47191 C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
47192 C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
47193 C_O_FLAG_DEBUG="-xregs=no%frameptr"
47194 C_O_FLAG_NONE="-xregs=no%frameptr"
47195 CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
47196 CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
47197 CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
47635
47636
47637
47638 LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
47639 LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
47640
47641
47642
47643
47644
47645 # Some Zero and Shark settings.
47646 # ZERO_ARCHFLAG tells the compiler which mode to build for
47647 case "${OPENJDK_TARGET_CPU}" in
47648 s390)
47649 ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31"
47650 ;;
47651 *)
47652 ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
47653 esac
47654
47655
47656
47657
47658
47659
47660
47661
47662
47663
47664
47665
47666
47667
47668
47669
47670
47671
47672
47673
47674
47675
47676
47677
47678
47679
47680
47681
47682
47683
47684
47685
47686
47687
47688
47689
47690
47691
47692
47693
47694
47695
47696 # Execute function body
47697
47698 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$ZERO_ARCHFLAG\"" >&5
47699 $as_echo_n "checking if compiler supports \"$ZERO_ARCHFLAG\"... " >&6; }
47700 supports=yes
47701
47702 saved_cflags="$CFLAGS"
47703 CFLAGS="$CFLAGS $ZERO_ARCHFLAG"
47704 ac_ext=c
47705 ac_cpp='$CPP $CPPFLAGS'
47706 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47707 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47708 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47709
47710 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47711 /* end confdefs.h. */
47712 int i;
47713 _ACEOF
47714 if ac_fn_c_try_compile "$LINENO"; then :
47715
47716 else
47717 supports=no
47738 int i;
47739 _ACEOF
47740 if ac_fn_cxx_try_compile "$LINENO"; then :
47741
47742 else
47743 supports=no
47744 fi
47745 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47746 ac_ext=cpp
47747 ac_cpp='$CXXCPP $CPPFLAGS'
47748 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47749 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47750 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47751
47752 CXXFLAGS="$saved_cxxflags"
47753
47754 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47755 $as_echo "$supports" >&6; }
47756 if test "x$supports" = "xyes" ; then
47757 :
47758
47759 else
47760 :
47761 ZERO_ARCHFLAG=""
47762 fi
47763
47764
47765
47766
47767
47768
47769
47770
47771
47772
47773
47774
47775
47776
47777 # Check that the compiler supports -mX (or -qX on AIX) flags
47778 # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
47779
47780
47781
47782
47783
47784
47785
47786
47787
47788
47789
47790
47791
47792
47793
47794
47795
47796
47797
47798
47799
47800
47801
47802
47803
47804
47805
47806
47807
47808
47809
47810
47811
47812
47813
47814
47815
47816
47817
47818
47819
47820
47821
47822
47823
47824
47825
47826 # Execute function body
47827
47828 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"" >&5
47829 $as_echo_n "checking if compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"... " >&6; }
47830 supports=yes
47831
47832 saved_cflags="$CFLAGS"
47833 CFLAGS="$CFLAGS ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
47834 ac_ext=c
47835 ac_cpp='$CPP $CPPFLAGS'
47836 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47837 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47838 ac_compiler_gnu=$ac_cv_c_compiler_gnu
47839
47840 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47841 /* end confdefs.h. */
47842 int i;
47843 _ACEOF
47844 if ac_fn_c_try_compile "$LINENO"; then :
47845
47846 else
47847 supports=no
47867 /* end confdefs.h. */
47868 int i;
47869 _ACEOF
47870 if ac_fn_cxx_try_compile "$LINENO"; then :
47871
47872 else
47873 supports=no
47874 fi
47875 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47876 ac_ext=cpp
47877 ac_cpp='$CXXCPP $CPPFLAGS'
47878 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
47879 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
47880 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
47881
47882 CXXFLAGS="$saved_cxxflags"
47883
47884 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
47885 $as_echo "$supports" >&6; }
47886 if test "x$supports" = "xyes" ; then
47887 :
47888 COMPILER_SUPPORTS_TARGET_BITS_FLAG=true
47889 else
47890 :
47891 COMPILER_SUPPORTS_TARGET_BITS_FLAG=false
47892 fi
47893
47894
47895
47896
47897
47898
47899
47900
47901
47902
47903
47904
47905
47906
47907 # Check whether --enable-warnings-as-errors was given.
47908 if test "${enable_warnings_as_errors+set}" = set; then :
47909 enableval=$enable_warnings_as_errors;
47910 fi
47911
47912
47913 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if native warnings are errors" >&5
47914 $as_echo_n "checking if native warnings are errors... " >&6; }
47915 if test "x$enable_warnings_as_errors" = "xyes"; then
47916 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitely set)" >&5
47917 $as_echo "yes (explicitely set)" >&6; }
47918 WARNINGS_AS_ERRORS=true
47919 elif test "x$enable_warnings_as_errors" = "xno"; then
47920 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47921 $as_echo "no" >&6; }
47922 WARNINGS_AS_ERRORS=false
47923 elif test "x$enable_warnings_as_errors" = "x"; then
47924 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
47925 $as_echo "yes (default)" >&6; }
47926 WARNINGS_AS_ERRORS=true
47933 HOTSPOT_SET_WARNINGS_AS_ERRORS="WARNINGS_ARE_ERRORS="
47934 else
47935 HOTSPOT_SET_WARNINGS_AS_ERRORS=""
47936 fi
47937
47938
47939
47940
47941 case "${TOOLCHAIN_TYPE}" in
47942 microsoft)
47943 DISABLE_WARNING_PREFIX="-wd"
47944 CFLAGS_WARNINGS_ARE_ERRORS="-WX"
47945 ;;
47946 solstudio)
47947 DISABLE_WARNING_PREFIX="-erroff="
47948 CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
47949 ;;
47950 gcc)
47951 # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
47952
47953
47954
47955
47956
47957
47958
47959
47960
47961
47962
47963
47964
47965
47966
47967
47968
47969
47970
47971
47972
47973
47974
47975
47976
47977
47978
47979
47980
47981
47982
47983
47984
47985
47986
47987
47988
47989
47990
47991
47992
47993
47994
47995
47996
47997
47998
47999 # Execute function body
48000
48001 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
48002 $as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
48003 supports=yes
48004
48005 saved_cflags="$CFLAGS"
48006 CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist"
48007 ac_ext=c
48008 ac_cpp='$CPP $CPPFLAGS'
48009 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
48010 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
48011 ac_compiler_gnu=$ac_cv_c_compiler_gnu
48012
48013 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48014 /* end confdefs.h. */
48015 int i;
48016 _ACEOF
48017 if ac_fn_c_try_compile "$LINENO"; then :
48018
48019 else
48020 supports=no
48040 /* end confdefs.h. */
48041 int i;
48042 _ACEOF
48043 if ac_fn_cxx_try_compile "$LINENO"; then :
48044
48045 else
48046 supports=no
48047 fi
48048 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48049 ac_ext=cpp
48050 ac_cpp='$CXXCPP $CPPFLAGS'
48051 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
48052 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
48053 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
48054
48055 CXXFLAGS="$saved_cxxflags"
48056
48057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
48058 $as_echo "$supports" >&6; }
48059 if test "x$supports" = "xyes" ; then
48060 :
48061 GCC_CAN_DISABLE_WARNINGS=true
48062 else
48063 :
48064 GCC_CAN_DISABLE_WARNINGS=false
48065
48066 fi
48067
48068
48069
48070
48071
48072
48073
48074
48075
48076
48077
48078
48079 if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
48080 DISABLE_WARNING_PREFIX="-Wno-"
48081 else
48082 DISABLE_WARNING_PREFIX=
48083 fi
48084 CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
48085 # Repeate the check for the BUILD_CC
48086 CC_OLD="$CC"
48087 CC="$BUILD_CC"
48088
48089
48090
48091
48092
48093
48094
48095
48096
48097
48098
48099
48100
48101
48102
48103
48104
48105
48106
48107
48108
48109
48110
48111
48112
48113
48114
48115
48116
48117
48118
48119
48120
48121
48122
48123
48124
48125
48126
48127
48128
48129
48130
48131
48132
48133
48134
48135 # Execute function body
48136
48137 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
48138 $as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
48139 supports=yes
48140
48141 saved_cflags="$CFLAGS"
48142 CFLAGS="$CFLAGS -Wno-this-is-a-warning-that-do-not-exist"
48143 ac_ext=c
48144 ac_cpp='$CPP $CPPFLAGS'
48145 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
48146 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
48147 ac_compiler_gnu=$ac_cv_c_compiler_gnu
48148
48149 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48150 /* end confdefs.h. */
48151 int i;
48152 _ACEOF
48153 if ac_fn_c_try_compile "$LINENO"; then :
48154
48155 else
48156 supports=no
48176 /* end confdefs.h. */
48177 int i;
48178 _ACEOF
48179 if ac_fn_cxx_try_compile "$LINENO"; then :
48180
48181 else
48182 supports=no
48183 fi
48184 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48185 ac_ext=cpp
48186 ac_cpp='$CXXCPP $CPPFLAGS'
48187 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
48188 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
48189 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
48190
48191 CXXFLAGS="$saved_cxxflags"
48192
48193 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
48194 $as_echo "$supports" >&6; }
48195 if test "x$supports" = "xyes" ; then
48196 :
48197 BUILD_CC_CAN_DISABLE_WARNINGS=true
48198 else
48199 :
48200 BUILD_CC_CAN_DISABLE_WARNINGS=false
48201
48202 fi
48203
48204
48205
48206
48207
48208
48209
48210
48211
48212
48213
48214
48215 if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
48216 BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
48217 else
48218 BUILD_CC_DISABLE_WARNING_PREFIX=
48219 fi
48220 CC="$CC_OLD"
48221 ;;
48222 clang)
48223 DISABLE_WARNING_PREFIX="-Wno-"
48224 CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
48225 ;;
48226 esac
48227
48228
48229
48230
48231 # Setup debug symbols (need objcopy from the toolchain for that)
48232
48233 #
|