From: Nathan Chancellor <nathan@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Bernhard Rosenkränzer" <bero@lindev.ch>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kbuild: fix ld-version.sh to not be affected by locale
Date: Fri, 12 Mar 2021 12:49:56 -0700 [thread overview]
Message-ID: <20210312194956.vsikqyaya676qvcu@archlinux-ax161> (raw)
In-Reply-To: <20210312193814.132558-1-masahiroy@kernel.org>
On Sat, Mar 13, 2021 at 04:38:14AM +0900, Masahiro Yamada wrote:
> 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
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
LGTM, this is Debian's recommendation as well:
https://wiki.debian.org/Locale
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
>
> scripts/ld-version.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/ld-version.sh b/scripts/ld-version.sh
> index 30debf78aa09..1bf3aadde9de 100755
> --- a/scripts/ld-version.sh
> +++ b/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=' '
> --
> 2.27.0
>
prev parent reply other threads:[~2021-03-12 19:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-12 19:38 [PATCH] kbuild: fix ld-version.sh to not be affected by locale Masahiro Yamada
2021-03-12 19:43 ` Nick Desaulniers
2021-03-12 19:49 ` Nathan Chancellor [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210312194956.vsikqyaya676qvcu@archlinux-ax161 \
--to=nathan@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bero@lindev.ch \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=ndesaulniers@google.com \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.