提交 790152c2 编写于 作者: E erikj

8142983: Enable builds with icecc/icecream

Reviewed-by: ihse
上级 8d6a0ac8
......@@ -246,6 +246,73 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
])
################################################################################
#
# Optionally enable distributed compilation of native code using icecc/icecream
#
AC_DEFUN([BPERF_SETUP_ICECC],
[
AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
[enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
if test "x${enable_icecc}" = "xyes"; then
BASIC_REQUIRE_PROGS(ICECC_CMD, icecc)
old_path="$PATH"
# Look for icecc-create-env in some known places
PATH="$PATH:/usr/lib/icecc:/usr/lib64/icecc"
BASIC_REQUIRE_PROGS(ICECC_CREATE_ENV, icecc-create-env)
# Use icecc-create-env to create a minimal compilation environment that can
# be sent to the other hosts in the icecream cluster.
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
AC_MSG_CHECKING([for icecc build environment for target compiler])
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log}
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
# For clang, the icecc compilerwrapper is needed. It usually resides next
# to icecc-create-env.
BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
else
AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
fi
PATH="$old_path"
# The bundle with the compiler gets a name based on checksums. Parse log file
# to find it.
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
if test "x${COMPILE_TYPE}" = "xcross"; then
# If cross compiling, create a separate env package for the build compiler
AC_MSG_CHECKING([for icecc build environment for build compiler])
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log}
elif test "x${BUILD_CC##*/}" = "xclang"; then
cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
&& ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
else
AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
fi
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"
else
BUILD_ICECC="${ICECC}"
fi
AC_SUBST(ICECC)
AC_SUBST(BUILD_ICECC)
fi
])
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
[
......@@ -258,8 +325,15 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
USE_PRECOMPILED_HEADER=1
AC_MSG_CHECKING([If precompiled header is enabled])
if test "x$ENABLE_PRECOMPH" = xno; then
AC_MSG_RESULT([no, forced])
USE_PRECOMPILED_HEADER=0
elif test "x$ICECC" != "x"; then
AC_MSG_RESULT([no, does not work effectively with icecc])
USE_PRECOMPILED_HEADER=0
else
AC_MSG_RESULT([yes])
fi
if test "x$ENABLE_PRECOMPH" = xyes; then
......
......@@ -236,6 +236,9 @@ BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
# Setup smart javac (after cores and memory have been setup)
BPERF_SETUP_SMART_JAVAC
# Setup use of icecc if requested
BPERF_SETUP_ICECC
# Can the C/C++ compiler use precompiled headers?
BPERF_SETUP_PRECOMPILED_HEADERS
......
......@@ -49,8 +49,8 @@ ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
# compiler that produces code that can be run on the build platform.
HOSTCC:=@FIXPATH@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
HOSTCXX:=@FIXPATH@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
HOSTCC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@ $(BUILD_SYSROOT_CFLAGS)
HOSTCXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@ $(BUILD_SYSROOT_CFLAGS)
####################################################
#
......@@ -105,7 +105,7 @@ USE_CLANG := @USE_CLANG@
# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
# Hotspot has its own handling on the Windows path situation.
CXX:=@CCACHE@ @HOTSPOT_CXX@
CXX:=@CCACHE@ @ICECC@ @HOTSPOT_CXX@
LD:=@HOTSPOT_LD@
MT:=@HOTSPOT_MT@
RC:=@HOTSPOT_RC@
......
......@@ -307,7 +307,7 @@ WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
# Tools that potentially need to be cross compilation aware.
CC:=@FIXPATH@ @CCACHE@ @CC@
CC:=@FIXPATH@ @CCACHE@ @ICECC@ @CC@
# CFLAGS used to compile the jdk native libraries (C-code)
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
......@@ -317,7 +317,7 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
CXX:=@FIXPATH@ @CCACHE@ @CXX@
CXX:=@FIXPATH@ @CCACHE@ @ICECC@ @CXX@
#CXXFLAGS:=@CXXFLAGS@
CPP:=@FIXPATH@ @CPP@
......@@ -360,8 +360,8 @@ LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
# build platform.
BUILD_CC:=@FIXPATH@ @BUILD_CC@
BUILD_CXX:=@FIXPATH@ @BUILD_CXX@
BUILD_CC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@
BUILD_CXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@
BUILD_LD:=@FIXPATH@ @BUILD_LD@
BUILD_AS:=@FIXPATH@ @BUILD_AS@
BUILD_AR:=@FIXPATH@ @BUILD_AR@
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册