< prev index next >

make/autoconf/toolchain.m4

Print this page
8209817: stack is executable when building with Clang on Linux
Reviewed-by: dholmes, martin, mikael, ihse
Contributed-by: Arthur Eubanks <aeubanks@google.com>


1006     # On Windows, double-check that we got the right compiler.
1007     CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
1008     COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
1009     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
1010       if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
1011         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86" or "x86".])
1012       fi
1013     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
1014       if test "x$COMPILER_CPU_TEST" != "xx64"; then
1015         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
1016       fi
1017     fi
1018   fi
1019 
1020   if test "x$TOOLCHAIN_TYPE" = xgcc; then
1021     # If this is a --hash-style=gnu system, use --hash-style=both, why?
1022     HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
1023     # This is later checked when setting flags.
1024   fi
1025 






1026   # Setup hotspot lecagy names for toolchains
1027   HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE
1028   if test "x$TOOLCHAIN_TYPE" = xclang; then
1029     HOTSPOT_TOOLCHAIN_TYPE=gcc
1030   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
1031     HOTSPOT_TOOLCHAIN_TYPE=visCPP
1032   fi
1033   AC_SUBST(HOTSPOT_TOOLCHAIN_TYPE)
1034 ])
1035 
1036 # Setup the JTReg Regression Test Harness.
1037 AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
1038 [
1039   AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
1040       [Regression Test Harness @<:@probed@:>@])])
1041 
1042   if test "x$with_jtreg" = xno; then
1043     # jtreg disabled
1044     AC_MSG_CHECKING([for jtreg test harness])
1045     AC_MSG_RESULT([no, disabled])




1006     # On Windows, double-check that we got the right compiler.
1007     CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
1008     COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
1009     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
1010       if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
1011         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86" or "x86".])
1012       fi
1013     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
1014       if test "x$COMPILER_CPU_TEST" != "xx64"; then
1015         AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
1016       fi
1017     fi
1018   fi
1019 
1020   if test "x$TOOLCHAIN_TYPE" = xgcc; then
1021     # If this is a --hash-style=gnu system, use --hash-style=both, why?
1022     HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
1023     # This is later checked when setting flags.
1024   fi
1025 
1026   if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
1027     # Check if linker has -z noexecstack.
1028     HAS_NOEXECSTACK=`$CC -Wl,--help 2>/dev/null | $GREP 'z noexecstack'`
1029     # This is later checked when setting flags.
1030   fi
1031 
1032   # Setup hotspot lecagy names for toolchains
1033   HOTSPOT_TOOLCHAIN_TYPE=$TOOLCHAIN_TYPE
1034   if test "x$TOOLCHAIN_TYPE" = xclang; then
1035     HOTSPOT_TOOLCHAIN_TYPE=gcc
1036   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
1037     HOTSPOT_TOOLCHAIN_TYPE=visCPP
1038   fi
1039   AC_SUBST(HOTSPOT_TOOLCHAIN_TYPE)
1040 ])
1041 
1042 # Setup the JTReg Regression Test Harness.
1043 AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
1044 [
1045   AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
1046       [Regression Test Harness @<:@probed@:>@])])
1047 
1048   if test "x$with_jtreg" = xno; then
1049     # jtreg disabled
1050     AC_MSG_CHECKING([for jtreg test harness])
1051     AC_MSG_RESULT([no, disabled])


< prev index next >