* "checking whether compiler is gcc... no" on a non-English locale
@ 2015-01-19 6:20 Vadim Ushakov
2015-01-19 6:28 ` Rich Felker
0 siblings, 1 reply; 2+ messages in thread
From: Vadim Ushakov @ 2015-01-19 6:20 UTC (permalink / raw)
To: musl
Hello,
musl's ./configure fails to properly detect gcc compiler when running
on a non-English locale.
Output of gcc -v is localized. For example:
$ env LC_ALL=C gcc -v |& tail -1
gcc version 4.9.2 20141224 (prerelease) (GCC)
$ env LC_ALL=ru_RU.utf8 gcc -v |& tail -1
gcc версия 4.9.2 20141224 (prerelease) (GCC)
$ env LC_ALL=fi_FI.utf8 gcc -v |& tail -1
gcc-versio 4.9.2 20141224 (prerelease) (GCC)
Since ./configure attempts to detect gcc by fnmatch-ing output of gcc
-v against the pattern '*gcc\ version*', it fails.
Possible fix:
diff --git a/configure b/configure
index 673d291..e23a269 100755
--- a/configure
+++ b/configure
@@ -204,7 +204,7 @@ fi
# musl-gcc wrapper, and for critical bug detection in some gcc versions.
#
printf "checking whether compiler is gcc... "
-if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then
+if fnmatch '*gcc\ version*' "$(env LC_ALL=C $CC -v 2>&1)" ; then
cc_is_gcc=yes
else
cc_is_gcc=no
--
Regards,
Vadim Ushakov
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: "checking whether compiler is gcc... no" on a non-English locale
2015-01-19 6:20 "checking whether compiler is gcc... no" on a non-English locale Vadim Ushakov
@ 2015-01-19 6:28 ` Rich Felker
0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2015-01-19 6:28 UTC (permalink / raw)
To: musl
On Mon, Jan 19, 2015 at 02:20:10PM +0800, Vadim Ushakov wrote:
> Hello,
>
> musl's ./configure fails to properly detect gcc compiler when running
> on a non-English locale.
>
> Output of gcc -v is localized. For example:
>
> $ env LC_ALL=C gcc -v |& tail -1
> gcc version 4.9.2 20141224 (prerelease) (GCC)
> $ env LC_ALL=ru_RU.utf8 gcc -v |& tail -1
> gcc версия 4.9.2 20141224 (prerelease) (GCC)
> $ env LC_ALL=fi_FI.utf8 gcc -v |& tail -1
> gcc-versio 4.9.2 20141224 (prerelease) (GCC)
Interesting. Thanks for bringing this to our attention.
> Since ./configure attempts to detect gcc by fnmatch-ing output of gcc
> -v against the pattern '*gcc\ version*', it fails.
>
> Possible fix:
>
> diff --git a/configure b/configure
> index 673d291..e23a269 100755
> --- a/configure
> +++ b/configure
> @@ -204,7 +204,7 @@ fi
> # musl-gcc wrapper, and for critical bug detection in some gcc versions.
> #
> printf "checking whether compiler is gcc... "
> -if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then
> +if fnmatch '*gcc\ version*' "$(env LC_ALL=C $CC -v 2>&1)" ; then
Yes, something like that should work. I generally don't like using
LC_ALL (rather overriding just the category needed), but since LC_ALL
may already be set, and since the correct LC_CTYPE, etc. aren't needed
for this test anyway, I think it's probably acceptable.
Rich
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-19 6:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-19 6:20 "checking whether compiler is gcc... no" on a non-English locale Vadim Ushakov
2015-01-19 6:28 ` Rich Felker
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).