|
Message-ID: <20150119062800.GF4574@brightrain.aerifal.cx> Date: Mon, 19 Jan 2015 01:28:00 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: "checking whether compiler is gcc... no" on a non-English locale 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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.