Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk13u-dev Public archive

Commit 88667e4

Browse files
Olga MikhaltsovaYuri Nesterenko
Olga Mikhaltsova
authored and
Yuri Nesterenko
committed
8065704: Set LC_ALL=C for all relevant commands in the build system
Backport-of: 54a3efc
1 parent 2bdb009 commit 88667e4

8 files changed

+32
-20
lines changed

make/RunTestsPrebuilt.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ else ifeq ($(OPENJDK_TARGET_OS), macosx)
230230
NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
231231
MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
232232
else ifeq ($(OPENJDK_TARGET_OS), solaris)
233-
NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
233+
NUM_CORES := $(shell /usr/sbin/psrinfo -v | $(GREP) -c on-line)
234234
MEMORY_SIZE := $(shell \
235235
/usr/sbin/prtconf 2> /dev/null | $(GREP) "^Memory [Ss]ize" | $(AWK) '{print $$3}' \
236236
)

make/RunTestsPrebuiltSpec.gmk

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
# Fake minimalistic spec file for RunTestsPrebuilt.gmk.
2828
################################################################################
2929

30+
# Make sure all shell commands are executed with the C locale
31+
export LC_ALL := C
32+
3033
define VerifyVariable
3134
ifeq ($$($1), )
3235
$$(info Error: Variable $1 is missing, needed by RunTestPrebuiltSpec.gmk)

make/autoconf/basics.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ AC_DEFUN_ONCE([BASIC_INIT],
411411
# Save the path variable before it gets changed
412412
ORIGINAL_PATH="$PATH"
413413
AC_SUBST(ORIGINAL_PATH)
414-
DATE_WHEN_CONFIGURED=`LANG=C date`
414+
DATE_WHEN_CONFIGURED=`date`
415415
AC_SUBST(DATE_WHEN_CONFIGURED)
416416
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
417417
])

make/autoconf/build-performance.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ AC_DEFUN([BPERF_CHECK_CORES],
3535
FOUND_CORES=yes
3636
elif test -x /usr/sbin/psrinfo; then
3737
# Looks like a Solaris system
38-
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
38+
NUM_CORES=`/usr/sbin/psrinfo -v | grep -c on-line`
3939
FOUND_CORES=yes
4040
elif test -x /usr/sbin/sysctl; then
4141
# Looks like a MacOSX system

make/autoconf/configure

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ fi
4343
export CONFIG_SHELL=$BASH
4444
export _as_can_reexec=no
4545

46+
# Make sure all shell commands are executed with the C locale
47+
export LC_ALL=C
48+
4649
if test "x$CUSTOM_CONFIG_DIR" != x; then
4750
custom_hook=$CUSTOM_CONFIG_DIR/custom-hook.m4
4851
if test ! -e $custom_hook; then

make/autoconf/spec.gmk.in

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ COMMA:=,
5151
# What make to use for main processing, after bootstrapping top-level Makefile.
5252
MAKE := @MAKE@
5353

54+
# Make sure all shell commands are executed with the C locale
55+
export LC_ALL := C
56+
5457
# The default make arguments
5558
MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \
5659
MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" $(MAKE_LOG_VARS)

make/common/JavaCompilation.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ define add_file_to_clean
122122
$$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2
123123
$$(call LogInfo, Cleaning $$(patsubst $(OUTPUTDIR)/%,%, $$@))
124124
$$(call MakeTargetDir)
125-
export LC_ALL=C ; ( $(CAT) $$< && $(ECHO) "" ) \
125+
( $(CAT) $$< && $(ECHO) "" ) \
126126
| $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
127127
-e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ ]*#.*/#/g' \
128128
| $(SED) -f "$(TOPDIR)/make/common/support/unicode2x.sed" \

make/scripts/compare.sh

+19-16
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ if [ -z "$TOPDIR" ]; then
3434
exit 1
3535
fi
3636

