8065704: Set LC_ALL=C for all relevant commands in the build system
Reviewed-by: naoto, erikj
--- a/make/RunTestsPrebuilt.gmk Wed Oct 09 14:07:44 2019 +0200
+++ b/make/RunTestsPrebuilt.gmk Fri Oct 11 09:43:18 2019 +0200
@@ -230,7 +230,7 @@
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
else ifeq ($(OPENJDK_TARGET_OS), solaris)
- NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
+ NUM_CORES := $(shell /usr/sbin/psrinfo -v | $(GREP) -c on-line)
MEMORY_SIZE := $(shell \
/usr/sbin/prtconf 2> /dev/null | $(GREP) "^Memory [Ss]ize" | $(AWK) '{print $$3}' \
)
--- a/make/RunTestsPrebuiltSpec.gmk Wed Oct 09 14:07:44 2019 +0200
+++ b/make/RunTestsPrebuiltSpec.gmk Fri Oct 11 09:43:18 2019 +0200
@@ -27,6 +27,9 @@
# Fake minimalistic spec file for RunTestsPrebuilt.gmk.
################################################################################
+# Make sure all shell commands are executed with the C locale
+export LC_ALL := C
+
define VerifyVariable
ifeq ($$($1), )
$$(info Error: Variable $1 is missing, needed by RunTestPrebuiltSpec.gmk)
--- a/make/autoconf/basics.m4 Wed Oct 09 14:07:44 2019 +0200
+++ b/make/autoconf/basics.m4 Fri Oct 11 09:43:18 2019 +0200
@@ -427,7 +427,7 @@
# Save the path variable before it gets changed
ORIGINAL_PATH="$PATH"
AC_SUBST(ORIGINAL_PATH)
- DATE_WHEN_CONFIGURED=`LANG=C date`
+ DATE_WHEN_CONFIGURED=`date`
AC_SUBST(DATE_WHEN_CONFIGURED)
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
])
--- a/make/autoconf/build-performance.m4 Wed Oct 09 14:07:44 2019 +0200
+++ b/make/autoconf/build-performance.m4 Fri Oct 11 09:43:18 2019 +0200
@@ -35,7 +35,7 @@
FOUND_CORES=yes
elif test -x /usr/sbin/psrinfo; then
# Looks like a Solaris system
- NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
+ NUM_CORES=`/usr/sbin/psrinfo -v | grep -c on-line`
FOUND_CORES=yes
elif test -x /usr/sbin/sysctl; then
# Looks like a MacOSX system
--- a/make/autoconf/configure Wed Oct 09 14:07:44 2019 +0200
+++ b/make/autoconf/configure Fri Oct 11 09:43:18 2019 +0200
@@ -43,6 +43,9 @@
export CONFIG_SHELL=$BASH
export _as_can_reexec=no
+# Make sure all shell commands are executed with the C locale
+export LC_ALL=C
+
if test "x$CUSTOM_CONFIG_DIR" != x; then
custom_hook=$CUSTOM_CONFIG_DIR/custom-hook.m4
if test ! -e $custom_hook; then
--- a/make/autoconf/spec.gmk.in Wed Oct 09 14:07:44 2019 +0200
+++ b/make/autoconf/spec.gmk.in Fri Oct 11 09:43:18 2019 +0200
@@ -51,6 +51,9 @@
# What make to use for main processing, after bootstrapping top-level Makefile.
MAKE := @MAKE@
+# Make sure all shell commands are executed with the C locale
+export LC_ALL := C
+
# The default make arguments
MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \
MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" $(MAKE_LOG_VARS)
--- a/make/common/JavaCompilation.gmk Wed Oct 09 14:07:44 2019 +0200
+++ b/make/common/JavaCompilation.gmk Fri Oct 11 09:43:18 2019 +0200
@@ -122,7 +122,7 @@
$$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
$$(call LogInfo, Cleaning $$(patsubst $(OUTPUTDIR)/%,%, $$@))
$$(call MakeTargetDir)
- export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
+ ( $(CAT) $$< && $(ECHO) "" ) \
| $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
-e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ ]*#.*/#/g' \
| $(SED) -f "$(TOPDIR)/make/common/support/unicode2x.sed" \
--- a/make/scripts/compare.sh Wed Oct 09 14:07:44 2019 +0200
+++ b/make/scripts/compare.sh Fri Oct 11 09:43:18 2019 +0200
@@ -34,6 +34,9 @@
exit 1
fi
+# Make sure all shell commands are executed with the C locale
+export LC_ALL=C
+
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
FULLDUMP_CMD="$OTOOL -v -V -h -X -d"
LDD_CMD="$OTOOL -L"
@@ -110,7 +113,7 @@
"
fi
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
- DIS_DIFF_FILTER="LANG=C $SED \
+ DIS_DIFF_FILTER="$SED \
-e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/' \
-e 's/-20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]-[0-2][0-9]\{5\}/<DATE>/g' \
-e 's/), built on .*/), <DATE>/' \
@@ -134,7 +137,7 @@
if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
# Filter out date string, ant version and java version differences.
- TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
+ TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
$GREP '^[<>]' | \
$SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
-e '/[<>] Created-By: .* (Oracle [Corpatin)]*/d' \
@@ -142,7 +145,7 @@
-e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
fi
if test "x$SUFFIX" = "xjava"; then
- TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
+ TMP=$($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' \
@@ -197,7 +200,7 @@
fi
if test "x$SUFFIX" = "xproperties"; then
# Filter out date string differences.
- TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
+ TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
$GREP '^[<>]' | \
$SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d')
fi
@@ -207,7 +210,7 @@
-e 's/<font size=-1>/<font size=\"-1\">/g'"
$CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered
$CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered
- TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
+ TMP=$($DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
$GREP '^[<>]' | \
$SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \
-e '/[<>] <meta name="date" content=".*">/d' )
@@ -554,11 +557,11 @@
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
# On solaris, there is no -q option.
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
- LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
+ $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
| $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \
> $CONTENTS_DIFF_FILE
else
- LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
+ $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
fi
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE)
@@ -605,11 +608,11 @@
if [ -n "$SHOW_DIFFS" ]; then
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
- LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
+ $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
- LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
+ $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
else
- LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
+ $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
fi
done
fi
@@ -642,7 +645,7 @@
$JMOD list $THIS_JMOD | sort > $THIS_JMOD_LIST
$JMOD list $OTHER_JMOD | sort > $OTHER_JMOD_LIST
JMOD_LIST_DIFF_FILE=$WORK_DIR/$JMOD_FILE.list.diff
- LC_ALL=C $DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE
+ $DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE
ONLY_THIS=$($GREP "^<" $JMOD_LIST_DIFF_FILE)
ONLY_OTHER=$($GREP "^>" $JMOD_LIST_DIFF_FILE)
@@ -924,7 +927,7 @@
> $WORK_FILE_BASE.symbols.this
fi
- LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
+ $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
if [ -s $WORK_FILE_BASE.symbols.diff ]; then
SYM_MSG=" diff "
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
@@ -964,9 +967,9 @@
| $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
(cd $FILE_WORK_DIR && $RM -f $NAME)
- LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
+ $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
> $WORK_FILE_BASE.deps.diff
- LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
+ $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
> $WORK_FILE_BASE.deps.diff.uniq
if [ -s $WORK_FILE_BASE.deps.diff ]; then
@@ -1016,7 +1019,7 @@
> $WORK_FILE_BASE.fulldump.this 2>&1 &
wait
- LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
+ $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
> $WORK_FILE_BASE.fulldump.diff
if [ -s $WORK_FILE_BASE.fulldump.diff ]; then
@@ -1063,7 +1066,7 @@
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 &
wait
- LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
+ $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
if [ -s $WORK_FILE_BASE.dis.diff ]; then
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')