提交 851bec54 编写于 作者: D duke

Merge

......@@ -346,3 +346,4 @@ c1f30ac14db0eaff398429c04cd9fab92e1b4b2a jdk-9+100
c4d72a1620835b5d657b7b6792c2879367d0154f jdk-9+101
6406ecf5d39482623225bb1b3098c2cac6f7d450 jdk-9+102
47d6462e514b2097663305a57d9c844c15d5b609 jdk-9+103
9a38f8b4ba220708db198d08d82fd2144a64777d jdk-9+104
......@@ -573,6 +573,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
# Locate the directory of this script.
AUTOCONF_DIR=$TOPDIR/common/autoconf
# Setup username (for use in adhoc version strings etc)
# Outer [ ] to quote m4.
[ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
AC_SUBST(USERNAME)
])
# Evaluates platform specific overrides for devkit variables.
......
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -80,8 +80,9 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# Solaris Studio does not have a concept of sysroot. Instead we must
# make sure the default include and lib dirs are appended to each
# compile and link command line.
$1SYSROOT_CFLAGS="-I[$]$1SYSROOT/usr/include"
# compile and link command line. Must also add -I-xbuiltin to enable
# inlining of system functions and intrinsics.
$1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
$1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L[$]$1SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
......@@ -425,7 +426,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
# Add runtime stack smashing and undefined behavior checks.
# Not all versions of gcc support -fstack-protector
STACK_PROTECTOR_CFLAG="-fstack-protector-all"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG], IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
......@@ -601,22 +602,22 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
esac
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xlinux; then
if test "x$OPENJDK_TARGET_CPU" = xx86; then
# Force compatibility with i586 on 32 bit intel platforms.
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
ppc )
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
if test "x$OPENJDK_TARGET_CPU" = xx86; then
# Force compatibility with i586 on 32 bit intel platforms.
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
ppc )
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
fi
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
......
......@@ -917,6 +917,7 @@ JVM_VARIANTS
JVM_INTERPRETER
JDK_VARIANT
SET_OPENJDK
USERNAME
CANONICAL_TOPDIR
ORIGINAL_TOPDIR
TOPDIR
......@@ -3834,7 +3835,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -4835,7 +4836,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1454146111
DATE_WHEN_GENERATED=1454926898
###############################################################################
#
......@@ -15652,6 +15653,11 @@ $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid."
# Locate the directory of this script.
AUTOCONF_DIR=$TOPDIR/common/autoconf
# Setup username (for use in adhoc version strings etc)
# Outer [ ] to quote m4.
USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'`
# Check if it's a pure open build or if custom sources are to be used.
......@@ -23429,9 +23435,8 @@ $as_echo "$as_me: WARNING: --with-version-opt value has been sanitized from '$wi
# Default is to calculate a string like this <timestamp>.<username>.<base dir name>
timestamp=`$DATE '+%Y-%m-%d-%H%M%S'`
# Outer [ ] to quote m4.
username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'`
basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'`
VERSION_OPT="$timestamp.$username.$basedirname"
VERSION_OPT="$timestamp.$USERNAME.$basedirname"
fi
fi
......@@ -29968,8 +29973,9 @@ fi
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# Solaris Studio does not have a concept of sysroot. Instead we must
# make sure the default include and lib dirs are appended to each
# compile and link command line.
SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
# compile and link command line. Must also add -I-xbuiltin to enable
# inlining of system functions and intrinsics.
SYSROOT_CFLAGS="-I-xbuiltin -I$SYSROOT/usr/include"
SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
......@@ -42361,8 +42367,9 @@ $as_echo "$BUILD_DEVKIT_ROOT" >&6; }
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# Solaris Studio does not have a concept of sysroot. Instead we must
# make sure the default include and lib dirs are appended to each
# compile and link command line.
BUILD_SYSROOT_CFLAGS="-I$BUILD_SYSROOT/usr/include"
# compile and link command line. Must also add -I-xbuiltin to enable
# inlining of system functions and intrinsics.
BUILD_SYSROOT_CFLAGS="-I-xbuiltin -I$BUILD_SYSROOT/usr/include"
BUILD_SYSROOT_LDFLAGS="-L$BUILD_SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$BUILD_SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
-L$BUILD_SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
......@@ -46191,12 +46198,12 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
# Execute function body
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"" >&5
$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"" >&5
$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"... " >&6; }
supports=yes
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG"
CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG -Werror"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
......@@ -46222,7 +46229,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CFLAGS="$saved_cflags"
saved_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG"
CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG -Werror"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
......@@ -46441,22 +46448,22 @@ $as_echo "$supports" >&6; }
esac
elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xlinux; then
if test "x$OPENJDK_TARGET_CPU" = xx86; then
# Force compatibility with i586 on 32 bit intel platforms.
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
ppc )
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
if test "x$OPENJDK_TARGET_CPU" = xx86; then
# Force compatibility with i586 on 32 bit intel platforms.
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
fi
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
ppc )
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
* )
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
fi
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
......@@ -162,9 +162,8 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
# Default is to calculate a string like this <timestamp>.<username>.<base dir name>
timestamp=`$DATE '+%Y-%m-%d-%H%M%S'`
# Outer [ ] to quote m4.
[ username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
[ basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` ]
VERSION_OPT="$timestamp.$username.$basedirname"
VERSION_OPT="$timestamp.$USERNAME.$basedirname"
fi
fi
......
......@@ -184,6 +184,7 @@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@
COMPANY_NAME:=@COMPANY_NAME@
MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@
MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@
USERNAME:=@USERNAME@
# Different naming strings generated from the above information.
RUNTIME_NAME=$(PRODUCT_NAME) $(PRODUCT_SUFFIX)
......
......@@ -467,18 +467,6 @@ jdk.jvmstat_COPY := aliasmap
################################################################################
jdk.vm.ci_EXCLUDE_FILES += \
jdk/vm/ci/options/processor/OptionProcessor.java \
jdk/vm/ci/service/processor/ServiceProviderProcessor.java \
#
jdk.vm.ci_EXCLUDES += \
META-INF/jvmci.options \
META-INF/jvmci.providers \
#
################################################################################
jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
jdk.xml.bind_CLEAN := .properties
jdk.xml.bind_COPY := .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java
......
......@@ -168,7 +168,7 @@ ifeq ($(HAS_SPEC),)
MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \
USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \
LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \
LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) LOG_CMDLINES=$(LOG_CMDLINES) \
INIT_TARGETS="$(INIT_TARGETS)" \
SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \
PARALLEL_TARGETS="$(PARALLEL_TARGETS)"
......
......@@ -121,6 +121,23 @@ ifeq ($(HAS_SPEC),)
endif
endef
# Look for a given option in the LOG variable, and if found, set a variable
# and remove the option from the LOG variable
# $1: The option to look for
# $2: The option to set to "true" if the option is found
define ParseLogOption
ifneq ($$(findstring $1, $$(LOG)),)
$2 := true
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$(strip $1),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
# since LOG is set from the command line.
override LOG := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
endif
endef
define ParseLogLevel
# Catch old-style VERBOSE= command lines.
ifneq ($$(origin VERBOSE), undefined)
......@@ -131,17 +148,12 @@ ifeq ($(HAS_SPEC),)
# Setup logging according to LOG
# If the "nofile" argument is given, act on it and strip it away
ifneq ($$(findstring nofile, $$(LOG)),)
LOG_NOFILE := true
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# First try to remove ",nofile" if it exists, otherwise just remove "nofile"
LOG_STRIPPED := $$(subst nofile,, $$(subst $$(COMMA)nofile,, $$(LOG)))
# We might have ended up with a leading comma. Remove it
LOG_LEVEL := $$(strip $$(patsubst $$(COMMA)%, %, $$(LOG_STRIPPED)))
else
LOG_LEVEL := $$(LOG)
endif
$$(eval $$(call ParseLogOption, nofile, LOG_NOFILE))
# If the "cmdline" argument is given, act on it and strip it away
$$(eval $$(call ParseLogOption, cmdlines, LOG_CMDLINES))
LOG_LEVEL := $$(LOG)
ifeq ($$(LOG_LEVEL),)
# Set LOG to "warn" as default if not set
......@@ -157,7 +169,9 @@ ifeq ($(HAS_SPEC),)
else ifeq ($$(LOG_LEVEL), trace)
MAKE_LOG_FLAGS :=
else
$$(info Error: LOG must be one of: warn, info, debug or trace.)
$$(info Error: LOG contains unknown option or log level: $$(LOG).)
$$(info LOG can be <level>[,<opt>[...]] where <opt> is nofile | cmdlines)
$$(info and <level> is warn | info | debug | trace)
$$(error Cannot continue)
endif
endef
......
......@@ -339,13 +339,13 @@ define SetupJavaCompilationBody
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps)
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
$(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE))
$$(call MakeDir, $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)))
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
ifneq ($$($1_SJAVAC_ARGS_FILE), )
$$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
endif
$(ECHO) Compiling $1
$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, $$($1_SAFE_NAME), \
$$(call LogWarn, Compiling $1)
$$(call ExecuteWithLog, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, \
$$($1_JVM) $$($1_SJAVAC) \
$$($1_REMOTE) \
-j 1 \
......@@ -406,10 +406,10 @@ define SetupJavaCompilationBody
# When not using sjavac, pass along all sources to javac using an @file.
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
$(MKDIR) -p $$(@D)
$$(call MakeDir, $$(@D))
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
$(ECHO) Compiling `$(WC) $$@.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, $$($1_SAFE_NAME), \
$$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1)
$$(call ExecuteWithLog, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, \
$$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
-implicit:none \
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
......
......@@ -284,7 +284,8 @@ define SetupLogging
WRAPPER_SHELL := $$(BASH) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(findstring yes,$$(IS_GNU_TIME)),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(SHELL)
SHELL := $$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL)
endif
# Never remove warning messages; this is just for completeness
# The warn level can never be turned off
LogWarn = $$(info $$(strip $$1))
LOG_WARN :=
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
LogInfo = $$(info $$(strip $$1))
......@@ -372,7 +373,10 @@ endef
# Make directory without forking mkdir if not needed
# 1: List of directories to create
MakeDir = \
$(strip $(if $(wildcard $1), , $(shell $(MKDIR) -p $1)))
$(strip \
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, $(if $(wildcard $d), , $d)))) \
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
)
################################################################################
# Assign a variable only if it is empty
......@@ -678,22 +682,29 @@ DependOnVariableHelper = \
DependOnVariable = \
$(call DependOnVariableHelper,$(strip $1),$(strip $2))
# LogCmdlines is only intended to be used by ExecuteWithLog
ifeq ($(LOG_CMDLINES), true)
LogCmdlines = $(info $(strip $1))
else
LogCmdlines =
endif
################################################################################
# Failure logging support macros. These are supposed to be used by the Setup*
# compilation macros.
# ExecuteWithLog will run a command and log the output appropriately. This is
# meant to be used by commands that do "real" work, like a compilation.
# The output is stored in a specified log file, which is displayed at the end
# of the build in case of failure. The command line itself is stored in a file,
# and also logged to stdout if the LOG=cmdlines option has been given.
#
# LogFailures will run a command and store a copy of output in a specified file.
# If the command succeeds, the file is deleted, otherwise it is moved to the
# failure-logs directory.
# Param 1 - The base name of the log file / command line file
# Param 2 - A compact but representative name to describe this command
# Param 3 - Command to run
LogFailures = \
( $(ECHO) '$3' > $1.cmdline && \
( $3 > >($(TEE) $1.log) 2> >($(TEE) $1.log >&2) || \
(exitcode=$(DOLLAR)$(DOLLAR)? && \
$(CP) $1.log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(strip $2).log && \
exit $(DOLLAR)$(DOLLAR)exitcode) ) )
# Param 1 - The path to base the name of the log file / command line file on
# Param 2 - The command to run
ExecuteWithLog = \
$(call LogCmdlines, Exececuting: [$(strip $2)]) \
$(call WriteFile, $2, $(strip $1).cmdline) \
( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
( exitcode=$(DOLLAR)? && \
$(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(BUILD_OUTPUT)/%,%,$(strip $1))).log && \
exit $(DOLLAR)exitcode ) )
################################################################################
# Find lib dir for module
......
......@@ -138,7 +138,7 @@ $(eval $(call DefineNativeToolchain, TOOLCHAIN_BUILD_LINK_CXX, \
################################################################################
# Extensions of files handled by this macro.
NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.cc %.m %.mm
NATIVE_SOURCE_EXTENSIONS := %.s %.S %.c %.cpp %.cc %.m %.mm
# Replaces native source extensions with the object file extension in a string.
# Param 1: the string containing source file names with extensions
......@@ -198,7 +198,7 @@ define add_native_source
$1_$2_FLAGS=-x objective-c $(CFLAGS_CCACHE) $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$5
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
else ifneq (,$$(filter %.s,$2))
else ifneq (,$$(filter %.s %.S,$2))
# Compile as assembler file
$1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"'
$1_$2_COMP=$(AS)
......@@ -217,7 +217,7 @@ define add_native_source
# source file override any other with the same name.
ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
$1_OBJS_SO_FAR+=$$($1_$2_OBJ)
ifeq (,$$(filter %.s,$2))
ifeq (,$$(filter %.s %.S,$2))
# And this is the dependency file for this obj file.
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
# The dependency target file lists all dependencies as empty targets
......@@ -246,11 +246,11 @@ define add_native_source
ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
# The Solaris studio compiler doesn't output the full path to the object file in the
# generated deps files. Fixing it with sed. If compiling assembly, don't try this.
$(call LogFailures, $$($1_$2_OBJ), $$($1_SAFE_NAME)_$$(notdir $2), \
$$(call ExecuteWithLog, $$@, \
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
$(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP)
else
$(call LogFailures, $$($1_$2_OBJ), $$($1_SAFE_NAME)_$$(notdir $2), \
$$(call ExecuteWithLog, $$@, \
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
endif
# Create a dependency target file from the dependency file.
......@@ -265,7 +265,7 @@ define add_native_source
# Keep as much as possible on one execution line for best performance on Windows.
# No need to save exit code from compilation since pipefail is always active on
# Windows.
$(call LogFailures, $$($1_$2_OBJ), $$($1_SAFE_NAME)_$$(notdir $2), \
$$(call ExecuteWithLog, $$@, \
$$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
$(CC_OUT_OPTION)$$($1_$2_OBJ) $2) \
| $(GREP) -v -e "^Note: including file:" \
......@@ -315,6 +315,7 @@ endef
# DISABLED_WARNINGS_CXX_<toolchain> Disable the given warnings for the specified
# toolchain when compiling C++ code
# STRIP_SYMBOLS Set to true to strip the final binary if the toolchain allows for it
# DEBUG_SYMBOLS Set to false to disable generation of debug symbols
# STRIPFLAGS Optionally change the flags given to the strip command
SetupNativeCompilation = $(NamedParamsMacroTemplate)
define SetupNativeCompilationBody
......@@ -679,66 +680,68 @@ define SetupNativeCompilationBody
# Need to make sure TARGET is first on list
$1 := $$($1_TARGET)
ifeq ($(COPY_DEBUG_SYMBOLS), true)
# Only copy debug symbols for dynamic libraries and programs.
ifeq ($$($1_STATIC_LIBRARY), )
ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR))
# The dependency on TARGET is needed on windows for debuginfo files
# to be rebuilt properly.
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
ifneq ($$($1_DEBUG_SYMBOLS), false)
# Only copy debug symbols for dynamic libraries and programs.
ifeq ($$($1_STATIC_LIBRARY), )
ifneq ($$($1_OUTPUT_DIR), $$($1_OBJECT_DIR))
# The dependency on TARGET is needed on windows for debuginfo files
# to be rebuilt properly.
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% $$($1_TARGET)
$(CP) $$< $$@
endif
endif
# Generate debuginfo files.
ifeq ($(OPENJDK_TARGET_OS), windows)
$1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
"-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
# No separate command is needed for debuginfo on windows, instead
# touch target to make sure it has a later time stamp than the debug
# symbol files to avoid unnecessary relinking on rebuild.
$1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
# Setup the command line creating debuginfo files, to be run after linking.
# It cannot be run separately since it updates the original target file
$1_CREATE_DEBUGINFO_CMDS := \
$(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
$(CD) $$($1_OUTPUT_DIR) && \
$(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
else ifeq ($(OPENJDK_TARGET_OS), macosx)
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM
# On Macosx, the debuginfo generation doesn't touch the linked binary, but
# to avoid always relinking, touch it anyway to force a later timestamp than
# the dSYM files.
$1_CREATE_DEBUGINFO_CMDS := \
$(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \
$(TOUCH) $$($1_TARGET)
endif # OPENJDK_TARGET_OS
# This dependency dance ensures that debug info files get rebuilt
# properly if deleted.
$$($1_TARGET): $$($1_DEBUGINFO_FILES)
$$($1_DEBUGINFO_FILES): $$($1_ALL_OBJS)
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
$1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz
$1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP))
# The dependency on TARGET is needed for debuginfo files
# to be rebuilt properly.
$$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
# Generate debuginfo files.
ifeq ($(OPENJDK_TARGET_OS), windows)
$1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
"-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
# No separate command is needed for debuginfo on windows, instead
# touch target to make sure it has a later time stamp than the debug
# symbol files to avoid unnecessary relinking on rebuild.
$1_CREATE_DEBUGINFO_CMDS := $(TOUCH) $$($1_TARGET)
else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
# Setup the command line creating debuginfo files, to be run after linking.
# It cannot be run separately since it updates the original target file
$1_CREATE_DEBUGINFO_CMDS := \
$(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
$(CD) $$($1_OUTPUT_DIR) && \
$(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
else ifeq ($(OPENJDK_TARGET_OS), macosx)
$1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM
# On Macosx, the debuginfo generation doesn't touch the linked binary, but
# to avoid always relinking, touch it anyway to force a later timestamp than
# the dSYM files.
$1_CREATE_DEBUGINFO_CMDS := \
$(DSYMUTIL) --out $$($1_DEBUGINFO_FILES) $$($1_TARGET) $$(NEWLINE) \
$(TOUCH) $$($1_TARGET)
endif # OPENJDK_TARGET_OS
# This dependency dance ensures that debug info files get rebuilt
# properly if deleted.
$$($1_TARGET): $$($1_DEBUGINFO_FILES)
$$($1_DEBUGINFO_FILES): $$($1_ALL_OBJS)
ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
$1_DEBUGINFO_ZIP := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).diz
$1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_ZIP))
# The dependency on TARGET is needed for debuginfo files
# to be rebuilt properly.
$$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
$(CD) $$($1_OBJECT_DIR) \
&& $(ZIP) -q -r $$@ $$(notdir $$($1_DEBUGINFO_FILES))
else
$1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES))
endif
endif # !STATIC_LIBRARY
else
$1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES))
endif
endif # !STATIC_LIBRARY
endif # $1_DEBUG_SYMBOLS != false
endif # COPY_DEBUG_SYMBOLS
ifeq ($$($1_STRIP_SYMBOLS), true)
......@@ -786,7 +789,7 @@ define SetupNativeCompilationBody
# on Windows
$$(call LogInfo, Linking $$($1_BASENAME))
ifeq ($(OPENJDK_TARGET_OS), windows)
$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$($1_LIBS) \
$$($1_EXTRA_LIBS)) \
......@@ -795,7 +798,7 @@ define SetupNativeCompilationBody
$$($1_CREATE_DEBUGINFO_CMDS)
$$($1_STRIP_CMD)
else
$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$($1_LIBS) \
$$($1_EXTRA_LIBS)) ; \
......@@ -814,7 +817,7 @@ define SetupNativeCompilationBody
# Generating a static library, ie object file archive.
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
$$(call LogInfo, Archiving $$($1_STATIC_LIBRARY))
$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
$$($1_RES))
ifeq ($(STATIC_BUILD), true)
......@@ -836,7 +839,7 @@ define SetupNativeCompilationBody
$$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
$$($1_VARDEPS_FILE)
$$(call LogInfo, Linking executable $$($1_BASENAME))
$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(EXE_OUT_OPTION)$$($1_TARGET) \
$$($1_ALL_OBJS) $$($1_RES) \
......
......@@ -204,6 +204,9 @@
<export>
<name>javax.security.cert</name>
</export>
<export>
<name>jdk</name>
</export>
<export>
<name>jdk.net</name>
</export>
......@@ -273,6 +276,10 @@
<to>jdk.jfr</to>
<to>jdk.scripting.nashorn</to>
</export>
<export>
<name>jdk.internal.ref</name>
<to>java.desktop</to>
</export>
<export>
<name>jdk.internal</name>
<to>jdk.jfr</to>
......
......@@ -34,6 +34,7 @@ public class Platform {
private static final String vmName = System.getProperty("java.vm.name");
private static final String userName = System.getProperty("user.name");
private static final String compiler = System.getProperty("sun.management.compiler");
private static final String vmInfo = System.getProperty("java.vm.info");
public static boolean isClient() {
return vmName.endsWith(" Client VM");
......@@ -63,6 +64,18 @@ public class Platform {
return compiler.contains("Tiered Compilers");
}
public static boolean isInt() {
return vmInfo.contains("interpreted");
}
public static boolean isMixed() {
return vmInfo.contains("mixed");
}
public static boolean isComp() {
return vmInfo.contains("compiled");
}
public static boolean is32bit() {
return dataModel.equals("32");
}
......@@ -135,12 +148,6 @@ public class Platform {
return isArch("aarch64");
}
private static boolean isArch(String archnameRE) {
return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
.matcher(osArch)
.matches();
}
public static String getOsArch() {
return osArch;
}
......@@ -203,4 +210,10 @@ public class Platform {
public static boolean canAttachOSX() throws Exception {
return userName.equals("root");
}
private static boolean isArch(String archnameRE) {
return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE)
.matcher(osArch)
.matches();
}
}
......@@ -354,7 +354,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
}
private void skipBytes(long length) throws IOException {
in.skipBytes((int)length);
while (length > 0) {
long skipped = in.skip(length);
if (skipped == 0) {
// EOF or other problem, throw exception
throw new EOFException("Couldn't skip enough bytes");
}
length -= skipped;
}
}
private int readVersionHeader() throws IOException {
......@@ -486,12 +493,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
break;
}
case HPROF_GC_OBJ_ARRAY_DUMP: {
int bytesRead = readArray(false);
long bytesRead = readArray(false);
bytesLeft -= bytesRead;
break;
}
case HPROF_GC_PRIM_ARRAY_DUMP: {
int bytesRead = readArray(true);
long bytesRead = readArray(true);
bytesLeft -= bytesRead;
break;
}
......@@ -743,12 +750,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
// Handle a HPROF_GC_OBJ_ARRAY_DUMP or HPROF_GC_PRIM_ARRAY_DUMP
// Return number of bytes read
//
private int readArray(boolean isPrimitive) throws IOException {
private long readArray(boolean isPrimitive) throws IOException {
long start = in.position();
long id = readID();
StackTrace stackTrace = getStackTraceFromSerial(in.readInt());
int num = in.readInt();
int bytesRead = identifierSize + 8;
long bytesRead = identifierSize + 8;
long elementClassID;
if (isPrimitive) {
elementClassID = in.readByte();
......@@ -810,14 +817,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes
}
}
if (primitiveSignature != 0x00) {
int size = elSize * num;
long size = elSize * (long)num;
bytesRead += size;
JavaValueArray va = new JavaValueArray(primitiveSignature, start);
skipBytes(size);
snapshot.addHeapObject(id, va);
snapshot.setSiteTrace(va, stackTrace);
} else {
int sz = num * identifierSize;
long sz = (long)num * identifierSize;
bytesRead += sz;
JavaObjectArray arr = new JavaObjectArray(elementClassID, start);
skipBytes(sz);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册