37+
# Make sure all shell commands are executed with the C locale
38+
export LC_ALL=C
39+
3740
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
3841
FULLDUMP_CMD="$OTOOL -v -V -h -X -d"
3942
LDD_CMD="$OTOOL -L"
@@ -110,7 +113,7 @@ elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
110113
"
111114
fi
112115
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
113-
DIS_DIFF_FILTER="LANG=C $SED \
116+
DIS_DIFF_FILTER="$SED \
114117
-e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/' \
115118
-e 's/-20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]-[0-2][0-9]\{5\}/<DATE>/g' \
116119
-e 's/), built on .*/), <DATE>/' \
@@ -134,15 +137,15 @@ diff_text() {
134137

135138
if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
136139
# Filter out date string, ant version and java version differences.
137-
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
140+
TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
138141
$GREP '^[<>]' | \
139142
$SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
140143
-e '/[<>] Created-By: .* (Oracle [Corpatin)]*/d' \
141144
-e '/[<>] [Corpatin]*)/d' \
142145
-e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d')
143146
fi
144147
if test "x$SUFFIX" = "xjava"; then
145-
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
148+
TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
146149
$GREP '^[<>]' | \
147150
$SED -e '/[<>] \* from.*\.idl/d' \
148151
-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 @@ diff_text() {
197200
fi
198201
if test "x$SUFFIX" = "xproperties"; then
199202
# Filter out date string differences.
200-
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \
203+
TMP=$($DIFF $OTHER_FILE $THIS_FILE | \
201204
$GREP '^[<>]' | \
202205
$SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d')
203206
fi
@@ -207,7 +210,7 @@ diff_text() {
207210
-e 's/<font size=-1>/<font size=\"-1\">/g'"
208211
$CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered
209212
$CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered
210-
TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
213+
TMP=$($DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \
211214
$GREP '^[<>]' | \
212215
$SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \
213216
-e '/[<>] <meta name="date" content=".*">/d' )
@@ -548,11 +551,11 @@ compare_zip_file() {
548551
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
549552
# On solaris, there is no -q option.
550553
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
551-
LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
554+
$DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \
552555
| $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \
553556
> $CONTENTS_DIFF_FILE
554557
else
555-
LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
558+
$DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
556559
fi
557560

558561
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE)
@@ -599,11 +602,11 @@ compare_zip_file() {
599602
if [ -n "$SHOW_DIFFS" ]; then
600603
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
601604
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
602-
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
605+
$DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
603606
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
604-
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
607+
$DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
605608
else
606-
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
609+
$DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
607610
fi
608611
done
609612
fi
@@ -636,7 +639,7 @@ compare_jmod_file() {
636639
$JMOD list $THIS_JMOD | sort > $THIS_JMOD_LIST
637640
$JMOD list $OTHER_JMOD | sort > $OTHER_JMOD_LIST
638641
JMOD_LIST_DIFF_FILE=$WORK_DIR/$JMOD_FILE.list.diff
639-
LC_ALL=C $DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE
642+
$DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE
640643

641644
ONLY_THIS=$($GREP "^<" $JMOD_LIST_DIFF_FILE)
642645
ONLY_OTHER=$($GREP "^>" $JMOD_LIST_DIFF_FILE)
@@ -917,7 +920,7 @@ compare_bin_file() {
917920
> $WORK_FILE_BASE.symbols.this
918921
fi
919922

920-
LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
923+
$DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
921924
if [ -s $WORK_FILE_BASE.symbols.diff ]; then
922925
SYM_MSG=" diff "
923926
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
@@ -957,9 +960,9 @@ compare_bin_file() {
957960
| $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
958961
(cd $FILE_WORK_DIR && $RM -f $NAME)
959962

960-
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
963+
$DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \
961964
> $WORK_FILE_BASE.deps.diff
962-
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
965+
$DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \
963966
> $WORK_FILE_BASE.deps.diff.uniq
964967

965968
if [ -s $WORK_FILE_BASE.deps.diff ]; then
@@ -1009,7 +1012,7 @@ compare_bin_file() {
10091012
> $WORK_FILE_BASE.fulldump.this 2>&1 &
10101013
wait
10111014

1012-
LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
1015+
$DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
10131016
> $WORK_FILE_BASE.fulldump.diff
10141017

10151018
if [ -s $WORK_FILE_BASE.fulldump.diff ]; then
@@ -1056,7 +1059,7 @@ compare_bin_file() {
10561059
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 &
10571060
wait
10581061

1059-
LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
1062+
$DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
10601063

10611064
if [ -s $WORK_FILE_BASE.dis.diff ]; then
10621065
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')

0 commit comments

Comments
 (0)