< prev index next >

common/autoconf/toolchain.m4

Print this page
rev 1225 : 8065648: Remove the flag -fsanitize=undefined for GCC 4.9 and later


 695         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".])
 696       fi
 697     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
 698       if test "x$COMPILER_CPU_TEST" != "xx64"; then
 699         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
 700       fi
 701     fi
 702   fi
 703 
 704   if test "x$TOOLCHAIN_TYPE" = xgcc; then
 705     # If this is a --hash-style=gnu system, use --hash-style=both, why?
 706     HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
 707     # This is later checked when setting flags.
 708 
 709     # "-Og" suppported for GCC 4.8 and later
 710     CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
 711     FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG],
 712       [HAS_CFLAG_OPTIMIZE_DEBUG=true],
 713       [HAS_CFLAG_OPTIMIZE_DEBUG=false])
 714 
 715     # "-fsanitize=undefined" supported for GCC 4.9 and later
 716     CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
 717     FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG],
 718       [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true],
 719       [HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false])
 720 
 721     # "-z relro" supported in GNU binutils 2.17 and later
 722     LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
 723     FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
 724       [HAS_LINKER_RELRO=true],
 725       [HAS_LINKER_RELRO=false])
 726 
 727     # "-z now" supported in GNU binutils 2.11 and later
 728     LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
 729     FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
 730       [HAS_LINKER_NOW=true],
 731       [HAS_LINKER_NOW=false])
 732   fi
 733 
 734   # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
 735   # in executable.'
 736   USING_BROKEN_SUSE_LD=no
 737   if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
 738     AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
 739     $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
 740     $ECHO "int main() { }" > main.c




 695         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".])
 696       fi
 697     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
 698       if test "x$COMPILER_CPU_TEST" != "xx64"; then
 699         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
 700       fi
 701     fi
 702   fi
 703 
 704   if test "x$TOOLCHAIN_TYPE" = xgcc; then
 705     # If this is a --hash-style=gnu system, use --hash-style=both, why?
 706     HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
 707     # This is later checked when setting flags.
 708 
 709     # "-Og" suppported for GCC 4.8 and later
 710     CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
 711     FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG],
 712       [HAS_CFLAG_OPTIMIZE_DEBUG=true],
 713       [HAS_CFLAG_OPTIMIZE_DEBUG=false])
 714 






 715     # "-z relro" supported in GNU binutils 2.17 and later
 716     LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
 717     FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
 718       [HAS_LINKER_RELRO=true],
 719       [HAS_LINKER_RELRO=false])
 720 
 721     # "-z now" supported in GNU binutils 2.11 and later
 722     LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
 723     FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
 724       [HAS_LINKER_NOW=true],
 725       [HAS_LINKER_NOW=false])
 726   fi
 727 
 728   # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
 729   # in executable.'
 730   USING_BROKEN_SUSE_LD=no
 731   if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then
 732     AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
 733     $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
 734     $ECHO "int main() { }" > main.c


< prev index next >