浏览代码

UPSTREAM: kbuild: fix ld-version.sh to not be affected by locale

ld-version.sh checks the output from $(LD) --version, but it has a
problem on some locales.

For example, in Italian:

  $ LC_MESSAGES=it_IT.UTF-8 ld --version | head -n 1
  ld di GNU (GNU Binutils for Debian) 2.35.2

This makes ld-version.sh fail because it expects "GNU ld" for the
BFD linker case.

Add LC_ALL=C to override the user's locale.

BTW, setting LC_MESSAGES=C (or LANG=C) is not enough because it is
ineffective if LC_ALL is set on the user's environment.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=212105
Reported-by: Marco Scardovi
Reported-by: Andy Shevchenko <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Recensito-da: Nick Desaulniers <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
(cherry picked from commit bcbcf50f521843445c9ea320a0569874f88c4b7a)
Bug: 210043760
Signed-off-by: Nick Desaulniers <[email protected]>
Change-Id: I6199f965c921344d17878ed08f386ac9787e29c1
Masahiro Yamada 4 年之前
父节点
当前提交
c49519b3cc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scripts/ld-version.sh

+ 1 - 1
scripts/ld-version.sh

@@ -29,7 +29,7 @@ orig_args="$@"
 # Get the first line of the --version output.
 IFS='
 '
-set -- $("$@" --version)
+set -- $(LC_ALL=C "$@" --version)
 
 # Split the line on spaces.
 IFS=' '