diff --git a/tool/abi_symbols b/tool/abi_symbols index 5e6534755e..9867b70c06 100755 --- a/tool/abi_symbols +++ b/tool/abi_symbols @@ -11,7 +11,7 @@ # # normalize sort order across platforms -set env(LC_COLLATE) C +set env(LC_ALL) C # obtain symbol information via 'nm' set symbols [exec nm --format posix --dynamic $argv | sort] diff --git a/tool/builddir/build.mk b/tool/builddir/build.mk index 6b6f2e2e54..f8f00f3596 100644 --- a/tool/builddir/build.mk +++ b/tool/builddir/build.mk @@ -67,9 +67,6 @@ export ECHO ?= echo -e export CONTRIB_DIR export BOARD -# Force stable sorting order -export LC_COLLATE=C - # # Convert user-defined directories to absolute directories # diff --git a/tool/check_abi b/tool/check_abi index 8b14537783..3c25f523ca 100755 --- a/tool/check_abi +++ b/tool/check_abi @@ -12,7 +12,7 @@ # # normalize sort order across platforms -set env(LC_COLLATE) C +set env(LC_ALL) C set lib_path [lindex $argv 0] set abi_path [lindex $argv 1] diff --git a/tool/depot/mk/common.inc b/tool/depot/mk/common.inc index 71b3b41716..d77d89834a 100644 --- a/tool/depot/mk/common.inc +++ b/tool/depot/mk/common.inc @@ -32,4 +32,4 @@ EMPTY := file_content = $(if $(wildcard $1),$(shell cat $1),) # Force stable sorting order -export LC_COLLATE=C +SORT := LC_ALL=C sort diff --git a/tool/depot/mk/extract.inc b/tool/depot/mk/extract.inc index 66b0032465..e2390e0a89 100644 --- a/tool/depot/mk/extract.inc +++ b/tool/depot/mk/extract.inc @@ -214,8 +214,8 @@ _check_hash: $(DEPOT_ARCHIVE_DIR).hash checked_recipe_hash_value_exists # command). # HASH_CMD := cd $(DEPOT_ARCHIVE_DIR); \ - (find . -type f | sort; \ - find . -type f | sort | xargs -d '\n' cat) \ + (find . -type f | $(SORT); \ + find . -type f | $(SORT) | xargs -d '\n' cat) \ | $(HASHSUM) | sed "s/ .*//" # diff --git a/tool/depot/mk/extract_post_dependencies.inc b/tool/depot/mk/extract_post_dependencies.inc index d1f06e8234..8c43918687 100644 --- a/tool/depot/mk/extract_post_dependencies.inc +++ b/tool/depot/mk/extract_post_dependencies.inc @@ -34,7 +34,7 @@ endif # # \param $1 absolute file path # -sorted_file_content = $(if $(wildcard $1),$(shell cat $1 | sort -u),\ +sorted_file_content = $(if $(wildcard $1),$(shell cat $1 | $(SORT) -u),\ $(error Failed to read file $1)) # diff --git a/tool/ports/mk/common.inc b/tool/ports/mk/common.inc index b4e420d85d..9c0a431b71 100644 --- a/tool/ports/mk/common.inc +++ b/tool/ports/mk/common.inc @@ -28,9 +28,6 @@ MSG_GENERATE := $(MSG_PREFIX)"generate " MSG_EXTRACT := $(MSG_PREFIX)"extract " MSG_GIT := $(MSG_PREFIX_TXT)git -# Force stable sorting order -export LC_COLLATE=C - # # Utility to check if a tool is installed #