# HG changeset patch # User duke # Date 1499280660 -7200 # Node ID 79fb83da8f888dbb061b4fd6da1956c3c44c0ff1 # Parent 43c4580237309905c0d0d3c8742b91572d18c691# Parent 47d1c2c75fb6f7c2a67e19ea1a1981c7675495a8 Merge diff -r 43c458023730 -r 79fb83da8f88 .hgtags-top-repo --- a/.hgtags-top-repo Sat Sep 26 09:21:16 2015 -0700 +++ b/.hgtags-top-repo Wed Jul 05 20:51:00 2017 +0200 @@ -325,3 +325,4 @@ f7c5ae2933c0b8510a420d1713a955e4ffc7ad0b jdk9-b80 b8afcf91331d78626a583ec1b63164468d6f4181 jdk9-b81 42b56d1f418523ecb61a49d7493302c80c8009cc jdk9-b82 +ce5c14d97d95084504c32b9320cb33cce4235588 jdk9-b83 diff -r 43c458023730 -r 79fb83da8f88 common/autoconf/basics.m4 --- a/common/autoconf/basics.m4 Sat Sep 26 09:21:16 2015 -0700 +++ b/common/autoconf/basics.m4 Wed Jul 05 20:51:00 2017 +0200 @@ -445,6 +445,15 @@ # Save the current directory this script was started from CURDIR="$PWD" + # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them + # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED + # was not available at that time. + REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'` + if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then + ORIGINAL_PATH="$REWRITTEN_PATH" + AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH]) + fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then PATH_SEP=";" BASIC_CHECK_PATHS_WINDOWS @@ -935,6 +944,7 @@ BASIC_PATH_PROGS(HG, hg) BASIC_PATH_PROGS(STAT, stat) BASIC_PATH_PROGS(TIME, time) + BASIC_PATH_PROGS(PATCH, [gpatch patch]) # Check if it's GNU time IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` if test "x$IS_GNU_TIME" != x; then diff -r 43c458023730 -r 79fb83da8f88 common/autoconf/compare.sh.in --- a/common/autoconf/compare.sh.in Sat Sep 26 09:21:16 2015 -0700 +++ b/common/autoconf/compare.sh.in Wed Jul 05 20:51:00 2017 +0200 @@ -29,47 +29,50 @@ ########################################################################################## # Substitutions from autoconf -LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@ +export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@ -OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@" -OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@" +export OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@" +export OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@" -AWK="@AWK@" -CAT="@CAT@" -CMP="@CMP@" -CP="@CP@" -CUT="@CUT@" -DIFF="@DIFF@" -DUMPBIN="@FIXPATH@ @DUMPBIN@" -EXPR="@EXPR@" -FILE="@FILE@" -FIND="@FIND@" -GREP="@GREP@" -JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@" -JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage" -LDD="@LDD@" -LN="@LN@" -MKDIR="@MKDIR@" -NAWK="@NAWK@" -NM="@GNM@" -OBJDUMP="@OBJDUMP@" -OTOOL="@OTOOL@" -PRINTF="@PRINTF@" -READELF="@READELF@" -RM="@RM@" -SED="@SED@" -SORT="@SORT@" -STAT="@STAT@" -STRIP="@POST_STRIP_CMD@" -TEE="@TEE@" -UNIQ="@UNIQ@" -UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200" -UNZIP="@UNZIP@" +export AWK="@AWK@" +export BASH="@BASH@" +export CAT="@CAT@" +export CMP="@CMP@" +export CP="@CP@" +export CUT="@CUT@" +export DIFF="@DIFF@" +export DUMPBIN="@FIXPATH@ @DUMPBIN@" +export EXPR="@EXPR@" +export FILE="@FILE@" +export FIND="@FIND@" +export GREP="@GREP@" +export JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@" +export JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage" +export LDD="@LDD@" +export LN="@LN@" +export MKDIR="@MKDIR@" +export MV="@MV@" +export NAWK="@NAWK@" +export NM="@GNM@" +export OBJDUMP="@OBJDUMP@" +export OTOOL="@OTOOL@" +export PRINTF="@PRINTF@" +export READELF="@READELF@" +export RM="@RM@" +export SED="@SED@" +export SORT="@SORT@" +export STAT="@STAT@" +export STRIP="@POST_STRIP_CMD@" +export TEE="@TEE@" +export UNIQ="@UNIQ@" +export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200" +export UNZIP="@UNZIP@" -SRC_ROOT="@TOPDIR@" +export SRC_ROOT="@TOPDIR@" +export OUTPUT_ROOT="@OUTPUT_ROOT@" if [ "$OPENJDK_TARGET_OS" = "windows" ]; then - PATH="@VS_PATH@" + export PATH="@VS_PATH@" fi # Now locate the main script and run it. @@ -79,4 +82,8 @@ exit 1 fi -. "$REAL_COMPARE_SCRIPT" "$@" +# Rotate logs +$RM $OUTPUT_ROOT/compare.log.old 2> /dev/null +$MV $OUTPUT_ROOT/compare.log $OUTPUT_ROOT/compare.log.old 2> /dev/null + +$BASH $SRC_ROOT/common/bin/logger.sh $OUTPUT_ROOT/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@" diff -r 43c458023730 -r 79fb83da8f88 common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Sat Sep 26 09:21:16 2015 -0700 +++ b/common/autoconf/generated-configure.sh Wed Jul 05 20:51:00 2017 +0200 @@ -859,6 +859,7 @@ XATTR DSYMUTIL IS_GNU_TIME +PATCH TIME STAT HG @@ -1174,6 +1175,7 @@ HG STAT TIME +PATCH DSYMUTIL XATTR CODESIGN @@ -2053,6 +2055,7 @@ HG Override default value for HG STAT Override default value for STAT TIME Override default value for TIME + PATCH Override default value for PATCH DSYMUTIL Override default value for DSYMUTIL XATTR Override default value for XATTR CODESIGN Override default value for CODESIGN @@ -4359,7 +4362,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1441958217 +DATE_WHEN_GENERATED=1442820958 ############################################################################### # @@ -13841,6 +13844,16 @@ # Save the current directory this script was started from CURDIR="$PWD" + # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them + # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED + # was not available at that time. + REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'` + if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then + ORIGINAL_PATH="$REWRITTEN_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&5 +$as_echo "$as_me: Rewriting ORIGINAL_PATH to $REWRITTEN_PATH" >&6;} + fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then PATH_SEP=";" @@ -18865,6 +18878,192 @@ fi + + + # Publish this variable in the help. + + + if test "x$PATCH" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in gpatch patch +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATCH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATCH in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATCH=$ac_cv_path_PATCH +if test -n "$PATCH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 +$as_echo "$PATCH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PATCH" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !PATCH! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PATCH!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xPATCH" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PATCH from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of PATCH from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in gpatch patch +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATCH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATCH in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATCH=$ac_cv_path_PATCH +if test -n "$PATCH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 +$as_echo "$PATCH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PATCH" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$PATCH" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PATCH=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool PATCH=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PATCH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PATCH in + [\\/]* | ?:[\\/]*) + ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PATCH=$ac_cv_path_PATCH +if test -n "$PATCH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 +$as_echo "$PATCH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$PATCH" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PATCH=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool PATCH=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PATCH" >&5 +$as_echo_n "checking for PATCH... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool PATCH=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + # Check if it's GNU time IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'` if test "x$IS_GNU_TIME" != x; then diff -r 43c458023730 -r 79fb83da8f88 common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in Sat Sep 26 09:21:16 2015 -0700 +++ b/common/autoconf/spec.gmk.in Wed Jul 05 20:51:00 2017 +0200 @@ -36,6 +36,11 @@ # A self-referential reference to this file. SPEC:=@SPEC@ +# SPACE is defined in MakeBase.gmk, but it is also used in := rules here for some +# toolchains, and is needed if MakeBase.gmk is not included before this file. +X:= +SPACE:=$(X) $(X) + # What make to use for main processing, after bootstrapping top-level Makefile. MAKE := @MAKE@ @@ -495,6 +500,7 @@ MKDIR:=@MKDIR@ MV:=@MV@ NAWK:=@NAWK@ +PATCH:=@PATCH@ PRINTF:=@PRINTF@ PWD:=@THEPWDCMD@ RM:=@RM@ diff -r 43c458023730 -r 79fb83da8f88 common/bin/compare.sh --- a/common/bin/compare.sh Sat Sep 26 09:21:16 2015 -0700 +++ b/common/bin/compare.sh Wed Jul 05 20:51:00 2017 +0200 @@ -88,23 +88,19 @@ TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ $GREP '^[<>]' | \ $SED -e '/[<>] \* from.*\.idl/d' \ - -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ + -e '/[<>] .*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ -e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \ -e '/\/\/ Generated from input file.*/d' \ -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \ -e '/\/\/ java GenerateCharacter.*/d') fi # Ignore date strings in class files. - # On Macosx the system sources for generated java classes produce different output on - # consequtive invocations seemingly randomly. - # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this. # Anonymous lambda classes get randomly assigned counters in their names. if test "x$SUFFIX" = "xclass"; then # To improve performance when large diffs are found, do a rough filtering of classes # elibeble for these exceptions if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' \ -e '[0-9]\{2\}/[0-9]\{2\}/[0-9]\{4\}' \ - -e thePoint -e aPoint -e setItemsPtr \ -e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null; then $JAVAP -c -constants -l -p "${OTHER_FILE}" > ${OTHER_FILE}.javap $JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap @@ -112,9 +108,6 @@ $GREP '^[<>]' | \ $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ -e '/[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}/d' \ - -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \ - -e '/[<>].*public com\.apple\.jobjc\.Pointer].*public void setItemsPtr(com\.apple\.jobjc\.Pointer].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d') fi fi @@ -313,7 +306,7 @@ ! -name "jspawnhelper" \ | $GREP -v "./bin/" | $SORT | $FILTER) - echo General files... + echo Other files with binary differences... for f in $GENERAL_FILES do if [ -e $OTHER_DIR/$f ]; then @@ -590,7 +583,7 @@ ORIG_THIS_FILE="$THIS_FILE" ORIG_OTHER_FILE="$OTHER_FILE" - if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then + if [ "$STRIP_ALL" = "true" ] || [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME $MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other @@ -722,7 +715,7 @@ fi fi - if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then + if [ "$SORT_ALL_SYMBOLS" = "true" ] || [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then SYM_SORT_CMD="sort" else SYM_SORT_CMD="cat" @@ -810,31 +803,34 @@ if [ -z "$FULLDUMP_DIFF_FILTER" ]; then FULLDUMP_DIFF_FILTER="$CAT" fi - $FULLDUMP_CMD $OTHER_FILE | eval "$FULLDUMP_DIFF_FILTER" > $WORK_FILE_BASE.fulldump.other 2>&1 - $FULLDUMP_CMD $THIS_FILE | eval "$FULLDUMP_DIFF_FILTER" > $WORK_FILE_BASE.fulldump.this 2>&1 + $FULLDUMP_CMD $OTHER_FILE | eval "$FULLDUMP_DIFF_FILTER" \ + > $WORK_FILE_BASE.fulldump.other 2>&1 + $FULLDUMP_CMD $THIS_FILE | eval "$FULLDUMP_DIFF_FILTER" \ + > $WORK_FILE_BASE.fulldump.this 2>&1 - LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff + LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \ + > $WORK_FILE_BASE.fulldump.diff if [ -s $WORK_FILE_BASE.fulldump.diff ]; then - ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}') - ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE) - if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_ELF=true - if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then - ELF_MSG="*$ELF_MSG*" + FULLDUMP_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}') + FULLDUMP_MSG=$($PRINTF "%8d" $FULLDUMP_DIFF_SIZE) + if [[ "$ACCEPTED_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_FULLDUMP=true + if [[ "$KNOWN_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then + FULLDUMP_MSG="*$FULLDUMP_MSG*" REGRESSIONS=true else - ELF_MSG=" $ELF_MSG " + FULLDUMP_MSG=" $FULLDUMP_MSG " fi else - ELF_MSG="($ELF_MSG)" - DIFF_ELF= + FULLDUMP_MSG="($FULLDUMP_MSG)" + DIFF_FULLDUMP= fi else - ELF_MSG=" " - DIFF_ELF= - if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then - ELF_MSG=" ! " + FULLDUMP_MSG=" " + DIFF_FULLDUMP= + if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then + FULLDUMP_MSG=" ! " fi fi fi @@ -845,7 +841,7 @@ # To get a raw diff with the complete disassembly, set # DIS_DIFF_FILTER="$CAT" if [ -z "$DIS_DIFF_FILTER" ]; then - DIS_DIFF_FILTER="$GREP -v ' # .* <.*>$'" + DIS_DIFF_FILTER="$GREP -v ' # .* <.*>$' | $SED -r -e 's/(\b|x)([0-9a-fA-F]+)(\b|:|>)/X/g'" fi $DIS_CMD $OTHER_FILE | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1 $DIS_CMD $THIS_FILE | $GREP -v $NAME | eval "$DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 @@ -877,12 +873,12 @@ fi - if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then + if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_FULLDUMP$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi - if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi + if [ -n "$FULLDUMP_MSG" ]; then echo -n "$FULLDUMP_MSG:"; fi if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi echo " $BIN_FILE" if [ "$SHOW_DIFFS" = "true" ]; then @@ -1015,6 +1011,9 @@ echo "-vv More verbose output, shows diff output of all comparisons" echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" echo "" + echo "--sort-symbols Sort all symbols before comparing" + echo "--strip Strip all binaries before comparing" + echo "" echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" echo "Example:" echo "bash ./common/bin/compareimages.sh CodePointIM.jar" @@ -1107,6 +1106,12 @@ shift shift ;; + --sort-symbols) + SORT_ALL_SYMBOLS=true + ;; + --strip) + STRIP_ALL=true + ;; *) CMP_NAMES=false CMP_PERMS=false @@ -1223,7 +1228,7 @@ OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle" OTHER_JRE_BUNDLE="$OTHER/images/jre-bundle" fi - echo "Also comparing macosx bundles" + echo "Also comparing jdk macosx bundles" echo " $THIS_JDK_BUNDLE" echo " $OTHER_JDK_BUNDLE" fi diff -r 43c458023730 -r 79fb83da8f88 make/Init.gmk --- a/make/Init.gmk Sat Sep 26 09:21:16 2015 -0700 +++ b/make/Init.gmk Wed Jul 05 20:51:00 2017 +0200 @@ -50,7 +50,8 @@ include $(topdir)/make/Help.gmk # Targets provided by Init.gmk. - ALL_INIT_TARGETS := print-modules print-targets print-configuration reconfigure + ALL_INIT_TARGETS := print-modules print-targets print-configuration \ + reconfigure pre-compare-build post-compare-build # CALLED_TARGETS is the list of targets that the user provided, # or "default" if unspecified. @@ -163,25 +164,39 @@ $(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))') endif + 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) \ + INIT_TARGETS="$(INIT_TARGETS)" \ + SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \ + PARALLEL_TARGETS="$(PARALLEL_TARGETS)" + # Now the init and main targets will be called, once for each SPEC. The # recipe will be run once for every target specified, but we only want to # execute the recipe a single time, hence the TARGET_DONE with a dummy # command if true. + # The COMPARE_BUILD part implements special support for makefile development. $(ALL_INIT_TARGETS) $(ALL_MAIN_TARGETS): make-info @$(if $(TARGET_DONE), \ true \ , \ + ( cd $(topdir) && \ $(foreach spec, $(SPECS), \ - ( cd $(topdir) && \ $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \ - SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \ - USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \ - LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \ - INIT_TARGETS="$(INIT_TARGETS)" \ - SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \ - PARALLEL_TARGETS="$(PARALLEL_TARGETS)" \ - main ) && \ - ) true \ + SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \ + main && \ + $(if $(and $(COMPARE_BUILD), $(PARALLEL_TARGETS)), \ + $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \ + SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \ + COMPARE_BUILD="$(COMPARE_BUILD)" pre-compare-build && \ + $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -j 1 -f $(topdir)/make/Init.gmk \ + SPEC=$(spec) HAS_SPEC=true $(MAKE_INIT_WITH_SPEC_ARGUMENTS) \ + COMPARE_BUILD="$(COMPARE_BUILD)" main && \ + $(MAKE) $(MFLAGS) $(MAKE_LOG_FLAGS) -r -R -f $(topdir)/make/Init.gmk \ + SPEC=$(spec) HAS_SPEC=true ACTUAL_TOPDIR=$(topdir) \ + COMPARE_BUILD="$(COMPARE_BUILD)" post-compare-build && \ + ) \ + ) true ) \ $(eval TARGET_DONE=true) \ ) @@ -205,6 +220,9 @@ # Verify that the spec file we included seems okay. $(eval $(call CheckSpecSanity)) + # Parse COMPARE_BUILD (for makefile development) + $(eval $(call ParseCompareBuild)) + ifeq ($(LOG_NOFILE), true) # Disable log wrapper if LOG=[level,]nofile was given override BUILD_LOG_WRAPPER := @@ -244,7 +262,7 @@ # The main target, for delegating into Main.gmk ############################################################################## - MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) + MAIN_TARGETS := $(SEQUENTIAL_TARGETS) $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) TARGET_DESCRIPTION := target$(if $(word 2, $(MAIN_TARGETS)),s) \ '$(strip $(MAIN_TARGETS))' in configuration '$(CONF_NAME)' @@ -271,7 +289,7 @@ ( cd $(TOPDIR) && \ $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \ -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \ - $(PARALLEL_TARGETS) || \ + $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) || \ ( exitcode=$$? && $(BUILD_LOG_WRAPPER) \ $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" && \ cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -j 1 -f make/Init.gmk \ @@ -304,5 +322,30 @@ fi $(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n" + # Support targets for COMPARE_BUILD, used for makefile development + pre-compare-build: + $(ECHO) "Preparing for comparison rebuild" + # Apply patch, if any + ifneq ($(COMPARE_BUILD_PATCH), ) + $(PATCH) -p1 < $(COMPARE_BUILD_PATCH) + endif + # Move the first build away and re-create the output directory + ( cd $(TOPDIR) && \ + $(MV) $(OUTPUT_ROOT) $(OUTPUT_ROOT).OLD && \ + $(MKDIR) -p $(OUTPUT_ROOT) ) + # Re-run configure with the same arguments (and possibly some additional), + # must be done after patching. + ( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \ + $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF)) + + post-compare-build: + # Compare first and second build. Ignore any error code from compare.sh. + $(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)" + ifneq ($(COMPARE_BUILD_COMP_DIR), ) + +(cd $(OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) -2dirs $(OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) $(OUTPUT_ROOT).OLD/$(COMPARE_BUILD_COMP_DIR) || true) + else + +(cd $(OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) -o $(OUTPUT_ROOT).OLD || true) + endif + .PHONY: print-targets print-modules reconfigure main on-failure endif diff -r 43c458023730 -r 79fb83da8f88 make/InitSupport.gmk --- a/make/InitSupport.gmk Sat Sep 26 09:21:16 2015 -0700 +++ b/make/InitSupport.gmk Wed Jul 05 20:51:00 2017 +0200 @@ -40,7 +40,7 @@ ############################################################################## # Make control variables, handled by Init.gmk - INIT_CONTROL_VARIABLES := LOG CONF SPEC JOBS CONF_CHECK + INIT_CONTROL_VARIABLES := LOG CONF SPEC JOBS CONF_CHECK COMPARE_BUILD # All known make control variables MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER @@ -53,12 +53,14 @@ # The variable MAKEOVERRIDES contains variable assignments from the command # line, but in reverse order to what the user entered. + # The '\#' <=> '\ 'dance is needed to keep values with space in them connected. COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES)))) # A list like FOO="val1" BAR="val2" containing all user-supplied make # variables that we should propagate. - USER_MAKE_VARS := $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \ - $(MAKEOVERRIDES)) + # The '\#' <=> '\ 'dance is needed to keep values with space in them connected. + USER_MAKE_VARS := $(subst \#,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \ + $(subst \ ,\#,$(MAKEOVERRIDES)))) # Setup information about available configurations, if any. build_dir=$(topdir)/build @@ -309,6 +311,59 @@ endif endef + # Parse COMPARE_BUILD into COMPARE_BUILD_* + # Syntax: COMPARE_BUILD=CONF=:PATCH=: + # MAKE=:COMP_OPTS=: + # COMP_DIR=| + # If neither CONF or PATCH is given, assume means CONF if it + # begins with "--", otherwise assume it means PATCH. + # MAKE and COMP_OPTS can only be used with CONF and/or PATCH specified. + # If any value contains "+", it will be replaced by space. + define ParseCompareBuild + ifneq ($$(COMPARE_BUILD), ) + ifneq ($$(findstring :, $$(COMPARE_BUILD)), ) + $$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \ + $$(if $$(filter PATCH=%, $$(part)), \ + $$(eval COMPARE_BUILD_PATCH=$$(strip $$(patsubst PATCH=%, %, $$(part)))) \ + ) \ + $$(if $$(filter CONF=%, $$(part)), \ + $$(eval COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \ + ) \ + $$(if $$(filter MAKE=%, $$(part)), \ + $$(eval COMPARE_BUILD_MAKE=$$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \ + ) \ + $$(if $$(filter COMP_OPTS=%, $$(part)), \ + $$(eval COMPARE_BUILD_COMP_OPTS=$$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \ + ) \ + $$(if $$(filter COMP_DIR=%, $$(part)), \ + $$(eval COMPARE_BUILD_COMP_DIR=$$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \ + ) \ + ) + else + # Separate handling for single field case, to allow for spaces in values. + ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), ) + COMPARE_BUILD_PATCH=$$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD))) + else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), ) + COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD)))) + else ifneq ($$(filter --%, $$(COMPARE_BUILD)), ) + # Assume CONF if value begins with -- + COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(COMPARE_BUILD))) + else + # Otherwise assume patch file + COMPARE_BUILD_PATCH=$$(strip $$(COMPARE_BUILD)) + endif + endif + ifneq ($$(COMPARE_BUILD_PATCH), ) + ifneq ($$(wildcard $$(TOPDIR)/$$(COMPARE_BUILD_PATCH)), ) + # Assume relative path, if file exists + COMPARE_BUILD_PATCH := $$(wildcard $$(TOPDIR)/$$(COMPARE_BUILD_PATCH)) + else ifeq ($$(wildcard $$(COMPARE_BUILD_PATCH)), ) + $$(error Patch file $$(COMPARE_BUILD_PATCH) does not exist) + endif + endif + endif + endef + define RotateLogFiles $(RM) $(BUILD_LOG).old 2> /dev/null $(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true diff -r 43c458023730 -r 79fb83da8f88 make/common/JavaCompilation.gmk --- a/make/common/JavaCompilation.gmk Sat Sep 26 09:21:16 2015 -0700 +++ b/make/common/JavaCompilation.gmk Wed Jul 05 20:51:00 2017 +0200 @@ -155,6 +155,7 @@ # When this macro is run in the same makefile as the java compilation, dependencies are # transfered in make variables. When the macro is run in a different makefile than the # java compilation, the dependencies need to be found in the filesystem. + $1_ORIG_DEPS := $$($1_DEPENDENCIES) ifeq ($$($1_DEPENDENCIES), ) # Add all source roots to the find cache since we are likely going to run find # on these more than once. The cache will only be updated if necessary. @@ -266,7 +267,8 @@ # Include all variables of significance in the vardeps file $1_VARDEPS := $(JAR) $$($1_JAR_CREATE_OPTIONS) $$($1_MANIFEST) \ - $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR) + $$($1_JARMAIN) $$($1_EXTRA_MANIFEST_ATTR) $$($1_ORIG_DEPS) $$($1_SRCS) \ + $$($1_INCLUDES) $$($1_EXCLUDES) $$($1_EXCLUDE_FILES) $$($1_EXTRA_FILES) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$(dir $$($1_JAR))_the.$$($1_JARNAME).vardeps) # Here is the rule that creates/updates the jar file. @@ -280,7 +282,7 @@ # potential changes. $$(if $$(filter $$($1_VARDEPS_FILE) $$($1_MANIFEST), $$?), \ $$(if $$($1_MANIFEST), \ - $(CP) $$($1_MANIFEST) $$($1_MANIFEST_FILE) $$(NEWLINE) \ + $(SED) -e '$(DOLLAR)$(DOLLAR)a\' $$($1_MANIFEST) > $$($1_MANIFEST_FILE) $$(NEWLINE) \ , \ $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE) $$(NEWLINE)) \ $$(if $$($1_JARMAIN), \ @@ -417,6 +419,7 @@ # HEADERS:=path to directory where all generated c-headers are written. # DEPENDS:=Extra dependecy # DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit. +# KEEP_DUPS:=Do not remove duplicate file names from different source roots. SetupJavaCompilation = $(NamedParamsMacroTemplate) define SetupJavaCompilationBody @@ -469,19 +472,27 @@ $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) endif - # Remove duplicate source files by keeping the first found of each duplicate. - # This allows for automatic overrides with custom or platform specific versions - # source files. - # - # For the smart javac wrapper case, add each removed file to an extra exclude - # file list to prevent sjavac from finding duplicate sources. - $1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \ - $$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \ - $$(if $$($1_$$(relative_src)), \ - $$(eval $1_SJAVAC_EXCLUDE_FILES += $$(s)), \ - $$(eval $1_$$(relative_src) := 1) $$(s)))) + ifneq ($$($1_KEEP_DUPS), true) + # Remove duplicate source files by keeping the first found of each duplicate. + # This allows for automatic overrides with custom or platform specific versions + # source files. + # + # For the smart javac wrapper case, add each removed file to an extra exclude + # file list to prevent sjavac from finding duplicate sources. + $1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \ + $$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \ + $$(if $$($1_$$(relative_src)), \ + $$(eval $1_SJAVAC_EXCLUDE_FILES += $$(s)), \ + $$(eval $1_$$(relative_src) := 1) $$(s)))) + endif - # Create the corresponding smart javac wrapper command line. + ifeq ($$(strip $$($1_SRCS)), ) + $$(error No source files found for $1) + endif + + $1_SAFE_NAME := $$(strip $$(subst /,_, $1)) + + # Create the corresponding smart javac wrapper command line. $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \ $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \ $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES) $$($1_SJAVAC_EXCLUDE_FILES))) \ @@ -560,14 +571,15 @@ $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS) $$($1_FLAGS) \ - $$($1_HEADERS_ARG) $$($1_BIN) + $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \ + $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)) $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) $(ECHO) Compiling $1 - $(call LogFailures, $$($1_BIN)/_the.$1_batch.log, $1, \ + $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ $$($1_JVM) $$($1_SJAVAC) \ $$($1_REMOTE) \ -j 1 \ @@ -575,6 +587,7 @@ --permit-sources-without-package \ --compare-found-sources $$($1_BIN)/_the.$1_batch.tmp \ --log=$(LOG_LEVEL) \ + --state-dir=$$($1_BIN) \ $$($1_SJAVAC_ARGS) \ $$($1_FLAGS) \ $$($1_HEADERS_ARG) \ @@ -615,7 +628,9 @@ $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers endif - $1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) $$($1_HEADERS_ARG) + $1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \ + $$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \ + $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) # When not using sjavac, pass along all sources to javac using an @file. @@ -624,7 +639,7 @@ $(RM) $$($1_BIN)/_the.$1_batch $$($1_BIN)/_the.$1_batch.tmp $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.$1_batch.tmp) $(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1 - $(call LogFailures, $$($1_BIN)/_the.$1_batch.log, $1, \ + $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \ $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \ -implicit:none \ -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp) && \ diff -r 43c458023730 -r 79fb83da8f88 make/common/NativeCompilation.gmk --- a/make/common/NativeCompilation.gmk Sat Sep 26 09:21:16 2015 -0700 +++ b/make/common/NativeCompilation.gmk Wed Jul 05 20:51:00 2017 +0200 @@ -204,18 +204,18 @@ 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).log, $1_$$(notdir $2), \ + $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \ $$($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).log, $1_$$(notdir $2), \ + $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \ $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) endif else # The Visual Studio compiler lacks a feature for generating make dependencies, but by # setting -showIncludes, all included files are printed. These are filtered out and # parsed into make dependences. - ($(call LogFailures, $$($1_$2_OBJ).log, $1_$$(notdir $2), \ + ($(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \ $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \ $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) ; echo $$$$? > $$($1_$2_DEP).exitvalue) \ | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v -e "^Note: including file:" \ @@ -353,6 +353,7 @@ $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) $1_NOSUFFIX:=$$($1_PROGRAM) endif + $1_SAFE_NAME := $$(strip $$(subst /,_, $1)) ifeq (,$$($1_TARGET)) $$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation) @@ -414,6 +415,10 @@ $1_SRCS += $$($1_EXTRA_FILES) + ifeq (,$$($1_SRCS)) + $$(error No sources found for $1 when looking inside the dirs $$($1_SRC)) + endif + # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides # a reproducable order on the input files to the linker). $1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS))) @@ -549,8 +554,8 @@ else $(ECHO) $$(strip 'Updating $$($1_BASENAME)' \ $$(if $$(filter-out %.vardeps, $$?), \ - 'from $$(words $$(filter-out %.vardeps, $$?)) file(s)') \ - $$(if $$(filter %.vardeps, $$?), 'due to makefile changes')) + 'due to $$(words $$(filter-out %.vardeps, $$?)) file(s)', \ + $$(if $$(filter %.vardeps, $$?), 'due to makefile changes'))) endif $(TOUCH) $$@ @@ -674,7 +679,7 @@ $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \ $$($1_VARDEPS_FILE) $(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)" - $(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \ + $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $(LD_OUT_OPTION)$$@ \ $$($1_EXPECTED_OBJS) $$($1_RES) \ @@ -697,7 +702,7 @@ # Generating a static library, ie object file archive. $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_VARDEPS_FILE) $(ECHO) $(LOG_INFO) "Archiving $$($1_STATIC_LIBRARY)" - $(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \ + $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \ $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \ $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)) endif @@ -715,7 +720,7 @@ $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \ $$($1_VARDEPS_FILE) $(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)" - $(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \ + $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \ $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \ $(EXE_OUT_OPTION)$$($1_TARGET) \ $$($1_EXPECTED_OBJS) $$($1_RES) \