Skip to content

Commit

Permalink
scripts/mkcompile_h: move LC_ALL=C to '$LD -v'
Browse files Browse the repository at this point in the history
Minimize the scope of LC_ALL=C like before commit 87c94bf ("kbuild:
override build timestamp & version").

Give LC_ALL=C to '$LD -v' to get the consistent version output, as commit
bcbcf50 ("kbuild: fix ld-version.sh to not be affected by locale")
mentioned the LD version is affected by locale.

While I was here, I merged two sed invocations.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Sep 28, 2022
1 parent a55f283 commit c7b594f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/mkcompile_h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ LD=$3
# Do not expand names
set -f

# Fix the language to get consistent output
LC_ALL=C
export LC_ALL

if test -z "$KBUILD_BUILD_USER"; then
LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
else
Expand All @@ -23,8 +19,8 @@ else
LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
fi

LD_VERSION=$($LD -v | head -n1 | sed 's/(compatible with [^)]*)//' \
| sed 's/[[:space:]]*$//')
LD_VERSION=$(LC_ALL=C $LD -v | head -n1 |
sed -e 's/(compatible with [^)]*)//' -e 's/[[:space:]]*$//')

cat <<EOF
#define UTS_MACHINE "${UTS_MACHINE}"
Expand Down

0 comments on commit c7b594f

Please sign in to comment.